:root {
    --bg-color: #0d0e15;
    --text-primary: #ffffff;
    --text-secondary: #a0a5ba;
    
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-mobile: rgba(13, 14, 21, 0.98);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Regla base de Body para el resto (por seguridad) */
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Background Orbs (Animated) */
.background-orbs {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none; /* Asegurar que no bloquea el toque */
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 { width: 400px; height: 400px; background: var(--accent-purple); top: -100px; left: -100px; }
.orb-2 { width: 500px; height: 500px; background: var(--accent-blue); bottom: -150px; right: -100px; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: var(--accent-pink); top: 40%; left: 40%; animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.1); }
    100% { transform: translate(-30px, 50px) scale(0.9); }
}

/* Base Glassmorphism Class */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* App Layout */
.app-container {
    width: 95vw;
    height: 90vh;
    border-radius: 24px;
    display: flex;
    z-index: 1;
    overflow: hidden;
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.5s ease;
}

/* Sidebar */
.sidebar {
    width: 280px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: rgba(13, 14, 21, 0.4);
    z-index: 1000;
}

.nav-btn i, .nav-btn span, .m-btn i, .m-btn span {
    pointer-events: none;
}

.logo-container { 
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; 
    margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); 
    cursor: pointer; transition: opacity 0.3s; 
}
.logo-container:hover { opacity: 0.8; }

.logo-img-wrapper {
    padding: 12px; margin-bottom: 10px; display: inline-flex; justify-content: center; align-items: center; 
    background: rgba(255, 255, 255, 0.95); border-radius: 50%; box-shadow: 0 0 15px rgba(34, 211, 238, 0.4); 
    border: 2px solid var(--accent-cyan); width: 85px; height: 85px;
}

.logo-img {
    max-width: 100%; max-height: 100%; object-fit: contain; filter: brightness(1.05) contrast(1.1);
}

.logo-title { 
    font-size: 0.9rem; line-height: 1.2; white-space: normal; letter-spacing: 0.5px; 
    font-weight: 800; margin-bottom: 0; color: #fff; font-family: var(--font-heading);
}

.logo-subtitle { 
    font-size: 0.75rem; margin-top: 2px; opacity: 0.8; color: #22d3ee; font-weight: 600; 
    text-transform: uppercase; letter-spacing: 1px; 
}

/* Navigation */
.agent-nav { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nav-title { font-size: 0.75rem; color: var(--text-secondary); font-weight: 700; margin-bottom: 12px; padding-left: 12px; letter-spacing: 1px; }

.nav-btn {
    background: transparent; border: none; color: var(--text-secondary);
    padding: 12px 16px; border-radius: 12px; display: flex; align-items: center; gap: 12px; cursor: pointer;
    font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; transition: all 0.3s ease; position: relative;
}
.nav-btn i { font-size: 1.25rem; transition: transform 0.3s ease; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.nav-btn:hover i { transform: scale(1.1); color: var(--accent-cyan); }

.nav-btn.active { background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), transparent); color: var(--text-primary); border-left: 3px solid var(--accent-blue); }
.nav-btn.active i { color: var(--accent-blue); }

/* Tooltips */
.tooltip {
    position: absolute; left: 100%; top: 50%; transform: translateY(-50%) translateX(10px);
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); color: white; padding: 6px 12px;
    border-radius: 6px; font-size: 0.75rem; white-space: nowrap; opacity: 0; pointer-events: none;
    transition: all 0.3s ease; border: 1px solid var(--glass-border); z-index: 100;
}
.nav-btn:hover .tooltip { opacity: 1; transform: translateY(-50%) translateX(15px); }

/* User Footer */
.sidebar-footer { 
    margin-top: auto; 
    padding: 12px; 
    transition: all 0.3s ease;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.user-info { 
    display: flex; align-items: center; gap: 12px; 
    padding: 8px; border-radius: 12px;
    transition: background 0.3s;
}
.user-info:hover { background: rgba(255,255,255,0.05); }

.user-avatar { 
    width: 64px; 
    height: 64px; 
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent-purple);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.user-details .name { 
    font-weight: 800; 
    font-size: 0.95rem; 
    line-height: 1.2;
    color: white;
    margin-bottom: 4px;
    display: block;
}

.user-details .role { 
    font-size: 0.72rem; 
    color: var(--text-secondary);
    margin-top: 2px;
}

.user-details .role a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s;
}

.user-details .role a:hover {
    color: white !important;
}

