/* ===================================================
   AdSense Account Tab
   Scoped under .contai-ads-manager for specificity
   =================================================== */

/* --- Empty State (not connected) --- */
.contai-ads-manager .contai-adsense-empty {
    padding: var(--contai-spacing-xl) var(--contai-spacing-lg);
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.contai-ads-manager .contai-adsense-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--contai-primary-glow);
    border: 1px solid var(--contai-primary-border);
    margin-bottom: var(--contai-spacing-md);
}

.contai-ads-manager .contai-adsense-empty__icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--contai-primary);
}

.contai-ads-manager .contai-adsense-empty h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--contai-neutral-700);
}

.contai-ads-manager .contai-adsense-empty > p {
    margin: 0 0 var(--contai-spacing-lg);
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--contai-neutral-500);
}

/* --- Steps --- */
.contai-ads-manager .contai-adsense-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
    margin-bottom: var(--contai-spacing-lg);
    border: 1px solid var(--contai-neutral-200);
    border-radius: var(--contai-radius-lg);
    overflow: hidden;
    background: var(--contai-neutral-50);
}

.contai-ads-manager .contai-adsense-step {
    display: flex;
    align-items: flex-start;
    gap: var(--contai-spacing-md);
    padding: var(--contai-spacing-md) 20px;
    border-bottom: 1px solid var(--contai-neutral-200);
    transition: background var(--contai-duration-fast) ease;
}

.contai-ads-manager .contai-adsense-step:last-child {
    border-bottom: none;
}

.contai-ads-manager .contai-adsense-step.active {
    background: #fff;
}

.contai-ads-manager .contai-adsense-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    background: var(--contai-neutral-200);
    color: var(--contai-neutral-500);
    margin-top: 2px;
    transition: background var(--contai-duration-fast) ease, color var(--contai-duration-fast) ease;
}

.contai-ads-manager .contai-adsense-step.active .contai-adsense-step__num {
    background: linear-gradient(135deg, var(--contai-primary) 0%, var(--contai-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.contai-ads-manager .contai-adsense-step h4 {
    margin: 0 0 2px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--contai-neutral-600);
}

.contai-ads-manager .contai-adsense-step.active h4 {
    color: var(--contai-neutral-700);
}

.contai-ads-manager .contai-adsense-step p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--contai-neutral-500);
}

/* --- OAuth Connect Button --- */
.contai-ads-manager .contai-btn-oauth {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--contai-primary) 0%, var(--contai-primary-dark) 100%);
    border: 1px solid var(--contai-primary);
    border-radius: var(--contai-radius-md);
    cursor: pointer;
    box-shadow: var(--contai-shadow-sm);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    line-height: 1.4;
}

.contai-ads-manager .contai-btn-oauth .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.contai-ads-manager .contai-btn-oauth:hover {
    background: linear-gradient(135deg, var(--contai-primary-dark) 0%, var(--contai-primary-darker) 100%);
    border-color: var(--contai-primary-darker);
    box-shadow: var(--contai-shadow-md);
    transform: translateY(-1px);
    color: #fff;
}

.contai-ads-manager .contai-btn-oauth:active {
    background: var(--contai-primary-darker);
    transform: translateY(0);
    box-shadow: var(--contai-shadow-sm);
}

.contai-ads-manager .contai-btn-oauth:focus-visible {
    outline: 2px solid var(--contai-primary);
    outline-offset: 2px;
}

.contai-ads-manager .contai-btn-oauth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- Connected State --- */
.contai-ads-manager .contai-adsense-connected {
    padding: var(--contai-spacing-lg);
}

.contai-ads-manager .contai-adsense-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--contai-spacing-lg);
}

.contai-ads-manager .contai-adsense-header__left {
    display: flex;
    align-items: center;
    gap: var(--contai-spacing-sm);
}

.contai-ads-manager .contai-adsense-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--contai-success);
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: 20px;
}

.contai-ads-manager .contai-adsense-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.contai-ads-manager .contai-adsense-mid {
    font-size: 13px;
    font-weight: 500;
    color: var(--contai-neutral-500);
    font-family: var(--contai-font-mono);
}

