/* =========================================
   1. VARIABLES DE COLORES (MODOS CLARO/OSCURO)
   ========================================= */
:root {
    /* --- MODO OSCURO (Tu base) --- */
    --bg-body: #0E1117;          /* Fondo muy oscuro */
    --bg-sidebar: #13161c;       /* Barra lateral */
    --text-main: #ffffff;        /* Texto blanco */
    --text-muted: #a0aec0;       /* Texto gris */
    --card-bg: #1c1f2e;          /* Fondo de tarjetas */
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #00f2fe;     /* CYAN NEÓN PRINCIPAL */
    --accent-glow: rgba(0, 242, 254, 0.5); /* Resplandor */
    --input-bg: #2b303b;
    --hover-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    /* --- MODO CLARO (Legible) --- */
    --bg-body: #f0f2f5;
    --bg-sidebar: #ffffff;
    --text-main: #1a202c;        /* Texto negro */
    --text-muted: #4a5568;
    --card-bg: #ffffff;
    --border-color: #d1d5db;
    --accent-color: #007bff;     /* Azul fuerte */
    --accent-glow: rgba(0, 123, 255, 0.3);
    --input-bg: #edf2f7;
    --hover-bg: #f7fafc;
}

/* =========================================
   2. ESTRUCTURA GENERAL
   ========================================= */
body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
}

h1, h2, h3, p, span, i, a { transition: color 0.3s; }

/* =========================================
   3. SIDEBAR (IZQUIERDA)
   ========================================= */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    padding: 30px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    z-index: 10;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 25px;
    /* Texto con degradado pero con fallback de color */
    background: linear-gradient(45deg, var(--accent-color), #d81b60);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Si el navegador falla, se vería el color de fondo, así que forzamos visibilidad con sombra si hace falta */
}

/* Inputs y Selects */
select, input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
    box-sizing: border-box; /* IMPORTANTE para que no se salgan */
}
select:focus, input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

label { font-size: 0.85rem; color: var(--text-muted); font-weight: bold; margin-bottom: 5px; display: block; }

/* Botones Sidebar */
.btn-gris {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 12px; margin-top: 10px;
    background-color: var(--input-bg); color: var(--text-muted);
    border: 1px solid var(--border-color); border-radius: 10px;
    text-decoration: none; font-weight: 600;
    transition: 0.3s; box-sizing: border-box;
}
.btn-gris:hover {
    background-color: var(--bg-body);
    color: var(--text-main);
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.user-box {
    background: var(--input-bg);
    padding: 15px; border-radius: 10px; margin-top: 15px;
    border: 1px solid var(--border-color); text-align: center;
}

/* --- SECCIÓN INFERIOR SIDEBAR (Estilo ChatGPT) --- */
.sidebar-bottom {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}

#theme-toggle {
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    z-index: 100;
}

#theme-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-main);
    border-color: var(--accent-color);
}

/* Perfil de usuario estilo ChatGPT */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

.user-profile:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #d81b60);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar i {
    color: white;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
}

.logout-link:hover {
    color: #ff4b2b;
}

/* Botón Login cuando no está logueado */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-color), #d81b60);
    color: white;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 242, 254, 0.3);
}

/* Botón Generar (Sidebar) */
#generate-btn {
    width: 100%; padding: 15px; margin-top: 15px;
    background: linear-gradient(135deg, #00f2fe 0%, #d81b60 100%);
    border: none; border-radius: 10px;
    color: white; font-weight: bold; cursor: pointer;
    transition: 0.3s;
}
#generate-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(216, 27, 96, 0.4); }

/* =========================================
   4. CONTENIDO PRINCIPAL (DERECHA) - ARREGLADO
   ========================================= */
.content-area {
    flex: 1;
    padding: 50px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Fondo limpio para asegurar contraste */
    background-color: var(--bg-body); 
}

#landing-page {
    text-align: center;
    max-width: 1000px;
    width: 100%;
}

/* TÍTULO HÉROE (GRANDE Y VISIBLE) */
.hero-title {
    font-size: 4.5rem; /* Grande */
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text-main); /* Blanco en modo oscuro, Negro en claro */
    /* Sombra Neón para el efecto brillante */
    text-shadow: 0 0 25px var(--accent-glow); 
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 300;
}

