/**
 * CSS Variables - Theme Configuration
 */

:root {
    /* Primary Colors - Overridden by PHP (Settings::getThemeCSS()) */
    --primary-color: #9968eb;
    --primary-rgb: 153, 104, 235;
    --secondary-color: #9968eb;
    --secondary-rgb: 153, 104, 235;
    --accent-color: #ec4899;
    --accent-rgb: 236, 72, 153;

    /* Dark Theme */
    --bg-primary: #050505;
    --bg-secondary: #0c0c0e;
    --bg-tertiary: #161618;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);

    /* Glassmorphism */
    --glass-bg: rgba(18, 18, 20, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --card-glass-blur: blur(12px);
    --card-glass-border: 1px solid rgba(255, 255, 255, 0.08);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --header-bg: rgba(5, 5, 5, 0.85);
    --header-border: rgba(255, 255, 255, 0.06);

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-accent: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    --gradient-dark: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);

    /* Spacing */
    --header-height: 70px;
    --player-height: 90px;
    --container-width: 1280px;
    --section-padding: 80px;

    /* Typography - Overridden by PHP when fonts are configured */
    --font-family: var(--font-family, sans-serif);
    --nav-font-family: 'Roboto', sans-serif;
    --nav-font-size: 15px;
    --nav-font-weight: normal;
    --nav-font-style: normal;
    --nav-color: #e0e0e0;    /* Claro para dark mode — PHP sobrescreve com valor do admin */
    --title-font-family: 'DM Sans', sans-serif;
    --title-font-weight: bold;
    --title-font-style: normal;
    --title-color: #ffffff;  /* Branco no dark — PHP sobrescreve com valor do admin */
    --title-font-size-base: 24px;

    /* Novas variáveis independentes — sobrescritas pelo getThemeCSS() */
    --page-title-font-family: 'DM Sans', sans-serif;
    --page-title-font-weight: bold;
    --page-title-font-style: normal;
    --page-title-color: #ffffff;
    --page-title-font-size-base: 24px;

    --card-title-font-family: 'DM Sans', sans-serif;
    --card-title-font-weight: bold;
    --card-title-font-style: normal;
    --card-title-color: #ffffff;
    --card-title-font-size: 20px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;

    /* Form Field Tokens */
    --color-background-secondary: rgba(255, 255, 255, 0.08);
    --color-border-tertiary: rgba(255, 255, 255, 0.12);
    --color-border-primary: var(--primary-color);
    --color-text-primary: var(--text-primary);
    --color-text-secondary: var(--text-secondary);
    --color-text-tertiary: var(--text-muted);
    --border-radius-lg: 12px;
    --border-radius-md: 8px;

    /* Card Design Tokens — token único para consistência entre todos os cards */
    --card-radius: 16px;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.25);
    --card-padding: 24px 28px 28px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(var(--primary-rgb), 0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Safe Area Insets (for immersive mode) */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* ── Stitch TEMA Midnight — Surface Tokens ── */
    --surface-container: #19191f;
    --surface-container-high: #1f1f26;
    --surface-bright: #2c2b33;

    /* ── Stitch — Glow Effects ── */
    --glow-primary: 0 0 20px rgba(var(--primary-rgb), 0.25);
    --glow-accent: 0 0 20px rgba(var(--accent-rgb, var(--primary-rgb)), 0.25);

    /* ── Stitch — Display Font ── */
    --font-display: 'Epilogue', var(--title-font-family, 'DM Sans', sans-serif);
}

/* ══════════════════════════════════════════════════════════════════
   GLOBAL CARD GLASSMORPHISM
   Regra única que aplica transparência + backdrop-filter em TODOS
   os cards de TODAS as páginas do tema.
   ══════════════════════════════════════════════════════════════════ */
.nl-card,                   /* Notícias */
.nl-hero,                   /* Notícias — hero */
.ev-card,                   /* Eventos */
.ev-hero,                   /* Eventos — hero */
.pm-card,                   /* Promoções */
.pc-card,                   /* Podcasts — episódios */
.pc-series-card,            /* Podcasts — séries */
.pg-item,                   /* Programação — itens da grade */
.team-card,                 /* Equipe */
.sp-card,                   /* Card genérico (legado) */
.search-result-card,        /* Resultados de busca */
.video-card,                /* Vídeos */
.pg-hero,                   /* Programação — hero "No Ar" */
.pg-highlight-card {        /* Programação — destaques */
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.nl-card:hover,
.nl-hero:hover,
.ev-card:hover,
.ev-hero:hover,
.pm-card:hover,
.pc-card:hover,
.pc-series-card:hover,
.pg-item:hover,
.team-card:hover,
.sp-card:hover,
.search-result-card:hover,
.video-card:hover,
.pg-highlight-card:hover {
    background: rgba(255, 255, 255, 0.07) !important;
}

/* Apply Safe Areas globally */
.header {
    padding-top: var(--safe-area-top);
}

.player {
    padding-bottom: var(--safe-area-bottom);
}

.footer {
    padding-bottom: calc(var(--safe-area-bottom) + 80px);
    /* + Player height buffer if needed */
}

/* Fix for fixed/sticky headers */
.header.sticky {
    top: 0;
}

/* Ensure modal overlays cover the safe areas */
.menu-overlay,
.cookie-consent {
    padding-bottom: var(--safe-area-bottom);
}

/* ══════════════════════════════════════════════════════════════════
   AJUSTE 7 — Escala Tipográfica Global (TEMA 2026)
   Tokens herdados por todos os componentes mobile.
   Aplicar via var(--font-size-base) etc.
   ══════════════════════════════════════════════════════════════════ */
:root {
    --font-size-xs:   11px;
    --font-size-sm:   13px;
    --font-size-base: 15px;
    --font-size-md:   17px;
    --font-size-lg:   20px;
    --font-size-xl:   24px;
    --font-size-2xl:  30px;
    --font-size-3xl:  38px;

    /* ── Ajuste 10 — Tokens de Espaçamento Global ─────────── */
    --space-xs:  8px;
    --space-sm:  12px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* ── Tokens de cabeçalho de seção (Ajuste 6) ─────────── */
    --section-label-size:    11px;
    --section-label-weight:  700;
    --section-label-spacing: 2px;
    --section-title-size-min: 22px;
    --section-title-size-pref: 3vw;
    --section-title-size-max: 28px;
    --section-title-weight:  800;
    --section-accent-height: 28px;
    --section-accent-width:  3px;
}

/* ── Ajustes responsivos em mobile (≤ 768px) ── */
@media (max-width: 768px) {
    :root {
        --font-size-xs:   10px;
        --font-size-sm:   12px;
        --font-size-base: 14px;
        --font-size-md:   16px;
        --font-size-lg:   19px;
        --font-size-xl:   22px;
        --font-size-2xl:  26px;
        --font-size-3xl:  32px;

        --space-xs:  6px;
        --space-sm:  10px;
        --space-md:  14px;
        --space-lg:  20px;
        --space-xl:  28px;
        --space-2xl: 40px;
        --space-3xl: 56px;

        /* Redução de seção em mobile */
        --section-title-size-min:  18px;
        --section-title-size-pref: 5vw;
        --section-title-size-max:  22px;
    }
}
