:root {
  /* ==========================================================================
     1. CORES BASE & IDENTIDADE (PADRÃO: DARK - ESTILO BINANCE)
     ========================================================================== */
  
  /* Fundos e Superfícies */
  --bg-primary: #090A0D;                  /* Fundo principal - Preto grafite profundo */
  --bg-secondary: rgba(15, 17, 22, 0.72); /* Sidebar translúcida (efeito vidro) */
  --bg-surface: rgba(24, 27, 34, 0.55);   /* Cards translúcidos */
  --bg-surface-hover: rgba(36, 40, 50, 0.75);
  --bg-input: rgba(20, 23, 29, 0.8);
  
  /* Tokens de Vidro (Glassmorphism) */
  --glass-blur: blur(16px);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(240, 185, 11, 0.28);
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);

  /* Cores de Marca e Destaque */
  --accent-yellow: #F0B90B;       /* Amarelo - Ação primária, destaques */
  --accent-yellow-rgb: 240, 185, 11;
  --accent-yellow-hover: #FCD535; /* Amarelo claro para hover */
  --accent-yellow-subtle: rgba(240, 185, 11, 0.12);

  --accent-orange: #F97316;       /* Laranja - Badges, acentos secundários */
  --accent-orange-rgb: 249, 115, 22;
  --accent-orange-hover: #FB923C;
  --accent-orange-subtle: rgba(249, 115, 22, 0.12);

  /* Gradiente de Assinatura */
  --gradient-brand: linear-gradient(135deg, #F0B90B 0%, #F97316 100%);

  /* Tipografia (Cores) */
  --text-primary: #EAECEF;        /* Branco gelo - Alto contraste sem ofuscar */
  --text-secondary: #848E9C;      /* Cinza médio - Subtítulos, descrições */
  --text-muted: #5E6673;          /* Cinza discreto - Metadados, placeholders */
  --text-on-accent: #0B0E11;      /* Texto escuro para botões amarelos/laranjas */

  /* Bordas e Divisores */
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: var(--accent-yellow);

  /* Feedback Semântico */
  --color-success: #0ECB81;
  --color-danger: #F6465D;
  --color-warning: #F0B90B;
  --color-info: #3861FB;

  /* Sombras e Elevação */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.9);
  --shadow-glow-yellow: 0 0 16px rgba(240, 185, 11, 0.2);

  /* ==========================================================================
     2. TIPOGRAFIA (ESCALA MODULAR)
     ========================================================================== */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: 0.75rem;      /* 12px - Tags, badges, rodapés */
  --text-sm: 0.875rem;     /* 14px - Textos secundários, itens de menu */
  --text-base: 1rem;       /* 16px - Corpo de texto padrão */
  --text-md: 1.125rem;     /* 18px - Subtítulos de cards */
  --text-lg: 1.25rem;      /* 20px - Títulos de seção menores */
  --text-xl: 1.5rem;       /* 24px - Títulos de seção */
  --text-2xl: 2rem;        /* 32px - Títulos de página/view */
  --text-3xl: 2.75rem;     /* 44px - Hero / Destaque principal */

  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* ==========================================================================
     3. ESPAÇAMENTOS (GRID BASE 4PX)
     ========================================================================== */
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-8: 2rem;         /* 32px */
  --space-10: 2.5rem;      /* 40px */
  --space-12: 3rem;        /* 48px */
  --space-16: 4rem;        /* 64px */

  /* Dimensões Estruturais */
  --sidebar-width: 260px;
  --container-max: 1200px;

  /* ==========================================================================
     4. BORDAS & RAIOS (ESTILO GEOMÉTRICO BINANCE)
     ========================================================================== */
  --border-thin: 1px;
  --border-medium: 2px;
  --border-thick: 3px;

  --radius-none: 0px;
  --radius-xs: 2px;        /* Badges técnicos */
  --radius-sm: 4px;        /* Botões e inputs (bem característico da Binance) */
  --radius-md: 8px;        /* Cards e containers */
  --radius-lg: 12px;       /* Modais e painéis maiores */
  --radius-full: 9999px;   /* Pílulas e avatares */

  /* Transições */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   5. TEMA CLARO (ATIVADO APENAS SE EXPLICITAMENTE ESCOLHIDO OU SISTEMA LIGHT)
   ========================================================================== */