.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white !important;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    margin-bottom: 4px;
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.3);
}

/* Main Content Area */
.content-area { flex: 1; display: flex; flex-direction: column; padding: 32px 48px; position: relative; overflow-y: auto; }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; position: relative; z-index: 50; }
.search-box { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-radius: 100px; width: 400px; transition: width 0.3s ease; }
.search-box:focus-within { width: 500px; border-color: rgba(255,255,255,0.2); }
.search-box i { color: var(--text-secondary); font-size: 1.2rem; }
.search-box input { background: transparent; border: none; color: var(--text-primary); outline: none; width: 100%; font-family: var(--font-body); }
.search-box input::placeholder { color: var(--text-secondary); }

.header-actions { display: flex; gap: 10px; align-items: center;}

/* Translate Block */
.translate-wrapper {
    position: relative;
    display: inline-block;
}

#custom-translate-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 10px 30px 10px 15px;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: all 0.3s ease;
}

.translate-option {
    background: #1e293b;
    color: white;
}

.translate-wrapper i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}
.icon-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none; color: var(--text-primary); display: flex;
    align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem; transition: all 0.3s ease;
    position: relative; /* Contexto para el punto de notificación */
}

/* Notificación de Actualización (Campanita) */
#update-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: var(--accent-purple);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-purple);
    border: 2px solid var(--bg-color);
    z-index: 10;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }

/* Agent Content (Injected) */
.main-viewer { flex: 1; animation: fadeIn 0.4s ease forwards; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.agent-header { display: flex; align-items: center; gap: 24px; margin-bottom: 32px; }
.agent-icon-large {
    width: 80px; height: 80px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid var(--glass-border); backdrop-filter: blur(10px);
}
.agent-header-text h2 { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 700; margin-bottom: 4px; }
.agent-header-text p { color: var(--text-secondary); font-size: 1.1rem; }

/* Home Dashboard & Stats Layout */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card i {
    font-size: 2.2rem;
    color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.05);
    width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    margin-bottom: 8px;
}

.stat-card h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.stat-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* Feature Cards (Notebooks) */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.feature-card { 
    padding: 24px; 
    border-radius: 24px; 
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s ease; 
    cursor: pointer;
    position: relative;
}
.feature-card:hover { 
    transform: translateY(-5px); 
    background: rgba(255, 255, 255, 0.06); 
    border-color: rgba(255,255,255,0.15);
}