/* --- Loading State --- */
.contai-ads-manager .contai-adsense-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: var(--contai-spacing-md) 0;
    color: var(--contai-neutral-500);
    font-size: 13px;
}

/* --- Feature Cards (status grid) --- */
.contai-ads-manager .contai-adsense-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--contai-spacing-sm);
}

.contai-ads-manager .contai-adsense-feature {
    display: flex;
    align-items: flex-start;
    gap: var(--contai-spacing-sm);
    padding: var(--contai-spacing-md);
    background: var(--contai-neutral-50);
    border: 1px solid var(--contai-neutral-200);
    border-radius: var(--contai-radius-md);
}

.contai-ads-manager .contai-adsense-feature__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--contai-radius-sm);
}

.contai-ads-manager .contai-adsense-feature__icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.contai-ads-manager .contai-adsense-feature__icon--blue {
    background: rgba(37, 99, 235, 0.08);
    color: var(--contai-primary);
}

.contai-ads-manager .contai-adsense-feature__icon--blue .dashicons {
    color: var(--contai-primary);
}

.contai-ads-manager .contai-adsense-feature__icon--green {
    background: rgba(5, 150, 105, 0.08);
    color: var(--contai-success);
}

.contai-ads-manager .contai-adsense-feature__icon--green .dashicons {
    color: var(--contai-success);
}

.contai-ads-manager .contai-adsense-feature__icon--amber {
    background: rgba(217, 119, 6, 0.08);
    color: var(--contai-warning);
}

.contai-ads-manager .contai-adsense-feature__icon--amber .dashicons {
    color: var(--contai-warning);
}

.contai-ads-manager .contai-adsense-feature__icon--purple {
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
}

.contai-ads-manager .contai-adsense-feature__icon--purple .dashicons {
    color: #7c3aed;
}

.contai-ads-manager .contai-adsense-feature h4 {
    margin: 0 0 2px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--contai-neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.contai-ads-manager .contai-adsense-feature p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--contai-neutral-700);
}

/* --- Earnings Summary --- */
.contai-ads-manager .contai-adsense-earnings-summary {
    margin-top: var(--contai-spacing-lg);
    padding-top: var(--contai-spacing-lg);
    border-top: 1px solid var(--contai-neutral-200);
}

.contai-ads-manager .contai-adsense-earnings-summary > h4 {
    margin: 0 0 var(--contai-spacing-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--contai-neutral-700);
}

.contai-ads-manager .contai-adsense-earnings-val {
    color: var(--contai-success) !important;
}

/* --- Disconnect Area --- */
.contai-ads-manager .contai-adsense-disconnect {
    display: flex;
    align-items: center;
    gap: var(--contai-spacing-sm);
    margin-top: var(--contai-spacing-lg);
    padding-top: var(--contai-spacing-lg);
    border-top: 1px solid var(--contai-neutral-200);
}

.contai-ads-manager .contai-adsense-disconnect .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.contai-ads-manager .contai-adsense-disconnect .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.contai-ads-manager .contai-btn-disconnect {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--contai-error);
    background: none;
    border: 1px solid var(--contai-error-border);
    border-radius: var(--contai-radius-md);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.contai-ads-manager .contai-btn-disconnect:hover {
    background: var(--contai-error-bg);
    color: #991b1b;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .contai-ads-manager .contai-adsense-empty {
        padding: var(--contai-spacing-lg) var(--contai-spacing-md);
    }

    .contai-ads-manager .contai-adsense-features {
        grid-template-columns: 1fr 1fr;
    }

    .contai-ads-manager .contai-adsense-connected {
        padding: var(--contai-spacing-md);
    }
}

@media (max-width: 480px) {
    .contai-ads-manager .contai-adsense-features {
        grid-template-columns: 1fr;
    }

    .contai-ads-manager .contai-adsense-disconnect {
        flex-direction: column;
        align-items: stretch;
    }
}