/* Botón Subir PDF (Central) */
.cta-btn, .upload-label {
    display: inline-block;
    background: var(--text-main); /* Contraste total */
    color: var(--bg-body);
    padding: 20px 50px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: transform 0.2s;
}
.cta-btn:hover { transform: scale(1.05); }

/* Botón Neón Escritorio (Central) */
.btn-neon-central {
    display: inline-block; padding: 12px 40px; margin-top: 25px;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    background: transparent;
    border-radius: 50px; text-decoration: none; font-weight: bold;
    text-transform: uppercase; letter-spacing: 1px;
    transition: 0.3s;
    box-shadow: 0 0 10px var(--accent-glow);
}
.btn-neon-central:hover {
    background: var(--accent-color);
    color: var(--bg-body); /* Texto oscuro al rellenarse */
    box-shadow: 0 0 30px var(--accent-glow);
}

/* --- TARJETAS DE CARACTERÍSTICAS (ESTILO NEÓN) --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Se adaptan */
    gap: 30px;
    margin-top: 70px;
}

.feature-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    /* Borde sutil */
    border: 1px solid var(--border-color);
    transition: 0.3s ease;
    text-align: center;
    position: relative;
    /* Sombra suave */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Hover: Se ilumina el borde y sube */
.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 0 25px var(--accent-glow);
}

.feature-card i {
    font-size: 3rem; /* Iconos grandes */
    margin-bottom: 20px;
    color: var(--text-main);
    /* Brillo en el icono */
    text-shadow: 0 0 15px var(--accent-glow);
    transition: 0.3s;
}

.feature-card:hover i {
    color: var(--accent-color);
    transform: scale(1.1);
}

.feature-card h3 { font-size: 1.3rem; margin-bottom: 10px; color: var(--text-main); }
.feature-card p { font-size: 0.95rem; color: var(--text-muted); }

/* --- TEXTO CON DEGRADADO (Para el título) --- */
.gradient-text {
    background: linear-gradient(135deg, var(--accent-color), #d81b60);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* --- WRAPPER DE ICONOS EN TARJETAS --- */
.icon-wrapper {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(216, 27, 96, 0.1));
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.feature-card:hover .icon-wrapper {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.1);
}

/* --- PEGAR AL FINAL DEL ARCHIVO --- */

/* Hace que los iconos (i) dentro de las etiquetas de la sidebar brillen */
.sidebar div label i {
    margin-right: 8px;
    color: var(--accent-color); /* Cyan Neón */
    filter: drop-shadow(0 0 5px var(--accent-glow)); /* El resplandor */
    transition: 0.3s;
}

/* Efecto al pasar el ratón por encima de los desplegables (Selects) */
.sidebar select:hover {
    border-color: var(--accent-color);
    background-color: var(--hover-bg);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow); /* Añadimos brillo extra */
}

/* =========================================
   🤖 NERDIE: EL ASISTENTE HOLOGRÁFICO
   ========================================= */

/* 1. Contenedor centrado */
#nerdie-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto; /* Centrado encima del título */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 2. El Avatar (Cerebro) que flota */
.nerdie-avatar {
    position: relative;
    font-size: 4.5rem; /* Tamaño grande */
    color: var(--accent-color); /* Color Cyan */
    z-index: 2;
    animation: floaty-idle 4s ease-in-out infinite; /* Animación base */
    transition: all 0.5s;
}

/* Detalles de la cara */
.nerdie-avatar .brain-icon {
    filter: drop-shadow(0 0 25px var(--accent-glow));
}
.nerdie-avatar .glasses-icon {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    color: #fff;
    opacity: 0.9;
}

/* 3. La sombra debajo */
.nerdie-shadow {
    position: absolute;
    bottom: -15px;
    width: 60%;
    height: 15px;
    background: var(--accent-glow);
    border-radius: 50%;
    filter: blur(8px);
    opacity: 0.4;
    animation: shadow-idle 4s ease-in-out infinite;
}

/* --- ANIMACIONES --- */
@keyframes floaty-idle {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes shadow-idle {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(0.6); opacity: 0.2; }
}

/* --- MODO PENSANDO (GIRAR RÁPIDO) --- */
.nerdie-thinking .nerdie-avatar {
    animation: thinking-spin 0.8s linear infinite;
    color: #ff0055; /* Se pone rojo/rosa */
}
.nerdie-thinking .brain-icon {
    filter: drop-shadow(0 0 40px #ff0055);
}

@keyframes thinking-spin {
    0% { transform: rotate(0deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1.1); }
}