/* Dynamic themes based on the agent */
.theme-logico .agent-icon-large { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.theme-logico .agent-header-text h2 { background: linear-gradient(to right, #f59e0b, #fbbf24); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.theme-etico .agent-icon-large { color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.theme-etico .agent-header-text h2 { background: linear-gradient(to right, #10b981, #34d399); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.theme-uiux .agent-icon-large { color: #ec4899; border-color: rgba(236, 72, 153, 0.3); }
.theme-uiux .agent-header-text h2 { background: linear-gradient(to right, #ec4899, #f472b6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.theme-coder .agent-icon-large { color: #3b82f6; border-color: rgba(59, 130, 246, 0.3); }
.theme-coder .agent-header-text h2 { background: linear-gradient(to right, #3b82f6, #60a5fa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.theme-maker .agent-icon-large { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.theme-maker .agent-header-text h2 { background: linear-gradient(to right, #ef4444, #f87171); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.theme-academico .agent-icon-large { color: #8b5cf6; border-color: rgba(139, 92, 246, 0.3); }
.theme-academico .agent-header-text h2 { background: linear-gradient(to right, #8b5cf6, #a78bfa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Light Theme toggle support */
body.light-mode {
    --bg-color: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-bg-mobile: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

body.light-mode .stat-card {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.04) !important;
}

body.light-mode .stat-card i {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--accent-purple) !important;
}

body.light-mode .stat-card p {
    color: #4b5563 !important;
}

body.light-mode .glass-panel { background: var(--glass-bg); border: 1px solid var(--glass-border); }
body.light-mode .nav-btn:hover { background: rgba(0,0,0,0.03); }
body.light-mode .search-box input { color: var(--text-primary); }
body.light-mode .sidebar { background: rgba(255, 255, 255, 0.6); }

/* Tema Cyber-Neon */
body.theme-cyber {
    --bg-color: #050505;
    --text-primary: #00ffcc;
    --text-secondary: #00aa88;
    --accent-blue: #0ff0fc;
    --accent-purple: #ff00ff;
    --accent-cyan: #00ff00;
    --accent-pink: #ff0055;
    --glass-bg: rgba(0, 40, 20, 0.4);
    --glass-bg-mobile: rgba(5, 10, 5, 0.98);
    --glass-border: rgba(0, 255, 0, 0.4);
    background: radial-gradient(circle at 10% 20%, #001f0a, #000000 80%) fixed;
}
body.theme-cyber .nav-btn.active, 
body.theme-cyber .m-btn.active {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}
body.theme-cyber .glass-panel {
    box-shadow: inset 0 0 15px rgba(0, 255, 0, 0.05), 0 8px 32px 0 rgba(0, 255, 0, 0.1);
}
body.theme-cyber .mobile-nav {
    background: #020502 !important;
    border-top: 1px solid var(--accent-cyan);
}
body.theme-cyber .top-bar {
    border-bottom: 1px solid var(--accent-cyan);
}

/* Tema Aurora Boreal (Océano Profundo) */
body.theme-aurora {
    --bg-color: #061121;
    --text-primary: #e2f1f8;
    --text-secondary: #87aebf;
    --accent-blue: #0ea5e9;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #d946ef;
    --glass-bg: rgba(15, 35, 70, 0.5);
    --glass-bg-mobile: rgba(6, 17, 33, 0.98);
    --glass-border: rgba(14, 165, 233, 0.3);
    --glass-shadow: 0 15px 35px 0 rgba(6, 182, 212, 0.2);
    background: linear-gradient(135deg, #020617 0%, #0f172a 40%, #1e1b4b 100%) fixed;
}
body.theme-aurora .glass-panel {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
}
body.theme-aurora .nav-btn.active, 
body.theme-aurora .m-btn.active {
    color: var(--accent-blue);
    text-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}
body.theme-aurora .mobile-nav {
    background: rgba(10, 20, 35, 0.95) !important;
    border-top: 1px solid rgba(14, 165, 233, 0.1);
}

/* Tema Papel E-Ink (Lectura Antifatiga) */
body.theme-eink {
    --bg-color: #fdfaf6;
    --text-primary: #2c241c;
    --text-secondary: #7a6e60;
    --accent-blue: #9d7b53;
    --accent-purple: #bd634e;
    --accent-cyan: #d68c45;
    --accent-pink: #c97a7e;
    --glass-bg: rgba(245, 240, 230, 0.85);
    --glass-bg-mobile: #fdfaf6;
    --glass-border: rgba(100, 80, 60, 0.2);
    --glass-shadow: 0 4px 10px 0 rgba(100, 80, 60, 0.05);
    background: radial-gradient(circle at 50% 0%, #ffffff 0%, #f4eee1 100%) fixed;
}
body.theme-eink h1, body.theme-eink h2, body.theme-eink h3, body.theme-eink .nav-title {
    color: #2c241c;
    text-shadow: none;
    font-weight: 700;
}
body.theme-eink .glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 2px 2px 8px rgba(0,0,0,0.02);
    backdrop-filter: blur(10px);
}
body.theme-eink .nav-btn.active, 
body.theme-eink .m-btn.active {
    color: var(--accent-purple);
    background: rgba(189, 99, 78, 0.1);
    text-shadow: none;
    border-radius: 8px;
}
body.theme-eink .search-box input {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
}
body.theme-eink .mobile-nav {
    background: #fdfaf6 !important;
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
}
body.theme-eink .top-bar {
    border-bottom: 1px solid var(--glass-border);
    background: rgba(253, 250, 246, 0.85);
}

/* ============================================================
   RESPONSIVE STRATEGY (PC, Tablet, Mobile)
   ============================================================ */

/* 1. TABLET (Icon Sidebar) - 769px a 1024px */
@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 24px 12px; }
    .logo-container h1, .logo-container p, .nav-btn span, .user-info div, .nav-title { display: none; }
    .logo-container { align-items: center; }
    .nav-btn { justify-content: center; }
    .search-box { width: 200px; }
    .search-box:focus-within { width: 250px; }
    .mobile-nav { display: none; }
}

/* 2. MOBILE (Bottom Nav / App Feel) - Menos de 768px */
@media (max-width: 768px) {
    body { 
        height: auto !important; 
        min-height: 100vh !important;
        overflow-y: auto !important; 
        align-items: flex-start;
        display: block !important; 
        -webkit-overflow-scrolling: touch;
    }
    
    .app-container { 
        width: 100vw; 
        height: auto !important; 
        min-height: 100vh; 
        border-radius: 0; 
        flex-direction: column !important; 
        overflow: visible !important;
        background: none;
        backdrop-filter: none;
        box-shadow: none;
        border: none;
    }

    .sidebar { display: none; } /* Ocultar Sidebar en celulares */

    /* OPTIMIZACIÓN CRÍTICA: Desactivar efectos pesados que bloquean el scroll en móviles */
    .glass-panel, .glass-card, .feature-card, .news-card, .session-card, .auth-card, .modal-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: var(--glass-bg-mobile) !important; 
        border: 1px solid var(--glass-border) !important;
        box-shadow: none !important; /* Sombras también consumen GPU en scroll */
    }

    .content-area { 
        padding: 16px; 
        padding-bottom: 120px; /* Margen extra para el Bottom Nav */
        overflow: visible !important;
        height: auto !important;
        flex: none !important;
    }

    .top-bar { 
        margin-bottom: 20px; 
        background: rgba(13, 14, 21, 0.8);
        backdrop-filter: blur(10px);
        padding: 10px;
        border-radius: 12px;
        position: sticky;
        top: 10px;
        z-index: 100;
    }
    
    .search-box { display: none; }

    /* Bottom Navigation Bar */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: #0d0e15 !important;
        border-top: 1px solid rgba(255,255,255,0.08);
        z-index: 999999 !important;
        padding-bottom: env(safe-area-inset-bottom);
        pointer-events: auto !important;
        gap: 0 !important;
    }

    .m-btn {
        background: none;
        border: none;
        color: var(--text-secondary);
        display: flex;
        flex: 1; /* Ocupar todo el espacio disponible */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 0;
        transition: all 0.3s;
        cursor: pointer !important;
        pointer-events: auto !important;
        height: 100%;
    }

    .m-btn i { font-size: 1.5rem; }
    .m-btn span { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }
    
    .m-btn.active { color: var(--accent-cyan); }
    .m-btn.active i { transform: translateY(-3px); }

    /* Ajustes de Tesla Chat para que no tape el bottom nav */
    #tesla-widget { bottom: 75px !important; right: 10px !important; }
    #tesla-btn { width: 70px !important; height: 70px !important; }
    #tesla-chat-box { width: 92vw !important; right: 0 !important; bottom: 80px !important; height: 60vh !important; }

    .agent-header-text h2 { font-size: 1.8rem; }
    .agent-icon-large { width: 60px; height: 60px; min-width: 60px; font-size: 1.8rem; }
}

@media (min-width: 1025px) {
    .mobile-nav { display: none; }
}

/* ============================================================
   MODALES Y PERFIL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000000;
    opacity: 0;
    overflow-y: auto;
    padding: 20px 10px;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 28px;
    width: 90%;
    max-width: 500px;
    padding: 40px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    margin: auto; /* Para centrar cuando hay scroll en el overlay */
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.profile-img-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 4px solid var(--accent-purple);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.cv-button {
    margin-top: 30px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
    text-decoration: none;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.2);
}

.cv-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

@media (max-width: 768px) {
    .cv-button {
        padding: 12px 24px;
        font-size: 0.85rem;
        margin-top: 20px;
    }
}
/* ============================================================
   SISTEMA DE PROYECTOS TIC
   ============================================================ */
.project-card {
    padding: 24px;
    text-align: left;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.project-author {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 12px;
    font-weight: 500;
}

.project-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.8);
    margin-bottom: 20px;
    height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.tag-samsung { background: rgba(30, 64, 175, 0.3); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.3); }
.tag-energia { background: rgba(154, 52, 18, 0.3); color: #fb923c; border: 1px solid rgba(251, 146, 60, 0.3); }
.tag-colegio { background: rgba(88, 28, 135, 0.3); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.3); }
.tag-aula { background: rgba(21, 128, 61, 0.3); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.3); }

.filter-bar {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 0 15px;
    margin-bottom: 10px;
}

.filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; color: white; margin-bottom: 5px; font-size: 0.8rem; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background: rgba(255,255,255,0.08); /* Más opaco para mejor contraste */
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 12px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
}

/* Fix para visibilidad de select (especialmente opciones) */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
    cursor: pointer;
}

.form-group select option {
    background: #1e1b4b; /* Color sólido para el menú desplegable */
    color: white;
    padding: 12px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus { 
    border-color: var(--accent-purple); 
    outline: none; 
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.refine-btn {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.refine-btn:hover {
    background: var(--accent-purple);
    color: white;
    transform: scale(1.05);
}

.refine-btn i { font-size: 0.9rem; }

.fab-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: white;
    border: none;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s ease;
}
.fab-btn:hover { transform: scale(1.1); filter: brightness(1.2); }
@media (max-width: 768px) { .fab-btn { bottom: 90px; right: 20px; width: 50px; height: 50px; font-size: 1.5rem; } }

/* News Section (EduTech Scanner) */
.news-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.news-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.news-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-badge {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.news-card {
    text-decoration: none;
    color: inherit;
    padding: 20px;
    border-radius: 20px;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-cyan);
    box-shadow: 0 15px 30px rgba(6, 182, 212, 0.15);
}

/* Estado de noticia LEÍDA */
.news-card.is-read {
    opacity: 0.6;
    filter: saturate(0.5);
    border-color: rgba(255,255,255,0.05);
}

.news-card.is-read::before {
    content: '\eb7c';
    font-family: 'boxicons' !important;
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--accent-cyan);
    font-size: 1.2rem;
    opacity: 0.8;
}

.news-content h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-primary);
    padding-right: 25px;
}

