/* =========================================
   GLITCH ARENA - TEMA V7.0 (Light Mode Fix)
   ========================================= */

:root {
    --primary-blue: #3F5EFB;
    --primary-purple: #7F41FF;
    --accent-orange: #FC466B;
    --accent-cyan: #00FFFF;
    --accent-neon: #DFFF00;
    --bg-deep: #050505;
    --bg-card: rgba(20, 20, 25, 0.7);
    --bg-input: rgba(0, 0, 0, 0.5);
    --text-primary: #FFFFFF;
    --text-secondary: #9CA3AF;
    --border-color: rgba(255, 255, 255, 0.1);
    --grid-line: rgba(63, 94, 251, 0.2);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(127, 65, 255, 0.4);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;
    
    /* Cores Específicas de Input */
    --input-placeholder: rgba(255, 255, 255, 0.4);
}

[data-theme="light"] {
    --bg-deep: #F3F4F6;
    --bg-card: rgba(255, 255, 255, 0.95); /* Mais opaco no claro para leitura */
    --bg-input: #FFFFFF;
    --text-primary: #111827; /* Cinza Quase Preto */
    --text-secondary: #4B5563; /* Cinza Médio */
    --border-color: rgba(0, 0, 0, 0.1);
    --grid-line: rgba(63, 94, 251, 0.05);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(63, 94, 251, 0.15);
    
    --input-placeholder: #9CA3AF;
}

/* === GLOBAL RESET & BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Grid de fundo */
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
    animation: gridScroll 20s linear infinite;
}

/* Overlay Vignette */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 50%, transparent 20%, var(--bg-deep) 90%);
    pointer-events: none;
    z-index: -1;
}

@keyframes gridScroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 50px; }
}

/* === PERFORMANCE === */
@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
    .glass-card, .navbar, .form-input { 
        backdrop-filter: none !important; 
        transition: none !important;
    }
}

/* === FIX CRÍTICO: VISIBILIDADE NO TEMA CLARO === */
/* Força textos que seriam brancos (pelo Tailwind) a serem escuros no tema claro */
[data-theme="light"] .text-white {
    color: var(--text-primary) !important;
}
/* Exceção: Botões com gradiente (devem manter texto branco) */
[data-theme="light"] button[class*="bg-gradient"] {
    color: #FFFFFF !important;
}
[data-theme="light"] .badge {
    color: #FFFFFF !important;
}

/* === INPUTS & FORMS === */
.form-input {
    width: 100%; 
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important; 
    padding: 1rem;
    border-radius: 12px; 
    font-family: var(--font-body);
    transition: all 0.3s ease; 
    margin-bottom: 1rem;
}

.form-input::placeholder {
    color: var(--input-placeholder) !important;
    opacity: 1;
}

.form-input:focus {
    outline: none; 
    border-color: var(--primary-purple) !important;
    box-shadow: 0 0 0 3px rgba(127, 65, 255, 0.2);
}

/* === COMPONENTES === */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 2rem; background: var(--bg-card);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 40;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.nav-controls { display: flex; gap: 1rem; align-items: center; }

.badge {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    color: white; padding: 0.25rem 1rem; border-radius: 99px;
    font-weight: 700; font-size: 0.85rem; box-shadow: 0 2px 10px rgba(127, 65, 255, 0.3);
    font-family: var(--font-display);
}

.glass-card, .card {
    background: var(--bg-card); 
    border: 1px solid var(--border-color);
    border-radius: 16px; 
    padding: 1.5rem; 
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; 
    overflow: hidden;
    z-index: 1; 
}

.glass-card:hover, .card:hover { 
    transform: translateY(-4px); 
    border-color: var(--primary-purple); 
    box-shadow: var(--shadow-glow); 
}

button { cursor: pointer; font-family: var(--font-display); letter-spacing: 1px; transition: all 0.3s ease; position: relative; overflow: hidden; }
button:active { transform: scale(0.96); }

/* === GLITCH TEXT === */
.glitch-text {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.5rem;
    letter-spacing: 3px;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    text-transform: uppercase;
}
[data-theme="light"] .glitch-text { text-shadow: 2px 2px 0px rgba(0,0,0,0.1); }

.glitch-text::before, .glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-deep);
}
.glitch-text::before { left: 2px; text-shadow: -2px 0 #ff00c1; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim-1 5s infinite linear alternate-reverse; }
.glitch-text::after { left: -2px; text-shadow: -2px 0 #00fff9; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim-2 5s infinite linear alternate-reverse; }

@keyframes glitch-anim-1 { 0% { clip: rect(20px, 9999px, 10px, 0); } 100% { clip: rect(50px, 9999px, 60px, 0); } }
@keyframes glitch-anim-2 { 0% { clip: rect(90px, 9999px, 10px, 0); } 100% { clip: rect(20px, 9999px, 80px, 0); } }
@media (max-width: 768px) { .glitch-text { font-size: 1.8rem; } }

/* === UTILS === */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.1); border-top: 3px solid var(--accent-cyan);
    border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.page { display: none; opacity: 0; transition: opacity 0.3s ease; }
.page.active { display: block; opacity: 1; animation: slideUp 0.5s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* === Z-INDEX & LAYERS === */
.z-base-float { z-index: 30; } 
.z-layer-backdrop { z-index: 9000 !important; }
.z-layer-modal { z-index: 9999 !important; } /* Garante que modais cubram tudo */
.z-layer-top { z-index: 10000 !important; }

/* === MODAL UTILITIES === */
.force-flex {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}