[data-theme="light"] {
  --bg-primary: #D5D9E0;
  --bg-secondary: rgba(223, 227, 234, 0.82);
  --bg-surface: rgba(235, 238, 243, 0.78);
  --bg-surface-hover: rgba(212, 217, 226, 0.9);
  --bg-input: rgba(208, 213, 222, 0.8);

  /* Vidro e Bordas definidas */
  --glass-border: rgba(15, 23, 42, 0.12);
  --glass-border-hover: rgba(161, 98, 7, 0.5);
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.45);

  /* Amarelo e Laranja calibrados para máxima legibilidade sobre cinza */
  --accent-yellow: #9A6700;
  --accent-yellow-rgb: 154, 103, 0;
  --accent-yellow-hover: #B47B00;
  --accent-yellow-subtle: rgba(180, 123, 0, 0.16);

  --accent-orange: #C2410C;
  --accent-orange-rgb: 194, 65, 12;
  --accent-orange-hover: #DC4C11;
  --accent-orange-subtle: rgba(194, 65, 12, 0.14);

  /* Tipografia com contraste nítido */
  --text-primary: #111318;
  --text-secondary: #373D47;
  --text-muted: #565E6C;
  --text-on-accent: #FFFFFF;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-default: rgba(15, 23, 42, 0.14);
  --border-strong: rgba(15, 23, 42, 0.24);

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 14px 32px rgba(15, 23, 42, 0.14);
  --shadow-glow-yellow: none;
}

/* Suporte ao modo "Sistema" quando o SO do usuário está em Light Mode */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-primary: #D5D9E0;
    --bg-secondary: rgba(223, 227, 234, 0.82);
    --bg-surface: rgba(235, 238, 243, 0.78);
    --bg-surface-hover: rgba(212, 217, 226, 0.9);
    --bg-input: rgba(208, 213, 222, 0.8);

    --glass-border: rgba(15, 23, 42, 0.12);
    --glass-border-hover: rgba(161, 98, 7, 0.5);
    --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.45);

    --accent-yellow: #9A6700;
    --accent-yellow-rgb: 154, 103, 0;
    --accent-yellow-hover: #B47B00;
    --accent-yellow-subtle: rgba(180, 123, 0, 0.16);

    --accent-orange: #C2410C;
    --accent-orange-rgb: 194, 65, 12;
    --accent-orange-hover: #DC4C11;
    --accent-orange-subtle: rgba(194, 65, 12, 0.14);

    --text-primary: #111318;
    --text-secondary: #373D47;
    --text-muted: #565E6C;
    --text-on-accent: #FFFFFF;

    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-default: rgba(15, 23, 42, 0.14);
    --border-strong: rgba(15, 23, 42, 0.24);

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 14px 32px rgba(15, 23, 42, 0.14);
    --shadow-glow-yellow: none;
  }
}

/* ==========================================================================
   6. MEDIA PARA IMPRESSÃO / EXPORTAÇÃO PDF (CURRÍCULO / PORTFÓLIO IMPRESSO)
   ========================================================================== */
@media print {
  :root,
  [data-theme="dark"],
  [data-theme="light"] {
    /* Força fundo branco puro para economizar tinta e garantir legibilidade */
    --bg-primary: #FFFFFF !important;
    --bg-secondary: #FFFFFF !important;
    --bg-surface: #FFFFFF !important;
    --bg-surface-hover: #FFFFFF !important;
    --bg-input: #FFFFFF !important;

    /* Texto preto de alto contraste */
    --text-primary: #000000 !important;
    --text-secondary: #222222 !important;
    --text-muted: #444444 !important;

    /* Mantém identidade visual discreta com bordas limpas */
    --accent-yellow: #B48600 !important;
    --accent-orange: #C2410C !important;
    --border-subtle: #CCCCCC !important;
    --border-default: #999999 !important;
    --border-strong: #000000 !important;

    /* Remove sombras na impressão */
    --shadow-sm: none !important;
    --shadow-md: none !important;
    --shadow-lg: none !important;
    --shadow-glow-yellow: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
  }

  /* Oculta elementos interativos que não fazem sentido no PDF */
  .no-print,
  nav,
  button {
    display: none !important;
  }

  /* Expande a área de conteúdo para ocupar 100% da folha A4 */
  main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  /* Evita quebra de página no meio de cards de projetos ou seções */
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid var(--border-default) !important;
    margin-bottom: var(--space-4) !important;
  }

  /* Exibe URLs completas ao lado de links externos no papel */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444444;
    word-break: break-all;
  }
}