.news-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.news-action-btn:hover {
    background: var(--accent-purple);
    color: white;
    transform: scale(1.1);
}

.news-action-btn.copied {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.news-skeleton, .news-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255,255,255,0.02);
    border-radius: 16px;
}

@media (max-width: 768px) {
    .news-grid { grid-template-columns: 1fr; }
}
/* ============================================================
   AUTENTICACIÓN Y REGISTRO (CONECTATE CORE)
   ============================================================ */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(13, 14, 21, 0.8) 0%, #0d0e15 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: none; /* Seguridad: No interceptar toques por defecto */
}

.auth-overlay.active {
    display: flex !important;
} /* Activar solo cuando sea visible */

.auth-card {
    max-width: 450px;
    width: 100%;
    padding: 40px;
    border-radius: 32px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: authCardEntry 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authCardEntry {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-logo {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(34, 211, 238, 0.4));
}

.auth-header h2 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 8px; color: white; }
.auth-header p { color: var(--text-secondary); margin-bottom: 30px; font-size: 0.95rem; }

.auth-body { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; }
.auth-footer { font-size: 0.75rem; color: var(--text-secondary); opacity: 0.6; margin-top: 25px; }

.auth-form { display: none; width: 100%; text-align: left; animation: authFade 0.4s ease; }
.auth-form.active { display: block; }

