/* --- VARIABLES DE DISEÑO (Bento Clean Theme) --- */
:root {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F7F7F9;
    /* Gris muy suave */
    --text-primary: #1A1A1A;
    --text-secondary: #6C757D;
    --accent-color: #0d6efd;
    --border-light: #E9ECEF;
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.05);
    /* Sombra suave */
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.1);
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 50px;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 80px;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    /* Evita scroll horizontal accidental */
}

/* --- LAYOUT --- */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar.collapsed .link-text,
.sidebar.collapsed .logo-text {
    opacity: 0;
    display: none;
}

.logo-icon {
    margin-left: 15px;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: white;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav-links i,
.nav-links .emoji-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

/* --- MAIN CONTENT (Ajustado para Padding Global) --- */
.main-content {
    flex: 1;
    padding: 24px 40px;
    /* Padding generoso en Desktop */
    margin-left: var(--sidebar-width-collapsed);
    transition: margin-left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    /* Asegura que ocupe el ancho disponible */
    box-sizing: border-box;
}

.sidebar-expanded .main-content {
    margin-left: var(--sidebar-width);
}

/* --- COMPONENTES UI (Menú Toggle) --- */
.menu-toggle-cylinder {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 30px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: fit-content;
    position: relative;
    z-index: 100;
}

.menu-toggle-cylinder:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.menu-toggle-cylinder::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 4px;
    background: var(--border-light);
    border-radius: 4px;
}

/* --- HERO SECTION --- */
.hero-container {
    min-height: 100vh;
    /* Ocupa toda la pantalla */
    /* Ajuste para centrar contenido verticalmente */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: 60px;
}

.badge-pill {
    background: #EEF2FF;
    color: var(--accent-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    color: #111;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 500;
}

/* Botones */
.btn-primary-custom {
    background-color: #111;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary-custom:hover {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    color: white;
}

.btn-outline-custom {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-outline-custom:hover {
    border-color: #111;
    background-color: white;
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    animation: bounce 2s infinite;
    color: var(--text-secondary);
    font-size: 1.5rem;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.animate-fade-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* --- SECCIONES & ESPACIADO --- */
.section-padding {
    padding: 80px 0;
}

.section-title {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

/* Ajuste específico para el contenedor gris */
.bg-soft-gray {
    background-color: var(--bg-secondary);
    padding: 3rem;
    /* Espacio interno para que el texto no toque el borde */
}

.text-accent {
    color: var(--accent-color);
}

.rounded-3xl {
    border-radius: var(--radius-xl);
}

.small-caps {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    font-weight: 800;
    text-transform: uppercase;
}

/* --- BENTO CARD SYSTEM --- */
.bento-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 2rem;
    /* Espacio interno default */
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 0, 0, 0.1);
}

.bento-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Iconos de pasos */
.step-icon-bg {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.emoji-lg {
    font-size: 1.8rem;
}

.bg-blue-soft {
    background: #E7F1FF;
}

.bg-green-soft {
    background: #E6F8F0;
}

.bg-purple-soft {
    background: #F3E8FF;
}

.bento-card h3 {
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.bento-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* --- DASHBOARD PREVIEW GRID --- */
.dashboard-preview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
}

/* Posicionamiento Desktop */
.dashboard-main {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.stat-card {
    min-height: 160px;
}

.subjects-card {
    grid-column: 2 / 4;
}

.subject-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.2s;
}

.subject-item:hover {
    background: #f8f9fa;
}

.icon-sq {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* --- RUTA VISUAL --- */
.path-visual-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
}

.path-line {
    position: absolute;
    top: 25px;
    left: 40px;
    right: 40px;
    height: 4px;
    background: #E9ECEF;
    z-index: 1;
}

.path-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.path-node i {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 3px solid #E9ECEF;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.node-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.path-node.completed i {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.path-node.current i {
    background: white;
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.2);
}

.path-node.boss i {
    border-radius: 16px;
    width: 60px;
    height: 60px;
}

/* --- BENEFICIOS --- */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.benefit-large {
    grid-column: span 1;
    grid-row: span 2;
    background: #fffcf5;
    border-color: #faeacc;
}

.benefit-wide {
    grid-column: span 2;
    background: #F0F4FF;
    border: none;
}

/* --- DECORACIONES --- */
.decoration-circle {
    position: absolute;
    right: -50px;
    bottom: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* =========================================
   === RESPONSIVE (MÓVIL - CORRECCIONES) ===
   ========================================= */

@media (max-width: 768px) {

    /* --- 1. Ajustes Generales --- */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 260px !important;
        z-index: 1050;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s ease;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 20px 24px !important;
        width: 100%;
    }

    #menuToggle {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1200;
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        margin: 0;
    }

    body.mobile-menu-active #menuToggle {
        transform: translateX(260px) !important;
    }

    .hero-container {
        padding-top: 80px;
    }

    .hero-title {
        font-size: 2.8rem;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .bg-soft-gray {
        padding: 1.5rem;
        border-radius: 20px;
    }

    /* CORRECCIÓN: Grid del Dashboard en una sola columna */
    .dashboard-preview-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        /* Dejamos que las filas sean automáticas */
        gap: 16px;
    }

    /* 🔥 IMPORTANTE: Reiniciamos las posiciones de los hijos para que no se encimen */
    .dashboard-main,
    .subjects-card {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    /* CORRECCIÓN: Grid de Beneficios en una sola columna */
    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .benefit-large,
    .benefit-wide {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .bento-card {
        padding: 1.5rem;
    }

    /* --- 2. RUTA VISUAL "SNAKE" (ZIGZAG) --- */
    .path-visual-container {
        flex-direction: column;
        height: auto;
        padding: 20px 0;
        gap: 0;
    }

    .path-line {
        width: 4px;
        height: 100%;
        left: 50%;
        transform: translateX(-50%);
        top: 0;
        background: linear-gradient(to bottom, var(--border-light) 0%, var(--accent-color) 100%);
    }

    .path-node {
        display: grid;
        grid-template-columns: 1fr 60px 1fr;
        align-items: center;
        width: 100%;
        margin-bottom: 30px;
        position: relative;
        z-index: 2;
    }

    .path-node i {
        grid-column: 2;
        margin: 0 auto;
        background: white;
    }

    .path-node:nth-of-type(odd) .node-label {
        grid-column: 3;
        text-align: left;
        margin-left: 15px;
    }

    .path-node:nth-of-type(even) .node-label {
        grid-column: 1;
        text-align: right;
        margin-right: 15px;
    }
}

/* --- 3. ANIMACIÓN DEL FOOTER (Global) --- */
footer {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

footer.visible {
    opacity: 1;
    transform: translateY(0);
}
/* --- BLOQUEO DE SCROLL (Para menú móvil) --- */
body.mobile-menu-active {
    overflow: hidden !important;
    height: 100vh; /* Asegura que no se mueva en algunos navegadores iOS */
    touch-action: none; /* Deshabilita gestos táctiles fuera del menú */
}