/* /css/style.css (Versión Final y Corregida con Tema Dual) */

/* ============================================= */
/*          VARIABLES Y ESTILOS GLOBALES         */
/* ============================================= */
:root {
    --color-background-dark: #0A2533;
    --color-primary: #FF6B6B;
    --color-card-dark: #143649;
    --color-background-light: #f8f9fa;
    --color-card-light: #ffffff;
    --color-text-light: #F0F8FF;
    --color-text-dark: #212529;
    --color-text-muted: #a0aec0;
    --font-family: 'Poppins', sans-serif;
    --border-radius: 12px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

body { font-family: var(--font-family); min-height: 100vh; }

.wrapper { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.main-container { width: 100%; }


/* ============================================= */
/*              SISTEMA DE TEMAS                 */
/* ============================================= */
body.dark-theme {
    background-color: var(--color-background-dark);
    color: var(--color-text-light);
}
body.light-theme {
    background-color: var(--color-background-light);
    color: var(--color-text-dark);
}

/* Centrado solo para páginas de autenticación */
body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
/* Espaciado para páginas de contenido oscuro (Dashboard) */
body.dark-theme:not(.auth-page) .wrapper {
    padding-top: 40px;
    padding-bottom: 40px;
}

/* ============================================= */
/*           CABECERA Y BANNER COMUNES           */
/* ============================================= */
.main-header { display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; gap: 20px; text-decoration: none; }
.logo-container img { width: 60px; }
.logo-container .app-name { font-size: 2.2rem; font-weight: 700; color: var(--color-text-light); }
.logo-container .app-subtitle { display: block; font-size: 0.7rem; letter-spacing: 1px; color: var(--color-text-muted); }

.hero-banner {
    background-color: var(--color-background-dark);
    color: var(--color-text-light);
    padding: 20px 0 60px 0;
    position: relative;
    overflow: hidden;
}
.light-theme .hero-banner { 
    padding-bottom: 120px;
    border-bottom-left-radius: 40px; 
    border-bottom-right-radius: 40px; 
}

/* ============================================= */
/*       FORMULARIOS (INDEX & COMPLETAR PERFIL)    */
/* ============================================= */
.dark-theme .main-header { padding: 20px 0; margin-bottom: 40px; }
.card-form {
    background-color: var(--color-card-dark); padding: 40px; border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1);
}
.form-title { font-size: 2rem; font-weight: 700; margin-bottom: 25px; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--color-text-muted); }
.form-group input, .dark-theme select { width: 100%; padding: 12px 15px; background-color: var(--color-background-dark); border: 1px solid var(--color-text-muted); border-radius: 8px; color: var(--color-text-light); font-size: 1rem; }
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 45px; }
.toggle-password { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--color-text-muted); padding: 0; width: 20px; height: 20px; }
.toggle-password:hover { color: var(--color-text-light); }
.toggle-password svg { width: 100%; height: 100%; }
.divider { border: none; border-top: 1px solid var(--color-card-dark); margin: 30px 0; }
.form-disclaimer { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 25px; margin-top: -10px; }

/* ============================================= */
/*          PÁGINA: DASHBOARD (TEMA OSCURO)      */
/* ============================================= */
.dashboard-card-dark { padding: 60px 40px; text-align: center; background-color: var(--color-card-dark); border-radius: var(--border-radius); border: 1px solid rgba(255, 255, 255, 0.1); }
.welcome-title-dark { font-size: 2.5rem; font-weight: 700; margin-bottom: 40px; }
.dashboard-grid-dark { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.module-card { background-color: var(--color-background-dark); border-radius: var(--border-radius); padding: 40px 30px; display: flex; flex-direction: column; align-items: center; }
.module-card-logo { width: 110px; height: 110px; margin-bottom: 15px; }
.module-card-brand { font-size: 2.8rem; font-weight: 700; letter-spacing: 2px; margin-bottom: 25px; }
.module-card-brand.large-title { font-size: 2.2rem; line-height: 1.3; }
.module-card-title { font-size: 1.8rem; font-weight: 600; margin-bottom: 15px; }
.module-card-subtitle { font-size: 1rem; color: var(--color-text-muted); flex-grow: 1; margin-bottom: 40px; }
.dark-theme .tools-section { margin-top: 60px; text-align: center; }
.dark-theme .section-title { font-size: 1.3rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 30px; text-transform: uppercase; letter-spacing: 2px; }
.tools-grid-dark { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.tool-card-dark { background-color: var(--color-card-dark); padding: 30px; border-radius: var(--border-radius); border: 1px solid rgba(255, 255, 255, 0.1); }
.tool-card-dark.disabled { opacity: 0.5; }
.tool-card-dark h4 { font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; }

/* ============================================= */
/*       PÁGINAS: SINAPSE & CATEGORIA (CLARAS)   */
/* ============================================= */
.hero-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hero-content-split { display: flex; align-items: center; justify-content: space-between; gap: 40px; margin-top: 40px; }
.hero-text { flex: 1; max-width: 55%; }
.hero-title { font-size: 2.8rem; font-weight: 700; }
.hero-subtitle { font-size: 1.2rem; color: var(--color-text-muted); margin-top: 10px; }
.hero-illustration { position: absolute; bottom: 0; right: 5%; width: 380px; height: auto; opacity: 0.9; }
.hero-illustration img { max-width: 100%; display: block; }
.diagonal-divider { position: absolute; bottom: 0; left: 0; width: 100%; height: 100px; background: var(--color-background-light); clip-path: polygon(0% 100%, 100% 0%, 100% 100%); }

.content-area { padding: 60px 0; }
.content-title { font-size: 2rem; font-weight: 700; margin-bottom: 30px; text-align: center; }
.light-theme .page-title { font-size: 2.2rem; font-weight: 700; margin-bottom: 25px; padding-left: 10px; }
.light-theme .tools-section { margin-top: 60px; text-align: center; }
.light-theme .section-title { font-size: 1.3rem; font-weight: 600; color: #888; margin-bottom: 30px; text-transform: uppercase; }

.breadcrumbs { font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.breadcrumbs a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--color-text-light); }
.breadcrumbs span { color: var(--color-text-muted); }

.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; }
.light-category-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background-color: var(--color-card-light); border-radius: var(--border-radius); padding: 40px 20px; text-align: center; text-decoration: none; color: var(--color-text-dark); box-shadow: var(--shadow); transition: all 0.2s ease-in-out; border: 1px solid transparent; }
.light-category-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); border-color: var(--color-primary); }
.category-icon-container { width: 80px; height: 80px; }
.category-icon-container img { width: 100%; height: 100%; object-fit: contain; }
.light-category-card h3 { font-size: 1.5rem; font-weight: 700; }