@keyframes authFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-form .form-group { margin-bottom: 20px; }
.auth-form .form-group label { font-size: 0.8rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; color: var(--accent-cyan); }
.auth-form input { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); padding: 14px; border-radius: 12px; color: white; width: 100%; }
.auth-form input:focus { border-color: var(--accent-cyan); outline: none; background: rgba(255,255,255,0.08); }

/* Caracterización Form (Step UI) */
.step-container { text-align: left; width: 100%; }
.step-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.step-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.1);
    z-index: 1;
    transform: translateY(-50%);
}

.step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1e1e2e;
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
    color: white;
}

.step-dot.completed {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: white;
}

.form-step { display: none; animation: slideIn 0.4s ease forwards; }
.form-step.active { display: block; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.btn-group { display: flex; gap: 15px; margin-top: 30px; }
.btn-primary { 
    flex: 1; padding: 14px; border-radius: 12px; border: none; font-weight: 700; cursor: pointer;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue)); color: white;
    transition: transform 0.2s, filter 0.2s;
}
.btn-secondary { 
    padding: 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); font-weight: 600; cursor: pointer;
    background: rgba(255,255,255,0.05); color: white; transition: all 0.2s;
}
.btn-primary:hover, .btn-secondary:hover { filter: brightness(1.2); transform: translateY(-2px); }

/* Grid de Selección Visual (para preguntas rápidas) */
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
.choice-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.choice-card i { font-size: 1.5rem; margin-bottom: 8px; display: block; }
.choice-card:hover, .choice-card.selected {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-purple);
    transform: translateY(-3px);
}

/* Period Card Active Hover */
.period-card-active:hover {
    transform: translateY(-8px) !important;
    border-color: rgba(168, 85, 247, 0.6) !important;
    box-shadow: 0 15px 40px rgba(168, 85, 247, 0.2) !important;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(34, 211, 238, 0.12)) !important;
}

/* Student Profile Modal */
#student-profile-modal .modal-content {
    text-align: left;
    max-height: 85vh;
    overflow-y: auto;
}


