/* ==========================================================================
   PLANOS E CRÉDITOS - TubeCalendar
   Atualizado com Agency Max + Publicações Max
   ========================================================================== */

#view-billing-section {
    display: none;
}

#view-billing-section[style*="display: block"] {
    display: block !important;
}

.billing-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    color: var(--text-primary);
}

.billing-hero {
    background: linear-gradient(135deg, #111111 0%, #2b0505 55%, #cc181e 100%);
    color: #ffffff;
    padding: 28px;
    border-radius: 22px;
    margin-bottom: 20px;
    box-shadow: 0 12px 34px rgba(204, 24, 30, 0.18);
}

.billing-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.billing-hero h2 {
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.8px;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.billing-hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    margin: 0;
}

.billing-currency-box {
    min-width: 160px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.billing-currency-box label {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
}

.billing-currency-box select {
    width: 100%;
    border: none;
    outline: none;
    border-radius: 10px;
    padding: 10px;
    font-weight: 800;
    background: #ffffff;
    color: #111111;
}

/* ==========================================================================
   STATUS DO PLANO
   Agora suporta 5 cards: plano, créditos, calendário, IA e Publicações Max
   ========================================================================== */

.billing-status-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.billing-status-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 14px;
    min-width: 0;
}

.billing-status-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.66);
    font-weight: 900;
    margin-bottom: 4px;
}

.billing-status-value {
    font-size: 22px;
    font-weight: 950;
    color: #ffffff;
    line-height: 1.1;
    word-break: break-word;
}

/* ==========================================================================
   ALERTA
   ========================================================================== */

.billing-alert {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffec99;
    color: #7a5400;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 700;
}

.billing-alert.active {
    display: block;
}

/* ==========================================================================
   SEÇÕES / CARDS
   ========================================================================== */

.billing-section {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.billing-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.billing-section-header h3 {
    font-size: 22px;
    line-height: 1.2;
    margin: 0;
    color: var(--text-primary);
}

.billing-section-header p {
    margin: 5px 0 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.billing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.billing-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 18px;
    padding: 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.2s ease;
    min-width: 0;
}

.billing-card:hover {
    border-color: var(--youtube-red);
    box-shadow: 0 10px 28px rgba(255, 0, 0, 0.08);
    transform: translateY(-2px);
}

.billing-card.recommended {
    border-color: var(--youtube-red);
}

.billing-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--youtube-red);
    color: #ffffff;
    font-size: 11px;
    font-weight: 950;
    padding: 5px 8px;
    border-radius: 999px;
    z-index: 2;
}

.billing-bonus-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 10px;
    font-weight: 950;
    padding: 2px 7px;
    border-radius: 6px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
    vertical-align: middle;
}

.billing-card h4 {
    font-size: 20px;
    margin: 0;
    color: var(--text-primary);
    padding-right: 70px;
}

.billing-card-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    min-height: 42px;
}

.billing-price {
    font-size: 30px;
    font-weight: 950;
    color: var(--text-primary);
    letter-spacing: -0.8px;
    line-height: 1.05;
}

.billing-price small {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 700;
}

.billing-features {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.billing-features li {
    display: flex;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.35;
}

.billing-features li::before {
    content: "✓";
    color: #2e7d32;
    font-weight: 950;
    flex: 0 0 auto;
}

.billing-btn {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--youtube-red);
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    margin-top: auto;
    transition: all 0.2s ease;
}

.billing-btn:hover {
    background: var(--youtube-red-dark);
    transform: translateY(-1px);
}

.billing-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.billing-btn.secondary {
    background: #111111;
    color: #ffffff;
}

.billing-btn.secondary:hover {
    background: #333333;
}

.billing-btn.ghost {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.billing-btn.ghost:hover {
    background: var(--border-color);
}

/* ==========================================================================
   TABELA
   ========================================================================== */

.billing-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.billing-table th,
.billing-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 14px;
}

.billing-table th {
    color: var(--text-primary);
    background: var(--bg-hover);
    font-weight: 900;
}

.billing-table td {
    color: var(--text-primary);
}

.credit-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff3e0;
    color: #b45309;
    font-size: 12px;
    font-weight: 950;
}