.game-buttons-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.game-btn { padding: 20px 30px; font-size: 1.1rem; font-weight: 700; color: white; border: none; border-radius: var(--border-radius); cursor: pointer; transition: all 0.2s ease-in-out; min-width: 200px; text-align: center; }
.game-btn:hover { transform: translateY(-5px); filter: brightness(1.1); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.game-btn.color-1 { background-color: #3B82F6; } .game-btn.color-2 { background-color: #10B981; } .game-btn.color-3 { background-color: #F59E0B; } .game-btn.color-4 { background-color: #8B5CF6; }

.card.light-card { padding: 30px; background-color: var(--color-card-light); border-radius: var(--border-radius); box-shadow: var(--shadow); }
.progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.progress-card { padding: 30px; }
.progress-card h4 { text-align: center; font-weight: 600; color: #888; margin-bottom: 20px; }
.progress-container { position: relative; }

/* ============================================= */
/*             COMPONENTES GLOBALES              */
/* ============================================= */
.btn { width: 100%; padding: 15px; border: none; border-radius: 8px; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: all 0.2s ease-in-out; }
.btn-primary { background-color: var(--color-primary); color: white; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3); }
.btn-large { padding: 18px 40px; font-size: 1.2rem; max-width: 300px; margin: 0 auto; text-decoration: none; display: inline-block; }
.btn-logout { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); padding: 8px 20px; font-weight: 600; border-radius: var(--border-radius); cursor: pointer; transition: all 0.2s; }
.btn-logout:hover { background: var(--color-primary); color: white; }
.btn.disabled-link { background-color: var(--color-text-muted); cursor: not-allowed; pointer-events: none; opacity: 0.6; }
.btn.disabled-link:hover { transform: none; box-shadow: none; filter: none; }

.main-nav { display: flex; align-items: center; gap: 15px; }
.nav-link { color: var(--color-text-light); text-decoration: none; font-weight: 600; padding: 8px 16px; border-radius: var(--border-radius); transition: background-color 0.2s; }
.nav-link:hover { background-color: rgba(255, 255, 255, 0.1); }

.notification-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); display: none; justify-content: center; align-items: center; z-index: 1000; }
.notification-card { background-color: var(--color-card-dark); padding: 30px; border-radius: var(--border-radius); text-align: center; width: 90%; max-width: 400px; border-top: 4px solid var(--color-primary); }
.notification-card h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 15px; color: var(--color-text-light); }
.notification-card.error h3 { color: var(--color-primary); }
.notification-card p { color: var(--color-text-muted); margin-bottom: 25px; line-height: 1.6; }
.notification-card button { width: auto; padding: 10px 30px; }

/* ============================================= */
/*                   RESPONSIVE                  */
/* ============================================= */
@media (max-width: 900px) {
    .dashboard-grid-dark, .dashboard-grid, .progress-grid { grid-template-columns: 1fr; }
    .hero-text { max-width: 100%; }
    .hero-illustration { position: relative; right: auto; bottom: auto; order: -1; margin: 0 auto 20px auto; width: 180px; }
    .hero-content-split { flex-direction: column; text-align: center; }
}
/* ============================================= */
/*          FOOTER LEGAL Y LAYOUT FLEX (CORREGIDO) */
/* ============================================= */

/* Aplica a todas las páginas (excepto las de autenticación) el layout de columna
   para que ocupen toda la altura y el footer se quede abajo. */
body:not(.auth-page) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* El contenedor principal debe crecer para empujar el footer hacia abajo.
   Esto se aplica a .main-container o al .wrapper principal. */
body:not(.auth-page) > .main-container,
body:not(.auth-page) > .wrapper {
    flex-grow: 1;
}

/* Estilos del Footer */
.legal-footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}

.dark-theme .legal-footer {
    background-color: var(--color-background-dark);
}
.light-theme .legal-footer {
    background-color: var(--color-background-light);
    border-top: 1px solid var(--color-border-light);
}

.legal-footer .wrapper {
    min-height: auto; /* Anula el min-height del sticky footer para el wrapper del footer */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.legal-footer p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
}

.legal-footer nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.legal-footer nav a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-footer nav a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}