/* Google Translate Overrides */
.goog-te-banner-frame.skiptranslate { display: none !important; }
body { top: 0px !important; }
.goog-te-combo { padding: 8px; border-radius: 8px; background: rgba(255,255,255,0.1); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.2); outline: none; font-family: var(--font-body); }



/* GLOBAL SEARCH DROPDOWN UI */
.glass-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    z-index: 1000;
    padding: 10px;
    opacity: 0;
    transform: translateY(-10px);
    animation: dropdownFadeIn 0.3s forwards ease-out;
}

@keyframes dropdownFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.glass-dropdown::-webkit-scrollbar {
    width: 6px;
}
.glass-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.search-result-item {
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    margin-bottom: 5px;
    text-decoration: none;
    display: flex;
}
.search-result-item:hover {
    background: var(--glass-bg);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateX(5px);
}
.search-result-icon {
    font-size: 1.8rem;
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.1);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}
.search-result-content {
    display: flex;
    flex-direction: column;
}
.search-result-content h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-heading);
}
.search-result-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.3;
}
.search-result-badge {
    font-size: 0.60rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 5px;
    display: inline-block;
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    align-self: flex-start;
}
.search-empty-state {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}


/* =========================================
   GAMIFICATION UI SUBSYSTEM
========================================= */

/* XP Profile Widget (Home Sidebar / Profile) */
.xp-widget {
    margin-top: 5px;
    width: 100%;
}
.xp-widget.compact {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 5px 0 0 0 !important;
    box-shadow: none !important;
}
.xp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.xp-level-badge {
    background: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
    padding: 2px 6px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.65rem;
}
.xp-title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.xp-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0;
}
.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #8b5cf6);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}
.xp-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.xp-count {
    color: var(--text-primary);
    font-weight: bold;
}

/* Notebook Completion Button */
.gami-finish-wrapper {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 30px;
}
#btn-complete-session {
    padding: 16px 36px;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    border-radius: 30px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}
#btn-complete-session.btn-active {
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    color: white;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3), inset 0 2px 5px rgba(255,255,255,0.2);
}
#btn-complete-session.btn-active:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(168, 85, 247, 0.5), inset 0 2px 5px rgba(255,255,255,0.3);
}
#btn-complete-session.btn-completed {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    cursor: default;
}

/* Toast Notifications */
#gamification-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.gami-toast {
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.gami-toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.toast-msg {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Level Up Overlay (fallback) */
.level-up-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(13, 14, 21, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    animation: levelIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.level-up-overlay h1 { font-size: 3rem; color: #fbbf24; text-shadow: 0 0 20px rgba(251,191,36,0.5); margin-bottom: 20px;}
.level-up-overlay p { font-size: 2rem; color: #a855f7; font-weight: bold; }
@keyframes levelIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}


/* =========================================
   FLASHCARDS CLASROOM SYSTEM
========================================= */

.flashcards-section {
    margin: 40px 0;
    text-align: center;
    perspective: 1000px;
}

.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.flashcard {
    height: 320px;
    cursor: pointer;
    perspective: 1000px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-radius: 20px;
    box-sizing: border-box;
    border: 1px solid var(--glass-border);
}

.flashcard-front {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.flashcard-back {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(34, 211, 238, 0.15));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    transform: rotateY(180deg);
    border-color: var(--accent-purple);
}

.flashcard-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--accent-cyan);
    opacity: 0.8;
}

.flashcard-front h3 {
    font-family: var(--font-heading);
    color: white;
    font-size: 1.2rem;
    line-height: 1.4;
    margin: 0;
}

.flashcard-back p {
    font-family: var(--font-body);
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

.flashcard-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
}

.flashcard.flipped .flashcard-badge {
    background: rgba(168, 85, 247, 0.3);
    color: white;
}

/* Flashcards Unlock Animation */
@keyframes unlockBtn {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.unlock-anim {
    animation: unlockBtn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* --- SILENCIADOR DE GOOGLE TRANSLATE (WIDGET CLEANUP) --- */
.goog-te-banner-frame, 
.goog-te-banner, 
.goog-te-menu-value:hover, 
.goog-te-gadget-icon,
.goog-tooltip,
.goog-tooltip:hover,
#google_translate_element .goog-te-gadget-simple {
    display: none !important;
}

.goog-text-highlighter {
    background: transparent !important;
    box-shadow: none !important;
}

body {
    top: 0 !important;
    position: static !important;
}

#google_translate_element {
    height: 0 !important;
    overflow: hidden !important;
}