.billing-note {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.billing-note strong {
    color: var(--text-primary);
}

/* ==========================================================================
   CORREÇÃO TEMA ESCURO - PLANOS E CRÉDITOS
   ========================================================================== */

body.theme-dark .billing-container {
    color: #ffffff;
}

body.theme-dark .billing-section {
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #263244;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

body.theme-dark .billing-section-header h3,
body.theme-dark .billing-section h3 {
    color: #ffffff !important;
}

body.theme-dark .billing-section-header p,
body.theme-dark .billing-section p {
    color: #cbd5e1 !important;
}

body.theme-dark .billing-card {
    background: #111827;
    color: #ffffff;
    border-color: #263244;
}

body.theme-dark .billing-card:hover {
    border-color: var(--youtube-red);
    box-shadow: 0 12px 34px rgba(255, 0, 0, 0.16);
}

body.theme-dark .billing-card.recommended {
    border-color: var(--youtube-red);
}

body.theme-dark .billing-card h4 {
    color: #ffffff !important;
}

body.theme-dark .billing-card-subtitle {
    color: #cbd5e1 !important;
}

body.theme-dark .billing-price {
    color: #ffffff !important;
}

body.theme-dark .billing-price small {
    color: #cbd5e1 !important;
}

body.theme-dark .billing-features li {
    color: #e5e7eb !important;
}

body.theme-dark .billing-btn.ghost {
    background: #1f2937;
    color: #ffffff;
    border: 1px solid #334155;
}

body.theme-dark .billing-btn.ghost:hover {
    background: #334155;
}

body.theme-dark .billing-btn.secondary {
    background: #374151;
    color: #ffffff;
}

body.theme-dark .billing-btn.secondary:hover {
    background: #4b5563;
}

body.theme-dark .billing-table-wrapper {
    background: #111827;
    border: 1px solid #263244;
}

body.theme-dark .billing-table {
    color: #e5e7eb;
}

body.theme-dark .billing-table th {
    color: #ffffff;
    background: #1f2937;
    border-color: #263244;
}

body.theme-dark .billing-table td {
    color: #e5e7eb;
    border-color: #263244;
}

body.theme-dark .credit-pill {
    background: #1f2937;
    color: #ffffff;
    border: 1px solid #334155;
}

body.theme-dark .billing-note {
    background: #111827;
    color: #e5e7eb;
    border: 1px solid #263244;
}

body.theme-dark .billing-note strong {
    color: #ffffff;
}

body.theme-dark .billing-alert {
    background: #422006;
    border: 1px solid #92400e;
    color: #fde68a;
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */

@media (max-width: 1100px) {
    .billing-status-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .billing-hero-top {
        flex-direction: column;
    }

    .billing-currency-box {
        width: 100%;
    }

    .billing-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .billing-grid {
        grid-template-columns: 1fr;
    }

    .billing-card h4 {
        padding-right: 80px;
    }
}

@media (max-width: 560px) {
    .billing-hero {
        padding: 20px;
        border-radius: 18px;
    }

    .billing-hero h2 {
        font-size: 23px;
    }

    .billing-status-grid {
        grid-template-columns: 1fr;
    }

    .billing-section {
        padding: 18px;
        border-radius: 18px;
    }

    .billing-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .billing-price {
        font-size: 27px;
    }

    .billing-card {
        padding: 18px;
    }

    .billing-card h4 {
        padding-right: 0;
        margin-top: 22px;
    }

    .billing-badge {
        left: 18px;
        right: auto;
        top: 14px;
    }
}

/* ========================================================================== 
   CLAREZA DE FRANQUIA NOS CARDS DE PLANOS
   ========================================================================== */

.billing-plan-clarity {
    display: grid;
    gap: 8px;
    padding: 12px 13px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.06);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.billing-plan-clarity > strong {
    color: var(--text-primary);
    font-size: 12px;
}

.billing-plan-clarity-metrics {
    display: grid;
    gap: 4px;
    color: var(--text-primary);
    font-weight: 800;
}

.billing-plan-clarity p {
    margin: 0;
    color: var(--text-secondary);
}

.billing-plan-clarity-max {
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #fbbf24;
    font-weight: 800;
}

.billing-plan-clarity-highlight {
    color: #86efac !important;
    font-weight: 800;
}
