/* ==========================================================================
   Amar Bangla - Custom Elegant Stylesheet
   ========================================================================== */

/* Variables and Custom Properties */
:root {
    --primary-color: #006A4E;       /* Flag Green */
    --primary-dark: #004D39;
    --primary-light: #e6f3f0;
    --accent-color: #F42A41;        /* Flag Red */
    --accent-light: #fde9eb;
    --bg-color: #faf9f6;            /* Warm Off-White */
    --card-bg: #ffffff;
    --text-main: #1e293b;           /* Dark Slate */
    --text-muted: #64748b;          /* Cool Grey */
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
}

/* Bengali Script Styling helper */
.bengali-script {
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
}

/* Layout Containers */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- COMPONENT: STATS DE USUARIO EN CABECERA --- */
.header-user-stats-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 106, 78, 0.03);
    border: 1px solid rgba(0, 106, 78, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-lg);
    margin: 0 1.5rem;
}

.header-stat-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.header-stat-icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.header-stat-value {
    color: var(--text-main);
    font-size: 0.85rem;
}

.header-badge-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-badge-container .gold-badge-icon {
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    background: #fffbeb;
    border: 1px solid #ffd700;
    color: #b45309;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
}

.header-badge-container .badge-placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    font-style: italic;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text h1 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-dark);
}

.logo-text h1 span {
    font-size: 1.1rem;
    color: var(--accent-color);
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.content-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - 220px);
}

/* Nav Menu & Mobile Nav */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
    font-weight: 600;
}

/* ==========================================================================
   DROPDOWN MENU STYLES (DESKTOP)
   ========================================================================== */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.dropdown-trigger {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: inherit;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
}

.dropdown-trigger:hover,
.nav-dropdown.active .dropdown-trigger {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.chevron {
    font-size: 0.7rem;
    display: inline-block;
    transition: transform 0.25s ease;
}

/* Rotate chevron on hover or when open */
.nav-dropdown:hover .chevron,
.nav-dropdown.open .chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu listing */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-bottom: 3px solid var(--primary-color); /* Acabado premium */
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    list-style: none;
    min-width: 220px;
    z-index: 1000;
    
    /* Reveal transition */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

/* Show menu on hover, focus-within, or when open */
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    display: block;
    width: 100%;
}

.dropdown-menu .nav-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 1.2rem;
    border-radius: 0;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.dropdown-menu .nav-link:hover,
.dropdown-menu .nav-link.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* SPA Sections visibility */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* ==========================================================================
   COMPONENTE GLOBAL: BOTONES (UNIFICADOS & PREMIUM)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 700;
    border-radius: var(--radius-lg); /* Bordes más curvos y premium */
    cursor: pointer;
    text-decoration: none;
    gap: 0.5rem;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    white-space: nowrap;
    padding: 0.6rem 1.25rem; /* Tamaño mediano/estándar por defecto */
    font-size: 0.9rem;
}

/* Tiers de Tamaño */
.btn-lg {
    padding: 0.8rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
}

/* Estilo 1: Botones Primarios (Degradado verde y elevación) */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white !important;
    box-shadow: 0 4px 14px rgba(0, 106, 78, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 106, 78, 0.35);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

/* Estilo 2: Botones Secundarios (Fondo blanco/slate y elevación suave) */
.btn-secondary {
    background-color: white;
    color: var(--text-main) !important;
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* Estilo 3: Botones Outline (Bordes primarios y brillo sutil) */
.btn-outline {
    background-color: transparent;
    border-color: var(--primary-color);
    border-width: 1.5px;
    color: var(--primary-color) !important;
}

.btn-outline:hover {
    transform: translateY(-2px);
    background-color: rgba(0, 106, 78, 0.04);
    box-shadow: 0 4px 12px rgba(0, 106, 78, 0.1);
    border-color: var(--primary-light);
    color: var(--primary-light) !important;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ==========================================================================
   TAB: INICIO
   ========================================================================== */
.hero-section {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3.5rem;
}

.hero-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.hero-actions .btn-primary.btn-glowing {
    box-shadow: 0 0 15px rgba(0, 106, 78, 0.4);
    transition: all 0.3s ease;
}

.hero-actions .btn-primary.btn-glowing:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 106, 78, 0.6);
}

.bangladesh-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.bangladesh-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
}

.card-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
}

.bangladesh-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bangladesh-card p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.bangladesh-card p strong {
    color: var(--text-muted);
    font-weight: 500;
    display: inline-block;
    width: 110px;
}

.bangladesh-card hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

.bangladesh-card .quote {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

/* Home Section Header */
.home-section-header {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.25rem;
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.home-section-header h3 {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.home-section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ==========================================================================
   COMPONENTE GLOBAL: BENTO GRID DE HERRAMIENTAS (HOME)
   ========================================================================== */
.home-tools-bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.bento-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                background-image 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

/* Asignaciones de Columnas en Escritorio (Ancho > 992px) */
@media (min-width: 993px) {
    /* Fila 1: Gimnasios Activos (50% / 50%) */
    .bento-card.featured-gold {
        grid-column: span 6;
    }
    .bento-card.featured-green {
        grid-column: span 6;
    }

    /* Fila 2: Herramientas de Práctica (33% / 33% / 33%) */
    .bento-card.hover-yellow,
    .bento-card.hover-red,
    .bento-card.hover-teal {
        grid-column: span 4;
    }

    /* Fila 3: Referencias Ampliadas (50% / 50%) */
    .bento-card.hover-purple,
    .bento-card.hover-green {
        grid-column: span 6;
    }
}

/* Adaptabilidad para Tabletas (768px a 992px) */
@media (max-width: 992px) and (min-width: 769px) {
    .bento-card.featured-gold,
    .bento-card.featured-green {
        grid-column: span 6;
    }
    .bento-card.hover-yellow,
    .bento-card.hover-red,
    .bento-card.hover-teal {
        grid-column: span 4;
    }
    .bento-card.hover-purple,
    .bento-card.hover-green {
        grid-column: span 6;
    }
}

/* Adaptabilidad para Móviles (< 768px) */
@media (max-width: 768px) {
    .home-tools-bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-card {
        grid-column: span 12 !important;
    }
}

/* Estilizado Interno de Tarjetas Bento */
.bento-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.bento-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.bento-card-badge-wrap {
    display: flex;
    margin-bottom: 1rem;
}

.bento-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
}

.bento-card-icon {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.bento-action-link {
    align-self: flex-start;
    background: none;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), color 0.3s ease;
    color: var(--primary-color);
}

.bento-card:hover .bento-action-link {
    transform: translateX(6px);
}

/* Colores y Brillos de Hovers Contextuales de Bento */

@keyframes bento-icon-float {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    50% { transform: translateY(-4px) rotate(3deg) scale(1.08); }
    100% { transform: translateY(0) rotate(0deg) scale(1); }
}

.bento-card:hover .bento-card-icon {
    animation: bento-icon-float 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* 1. Featured Gold (Gimnasio de Números) */
.bento-card.featured-gold {
    border-top: 4px solid var(--accent-color);
}
.bento-card.featured-gold .bento-card-badge {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde047;
    transition: all 0.3s ease;
}
.bento-card.featured-gold .bento-action-link {
    color: var(--accent-color);
}
.bento-card.featured-gold:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(217, 119, 6, 0.15), 0 5px 15px rgba(217, 119, 6, 0.05);
    border-color: rgba(217, 119, 6, 0.35);
    background-image: linear-gradient(135deg, var(--card-bg) 0%, rgba(217, 119, 6, 0.015) 100%);
}

/* 2. Featured Green (Gimnasio de Letras) */
.bento-card.featured-green {
    border-top: 4px solid var(--primary-color);
}
.bento-card.featured-green .bento-card-badge {
    background-color: rgba(0, 106, 78, 0.03);
    color: var(--primary-color);
    border: 1px solid rgba(0, 106, 78, 0.15);
    transition: all 0.3s ease;
}
.bento-card.featured-green:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 106, 78, 0.15), 0 5px 15px rgba(0, 106, 78, 0.05);
    border-color: rgba(0, 106, 78, 0.35);
    background-image: linear-gradient(135deg, var(--card-bg) 0%, rgba(0, 106, 78, 0.015) 100%);
}

/* 3. Hover Yellow (Alfabeto) */
.bento-card.hover-yellow .bento-card-icon { color: #b45309; }
.bento-card.hover-yellow:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(217, 119, 6, 0.12), 0 5px 15px rgba(217, 119, 6, 0.04);
    border-color: #fbbf24;
    background-image: linear-gradient(135deg, var(--card-bg) 0%, rgba(217, 119, 6, 0.01) 100%);
}

/* 4. Hover Red (Flashcards) */
.bento-card.hover-red .bento-card-icon { color: var(--accent-color); }
.bento-card.hover-red .bento-action-link { color: var(--accent-color); }
.bento-card.hover-red:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(244, 42, 65, 0.12), 0 5px 15px rgba(244, 42, 65, 0.04);
    border-color: var(--accent-color);
    background-image: linear-gradient(135deg, var(--card-bg) 0%, rgba(244, 42, 65, 0.015) 100%);
}

/* 5. Hover Teal (Chats) */
.bento-card.hover-teal .bento-card-icon { color: #0d9488; }
.bento-card.hover-teal .bento-action-link { color: #0d9488; }
.bento-card.hover-teal:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(13, 148, 136, 0.12), 0 5px 15px rgba(13, 148, 136, 0.04);
    border-color: #2dd4bf;
    background-image: linear-gradient(135deg, var(--card-bg) 0%, rgba(13, 148, 136, 0.01) 100%);
}

/* 6. Hover Purple (Gramática) */
.bento-card.hover-purple .bento-card-icon { color: #7c3aed; }
.bento-card.hover-purple .bento-action-link { color: #7c3aed; }
.bento-card.hover-purple:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.12), 0 5px 15px rgba(124, 58, 237, 0.04);
    border-color: #c084fc;
    background-image: linear-gradient(135deg, var(--card-bg) 0%, rgba(124, 58, 237, 0.01) 100%);
}

/* 7. Hover Green (Cultura) */
.bento-card.hover-green .bento-card-icon { color: var(--primary-color); }
.bento-card.hover-green:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 106, 78, 0.12), 0 5px 15px rgba(0, 106, 78, 0.04);
    border-color: var(--primary-color);
    background-image: linear-gradient(135deg, var(--card-bg) 0%, rgba(0, 106, 78, 0.01) 100%);
}

/* Trivia Widget - Pizarrón Moderno */
.quiz-preview-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    color: white;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    margin-bottom: 3rem;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.trivia-progress {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.quiz-preview-card h3 {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
}

.trivia-carousel {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.trivia-body {
    flex: 1;
    min-width: 0;
}

.quiz-preview-card p {
    font-size: 1.05rem;
    color: #cbd5e1;
    margin-bottom: 0;
    line-height: 1.6;
}

.trivia-nav-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    padding: 0;
    line-height: 1;
}

.trivia-nav-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.08);
}

.trivia-nav-btn:active {
    transform: scale(0.95);
}

.trivia-nav-btn:focus-visible {
    outline: 2px solid #fde047;
    outline-offset: 2px;
}

.trivia-action-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.quiz-preview-card .badge {
    display: inline-block;
    padding: 0.25rem 0.60rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: #fde047;
    border: 1px solid rgba(253, 224, 71, 0.25);
}

.trivia-answer {
    background-color: rgba(255, 255, 255, 0.06);
    border-left: 3px solid #fde047;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.trivia-answer p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: white;
    line-height: 1.6;
}

.trivia-resource-link:hover {
    color: #93c5fd !important;
}

/* Responsive design adjustments for mobile screens */
@media (max-width: 480px) {
    .trivia-carousel {
        gap: 0.5rem;
    }
    .trivia-nav-btn {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 1.25rem;
    }
    .quiz-preview-card {
        padding: 1.5rem;
    }
    .quiz-header {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ==========================================================================
   TAB: ALFABETO
   ========================================================================== */
.tab-subnav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.subnav-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.subnav-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.subnav-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.alphabet-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.alphabet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 106, 78, 0.1);
    border-color: rgba(0, 106, 78, 0.25);
}

.letter-main {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 3.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    line-height: 1;
}

.letter-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.letter-sound {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.letter-example {
    font-size: 0.8rem;
    background-color: var(--bg-color);
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
}

.letter-vocab-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
}

.letter-vocab-link:hover {
    color: var(--primary-dark);
    transform: translateX(3px);
}

.practice-letter-header-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    overflow: hidden;
    z-index: 1;
}

/* Watermark background */
.practice-letter-header-card::after {
    content: "";
    position: absolute;
    right: -2rem;
    bottom: -2rem;
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 15rem;
    font-weight: 700;
    color: rgba(0, 106, 78, 0.035); /* Extremely subtle watermarked character */
    line-height: 1;
    z-index: -1;
    pointer-events: none;
}

.practice-word-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.practice-word-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 106, 78, 0.08);
    border-color: rgba(0, 106, 78, 0.2);
}

.practice-word-bangla {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    line-height: 1.2;
}

.practice-word-pronunciation {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.practice-word-spanish {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Audio trigger styling using vector SVG stroke */
.audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 106, 78, 0.05);
    border: 1px solid rgba(0, 106, 78, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.2s ease;
    padding: 0;
}

.audio-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.audio-btn .speaker-icon-svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.alphabet-card .audio-btn,
.practice-word-card .audio-btn,
.practice-letter-header-card .audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 106, 78, 0.05) !important;
    border: 1px solid rgba(0, 106, 78, 0.1) !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    cursor: pointer;
    color: var(--primary-color) !important;
    transition: all 0.2s ease;
    padding: 0 !important;
    margin: 0 !important;
}

.alphabet-card .audio-btn:hover,
.practice-word-card .audio-btn:hover,
.practice-letter-header-card .audio-btn:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: scale(1.1) !important;
}

.highlight-letter {
    background-color: #fef08a; /* Fondo amarillo pastel suave */
    color: #000000 !important; /* Texto oscuro para legibilidad total */
    padding: 0.05rem 0.15rem;
    border-radius: var(--radius-sm);
    font-weight: bold;
    border-bottom: 2px solid var(--accent-color); /* Línea de acento roja nacional de Bangladesh */
    display: inline-block;
}

.highlight-sound {
    background-color: #fef08a; /* Fondo amarillo pastel suave */
    color: #000000 !important; /* Texto oscuro para legibilidad total */
    padding: 0.05rem 0.15rem;
    border-radius: var(--radius-sm);
    font-weight: bold;
    border-bottom: 2px solid var(--primary-color); /* Línea de acento verde nacional de Bangladesh */
    display: inline-block;
}

/* ==========================================================================
   TAB: CONVERSACIONES
   ========================================================================== */
.conversations-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.conversations-sidebar {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    max-height: 500px;
    overflow-y: auto;
}

.conversations-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.conversation-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conversation-item-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition-fast);
}

.conversation-item-btn:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.conversation-item-btn.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.conversation-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 260px); /* Ocupa más espacio vertical responsivamente */
    min-height: 550px;            /* Altura mínima garantizada */
    max-height: 720px;            /* Evita que desborde y genere scroll de página */
}

.conversation-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-card-header h3 {
    font-size: 1.2rem;
}

.conv-controls {
    display: flex;
    gap: 1.25rem;
}

.toggle-control {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.toggle-control input {
    cursor: pointer;
}

.chat-area {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background-color: #f8fafc; /* Subtle contrasting bg */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Chat Bubbles */
.chat-bubble-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: bubbleIn 0.3s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

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

/* Indicador de escritura animado */
.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.75rem 1rem !important;
    background-color: #e2e8f0 !important;
    color: #475569 !important;
    border-radius: var(--radius-md) !important;
    margin-top: 0.25rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #475569;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.3); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; }
}

.chat-bubble-wrapper.you {
    align-self: flex-end;
}

.chat-bubble-wrapper.other {
    align-self: flex-start;
}

.interlocutor-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
    padding: 0 0.5rem;
}

.chat-bubble-wrapper.you .interlocutor-name {
    text-align: right;
}

.chat-bubble {
    padding: 0.85rem 1.1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.45;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-bubble-wrapper.you .chat-bubble {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble-wrapper.other .chat-bubble {
    background-color: white;
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.bubble-bangla {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.15rem;
}

.bubble-pronunciation {
    font-size: 0.85rem;
    opacity: 0.9;
    font-style: italic;
    margin-bottom: 0.15rem;
}

.chat-bubble-wrapper.other .bubble-pronunciation {
    color: var(--text-muted);
}

.bubble-espanol {
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 0.25rem;
    margin-top: 0.25rem;
}

.chat-bubble-wrapper.other .bubble-espanol {
    border-top: 1px solid var(--border-color);
    color: #475569;
}

.chat-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.play-controls {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 576px) {
    .chat-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    .play-controls {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   TAB: VOCABULARIO
   ========================================================================== */
.vocab-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.cat-btn {
    background-color: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.cat-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.cat-btn.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* 3D Flip Card */
.vocab-card-wrapper {
    perspective: 1000px;
    height: 180px; /* Incrementado para evitar desbordamiento */
    cursor: pointer;
}

.vocab-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.vocab-card-wrapper:hover .vocab-card {
    /* Optional mild visual feedback before click */
}

.vocab-card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem; /* Reducido para dar más espacio al contenido interno */
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.card-face.front {
    background-color: white;
    color: var(--primary-color);
}

.card-face.front .vocab-bangla {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 1.75rem; /* Ajustado para que quepan oraciones completas */
    font-weight: bold;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.card-face.front .tap-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: absolute;
    bottom: 0.75rem;
}

.card-face.back {
    background-color: var(--primary-color);
    color: white;
    transform: rotateY(180deg);
}

.card-face.back h4 {
    color: white;
    font-size: 1.15rem; /* Reducido proporcionalmente */
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.card-face.back p {
    font-size: 0.85rem; /* Reducido proporcionalmente */
    opacity: 0.9;
    font-style: italic;
    line-height: 1.2;
}

.card-face.back .vocab-bangla-back {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 1.35rem; /* Reducido proporcionalmente */
    font-weight: bold;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    padding-bottom: 0.4rem;
    width: 80%;
}

.card-face.back .vocab-conv-link {
    font-size: 0.75rem;
    color: #ffd700; /* Un color oro hermoso sobre fondo verde oscuro */
    text-decoration: underline;
    margin-top: 0.6rem;
    display: inline-block;
    transition: var(--transition-fast);
}

.card-face.back .vocab-conv-link:hover {
    color: white;
    transform: scale(1.05);
}

/* ==========================================================================
   TAB: GRAMÁTICA
   ========================================================================== */
/* Índice de Unidades Gramaticales */
.grammar-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grammar-unit-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.grammar-unit-card:hover:not(.locked) {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.grammar-unit-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.grammar-unit-card .unit-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.grammar-unit-card .unit-icon {
    font-size: 2rem;
    background-color: var(--bg-color);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.grammar-unit-card.locked .unit-icon::after {
    content: "🔒";
    position: absolute;
    font-size: 1.5rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.grammar-unit-card.locked .unit-icon {
    color: transparent; /* Oculta el icono original si está bloqueado */
}

.grammar-unit-card .unit-info h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0;
}

.grammar-unit-card .unit-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
}

.grammar-unit-card .unit-status {
    margin-top: auto;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grammar-unit-card.locked .unit-status {
    color: var(--danger-color);
}

.grammar-unit-card:not(.locked) .unit-status {
    color: var(--primary-color);
}

/* Botón Volver en Detalle de Gramática */
.btn-back-grammar {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1.5rem;
    transition: var(--transition-fast);
}

.btn-back-grammar:hover {
    color: var(--primary-color);
}

.btn-back-grammar .icon {
    font-size: 1.2rem;
}

.grammar-sub-tab {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.grammar-sub-tab.active {
    display: block;
}

.grammar-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.grammar-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
}

.grammar-badge {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    background-color: #fef3c7;
    color: #d97706;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.grammar-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.grammar-card p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.formula-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-color);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px dashed var(--border-color);
}

.formula-box .part {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.formula-box .part.subject { background-color: #dbeafe; color: #1e40af; }
.formula-box .part.object { background-color: #fef3c7; color: #92400e; }
.formula-box .part.verb { background-color: #d1fae5; color: #065f46; }

.example-box {
    border-left: 4px solid var(--primary-color);
    background-color: var(--bg-color);
    padding: 1.25rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 1rem;
}

.example-box.small {
    padding: 0.85rem;
}

.example-box.warning {
    border-left-color: var(--accent-color);
}

.example-box p {
    margin-bottom: 0.25rem;
}

.example-box .bengali {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.example-box .pronunciation {
    font-size: 0.95rem;
    color: var(--text-main);
    font-style: italic;
}

.example-box .translation {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.sub-box h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.note {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

/* Elegant Table */
.table-responsive {
    overflow-x: auto;
}

.elegant-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    text-align: left;
}

.elegant-table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
}

.elegant-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.elegant-table td.bengali {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.elegant-table tbody tr:hover {
    background-color: #f8fafc;
}

/* ==========================================================================
   TAB: CULTURA
   ========================================================================== */
.culture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
}

.culture-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.culture-img {
    height: 150px;
    background-color: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
}

.culture-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.culture-info {
    padding: 1.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.culture-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.culture-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
    background-color: var(--text-main);
    color: #94a3b8;
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid #334155;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
}

/* ==========================================================================
   RESPONSIVE STYLES (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 992px) {
    .header-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .header-user-stats-bar {
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0 0 0;
    }
}

@media (max-width: 900px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .conversations-layout {
        grid-template-columns: 1fr;
    }

    .conversations-sidebar {
        max-height: 200px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .culture-grid {
        grid-template-columns: 1fr;
    }

    .study-resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: static;
    }

    .nav-toggle {
        display: flex;
        position: relative;
        z-index: 1001;
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 300px;
        height: 100vh;
        max-height: 100vh;
        background-color: var(--card-bg);
        border: none;
        border-left: 1px solid var(--border-color);
        border-radius: 0;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        padding: 6rem 1.5rem 2rem;
        flex-direction: column;
        gap: 0.75rem;
        z-index: 1000;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        /* Backdrop effect using box-shadow */
    }

    .nav-links.show {
        right: 0;
        animation: none;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15), 0 0 0 100vw rgba(0, 0, 0, 0.4);
    }

    /* Mobile Dropdown styles */
    .nav-dropdown {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 0.8rem 1rem;
        font-size: 1.1rem;
    }

    .nav-link {
        padding: 0.8rem 1rem;
        font-size: 1.1rem;
        width: 100%;
        display: block;
    }

    .dropdown-menu {
        position: static;
        opacity: 0;
        visibility: hidden;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--primary-color);
        background-color: rgba(0, 0, 0, 0.02);
        padding: 0;
        margin-top: 0;
        margin-bottom: 0;
        margin-left: 1rem;
        min-width: unset;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        display: block;
    }

    .nav-dropdown.open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 400px;
        margin-bottom: 0.5rem;
    }

    .dropdown-menu .nav-link {
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }

    .content-container {
        margin: 1rem auto;
    }

    .hero-text h2 {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .grammar-card {
        padding: 1.5rem;
    }

    .grammar-badge {
        position: static;
        margin-bottom: 0.5rem;
    }
}

/* Scroll lock for body when mobile menu is open */
body.nav-open-lock {
    overflow: hidden !important;
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem 1rem;
    }
    .logo-text p {
        display: none !important;
    }
    .logo-text h1 {
        font-size: 1.1rem;
    }
    .logo {
        gap: 0.5rem;
    }
}

/* ==========================================================================
   SISTEMA DE RECONOCIMIENTO DE PALABRAS (PRÁCTICA)
   ========================================================================== */
.practice-container {
    max-width: 600px;
    margin: 0 auto;
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.score-display {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.practice-config-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* Toggle Switch Estético */
.toggle-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    gap: 0.5rem;
    user-select: none;
}
.toggle-container input {
    display: none;
}
.toggle-slider {
    width: 2.5rem;
    height: 1.25rem;
    background-color: #cbd5e1;
    border-radius: 9999px;
    position: relative;
    transition: background-color var(--transition-fast);
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: white;
    top: 0.125rem;
    left: 0.125rem;
    transition: transform var(--transition-fast);
}
.toggle-container input:checked + .toggle-slider {
    background-color: var(--primary-color);
}
.toggle-container input:checked + .toggle-slider::before {
    transform: translateX(1.25rem);
}

.practice-quiz-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
}

.quiz-exercise-type-badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.quiz-question-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.quiz-question-bengali {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-main);
    line-height: 1.2;
}

.audio-btn-large {
    background: var(--primary-light);
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), background-color var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.audio-btn-large:hover {
    transform: scale(1.1);
    background-color: #006A4E20;
}

.quiz-hint-pronunciation {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 2rem;
    min-height: 1.5rem;
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option-btn {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition-fast);
    text-align: left;
}

.quiz-option-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.quiz-option-btn.correct {
    background-color: #e6f4ea !important;
    border-color: #34a853 !important;
    color: #137333 !important;
}

.quiz-option-btn.incorrect {
    background-color: #fce8e6 !important;
    border-color: #ea4335 !important;
    color: #c5221f !important;
}

.option-bangla-text {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 1.15rem;
    font-weight: bold;
}

/* Botones de audio Text-to-Speech */
.audio-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--primary-color);
    transition: transform var(--transition-fast) ease, background-color var(--transition-fast) ease;
    vertical-align: middle;
}

.audio-btn:hover {
    transform: scale(1.15);
    background-color: var(--primary-light);
}

/* Buscador Inteligente de Vocabulario */
.search-bar-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem auto;
    display: flex;
    align-items: center;
}

#vocab-search-input {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 2.5rem; /* Espacio para el emoji lupa y la X */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

#vocab-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.clear-search-btn {
    position: absolute;
    right: 0.8rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast) ease, color var(--transition-fast) ease;
}

.clear-search-btn:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

/* Mensaje de Sin Resultados */
.no-results-message {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-muted);
    background-color: white;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-width: 500px;
    margin: 1.5rem auto;
}

.no-results-message .sad-emoji {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.no-results-message p {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

/* Opciones de Diálogo Interactivo (Ramificación) */
#chat-choices-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem auto;
    max-width: 550px;
    width: 100%;
    animation: fadeIn var(--transition-fast) ease;
}

.choice-chip-btn {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    transition: transform 0.15s ease, border-color var(--transition-fast) ease, background-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.choice-chip-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.choice-chip-btn:active {
    transform: translateY(0);
}

/* Pantalla Previa de Selección de Diálogos */
.menu-category-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.menu-category-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.dialogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.dialogue-topic-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    transition: transform var(--transition-fast) ease, border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
    box-shadow: var(--shadow-sm);
}

.dialogue-topic-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.dialogue-topic-card .topic-icon {
    font-size: 2.5rem;
}

.dialogue-topic-card h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.dialogue-topic-card .topic-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
}

.dialogue-topic-card .topic-badge.static {
    background-color: #e2e8f0;
    color: #475569;
}

.dialogue-topic-card .topic-badge.interactive {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* Sección destacada de diálogos interactivos */
.interactive-highlight-section {
    background-color: #f0fdf4; /* Un verde claro sumamente sutil */
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 106, 78, 0.08);
}

.dialogue-topic-card.interactive-highlight-card {
    border: 2px solid var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 106, 78, 0.05);
}

.dialogue-topic-card.interactive-highlight-card:hover {
    box-shadow: 0 8px 20px rgba(0, 106, 78, 0.12);
    transform: translateY(-6px);
}

.locked-dialogue-card {
    opacity: 0.6;
    filter: grayscale(1);
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(0,0,0,0.02);
}

.locked-dialogue-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
}

/* Tarjeta de Introducción / Play Obligatorio al Entrar */
.chat-intro-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    max-width: 550px;
    margin: 3rem auto;
    box-shadow: var(--shadow-md);
    animation: fadeIn var(--transition-fast) ease;
}

.chat-intro-card h2 {
    font-size: 1.7rem;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    font-weight: 700;
}

.chat-intro-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 2rem 0;
}

.chat-intro-card .btn-start-play {
    padding: 0.85rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   CAMINO DE APRENDIZAJE & GIMNASIOS INTERACTIVOS (Premium)
   ========================================================================== */

/* Utility helper */
.hidden {
    display: none !important;
}

/* Pantallas de Aprendizaje */
.aprendizaje-screen {
    animation: fadeIn var(--transition-fast) ease;
}

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

/* Panel de estadísticas / Perfil del Hub */
.user-stats-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Insignias en el Hub */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.badge-placeholder {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.gold-badge-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #f59e0b;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    animation: goldShine 3s infinite alternate;
}

@keyframes goldShine {
    0% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
    100% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
}

/* Enlaces a los Gimnasios */
.gyms-links-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.gym-teaser-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    flex: 1;
    min-width: 250px;
    max-width: 340px;
}

.gym-teaser-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.gym-teaser-card.bg-numbers {
    border-left: 4px solid var(--primary-color);
}

.gym-teaser-card.bg-letters {
    border-left: 4px solid var(--accent-color);
}

.gym-teaser-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.gym-teaser-content h3 {
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
    color: var(--text-main);
}

.gym-teaser-content p {
    display: none; /* Ocultar en el Hub del mapa para mantenerlo ultra compacto */
}

.btn-teaser-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: color var(--transition-fast);
}

.gym-teaser-card.bg-letters .btn-teaser-link {
    color: var(--accent-color);
}

.gym-teaser-card:hover .btn-teaser-link {
    text-decoration: underline;
}

/* Roadmap Outer Container */
.roadmap-outer-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

/* Separadores de Unidad (Eye-Candy Banners) */
.roadmap-unit-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    text-align: center;
    position: relative;
    z-index: 5;
    margin: 2rem auto 2.5rem auto;
    max-width: 500px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.roadmap-unit-header:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Diferentes bordes superiores para cada unidad para dar más eye-candy */
.roadmap-unit-header.unit-1 {
    border-top: 4px solid var(--primary-color);
}

.roadmap-unit-header.unit-2 {
    border-top: 4px solid var(--accent-color);
}

.unit-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.roadmap-unit-header.unit-1 .unit-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.roadmap-unit-header.unit-2 .unit-badge {
    background: var(--accent-light);
    color: #991b1b;
}

.unit-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.unit-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Estilos responsivos de los separadores de unidad en móvil */
@media (max-width: 580px) {
    .roadmap-unit-header {
        padding: 1rem;
        margin: 1.5rem auto 2rem auto;
    }
    .unit-title {
        font-size: 1.05rem;
    }
    .unit-subtitle {
        font-size: 0.8rem;
    }
}

.roadmap-section-title {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.roadmap-tree-wrapper {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Línea de guía visual del Roadmap */
.roadmap-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    transform: translateX(-50%);
    background-image: linear-gradient(to bottom, var(--border-color) 60%, transparent 60%);
    background-size: 4px 16px;
    background-repeat: repeat-y;
    z-index: 1;
}

/* Estilo del árbol y nodos */
.roadmap-tree {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Contenedores visuales de Unidad */
.unit-box {
    background: rgba(0, 106, 78, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 0 1.5rem 0;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.unit-banner-node {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    border-radius: 0;
    margin-bottom: 2rem;
}

.unit-banner-node h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.unit-banner-node p {
    font-size: 0.95rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.unit-nodes-container {
    padding: 0 1.5rem;
}

.roadmap-node {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

/* Alternar izquierda y derecha en escritorio */
.roadmap-node:nth-child(even) {
    flex-direction: row-reverse;
}

.roadmap-node:nth-child(even) .node-info-text {
    text-align: right;
    padding-left: 0;
    padding-right: 1.5rem;
}

/* Contenedor del Botón */
.node-badge-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

/* Círculo Interactivo */
.node-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid var(--card-bg);
    background: var(--border-color);
    color: var(--text-muted);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: relative;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.node-status-check {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    opacity: 0;
    transform: scale(0.6);
    transition: transform var(--transition-fast) ease, opacity var(--transition-fast) ease;
}

/* Estados de los Nodos */
.roadmap-node.completed .node-circle {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.roadmap-node.completed .node-status-check {
    opacity: 1;
    transform: scale(1);
}

.roadmap-node.current .node-circle {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #d97706;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    animation: nodePulse 2s infinite ease-in-out;
}

@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.7); }
}

.roadmap-node.blocked {
    opacity: 0.65;
}

.roadmap-node.blocked .node-circle {
    background: #f1f5f9;
    border-color: var(--border-color);
    color: #94a3b8;
    cursor: not-allowed;
}

/* Información textual del Nodo */
.node-info-text {
    flex-grow: 1;
    padding-left: 1.5rem;
    z-index: 2;
}

.node-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.roadmap-node.current .node-label {
    color: #d97706;
}

.roadmap-node.completed .node-label {
    color: var(--primary-color);
}

.node-title {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-top: 0.15rem;
}

/* Efecto de Parpadeo/Foco del Nodo Activo al hacer Scroll */
.roadmap-node.highlight-pulse .node-circle {
    animation: focusGlow 0.5s ease 3;
}

@keyframes focusGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); transform: scale(1.1); }
    50% { box-shadow: 0 0 35px rgba(245, 158, 11, 0.9); transform: scale(1.25); }
}

/* Botón de Acción Flotante (FAB) de Enfoque */
.floating-scroll-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 106, 78, 0.4);
    cursor: pointer;
    z-index: 99;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    animation: floatBreath 3s infinite ease-in-out;
}

.floating-scroll-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 106, 78, 0.6);
}

@keyframes floatBreath {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Responsivo para el botón flotante en móvil */
@media (max-width: 580px) {
    .floating-scroll-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 10px rgba(0, 106, 78, 0.5);
    }
    .floating-btn-text {
        display: none; /* Ocultar texto en móviles */
    }
}

/* Responsivo para el Árbol */
@media (max-width: 580px) {
    .user-stats-panel {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
        background: transparent;
        border: none;
        box-shadow: none;
        flex-direction: row;
    }
    .stat-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        min-width: auto;
        max-width: none;
        flex: none;
        display: flex;
        flex-direction: row;
        gap: 0.25rem;
        align-items: center;
    }
    .stat-icon {
        font-size: 1rem;
    }
    .stat-label {
        display: none; /* Ocultar "Puntos de Experiencia" / "Racha de Estudio" */
    }
    .stat-value {
        font-size: 0.85rem;
        font-weight: 700;
    }
    
    .gyms-links-container {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        display: flex;
        flex-direction: row; /* Fuerza side-by-side en móvil pequeño */
        flex-wrap: nowrap;
    }
    .gym-teaser-card {
        padding: 0.5rem 0.75rem;
        min-width: auto;
        flex: 1;
        max-width: none;
        border-radius: var(--radius-sm);
        justify-content: center;
        align-items: center;
        border-left: 2px solid var(--border-color); /* Borde sutil */
    }
    .gym-teaser-card.bg-numbers {
        border-left-width: 3px;
    }
    .gym-teaser-card.bg-letters {
        border-left-width: 3px;
    }
    .gym-teaser-icon {
        font-size: 1.1rem;
    }
    .gym-teaser-content h3 {
        font-size: 0.8rem;
        margin: 0;
    }
    .btn-teaser-link {
        display: none; /* Ocultar texto de enlace en móvil */
    }

    .roadmap-outer-container {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .roadmap-section-title {
        font-size: 1.05rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.5rem;
    }
    .roadmap-tree {
        gap: 2rem;
    }
    .roadmap-line {
        left: 28px;
    }
    .roadmap-node {
        flex-direction: row !important;
    }
    .roadmap-node:nth-child(even) .node-info-text {
        text-align: left;
        padding-left: 1.25rem;
        padding-right: 0;
    }
    .node-badge-wrapper {
        width: 56px;
    }
    .node-circle {
        width: 48px;
        height: 48px;
        font-size: 1.15rem;
    }
    .node-info-text {
        padding-left: 1.25rem;
    }
    .node-title {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    .node-label {
        font-size: 0.7rem;
    }
}

/* Hito Especial (Exámenes) */
.roadmap-node.milestone-node .node-circle {
    border-radius: 8px; /* Cuadrado con bordes suaves o forma de diamante */
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
}

.roadmap-node.milestone-node.completed .node-circle {
    background: #d1fae5;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Visor de Lecciones */
.lesson-header-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 1.75rem;
    background: transparent;
}

.lesson-header-bar #libro-viewer-subtitle {
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    max-height: 50px;
    opacity: 1;
    overflow: hidden;
}

.lesson-header-titles {
    flex-grow: 1;
}

.lesson-badge-category {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.35rem;
}

#lesson-viewer-title {
    font-size: 1.6rem;
    color: var(--text-main);
}

#lesson-viewer-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Dos columnas del visor */
.lesson-split-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .lesson-split-container {
        grid-template-columns: 1fr;
    }
}

.panel-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.panel-title {
    font-size: 1.2rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.panel-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.theory-scrollable-content {
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text-main);
}

.theory-scrollable-content h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.theory-scrollable-content p {
    margin-bottom: 0.85rem;
}

.theory-scrollable-content ul, .theory-scrollable-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.85rem;
}

.theory-scrollable-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--primary-light);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1rem 0;
    font-style: italic;
}

/* Paginación de Teoría */
.theory-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.theory-page-indicator {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Botón destacado pulsante para iniciar cuestionario */
.theory-btn-start-quiz {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: white !important;
    font-weight: bold !important;
    box-shadow: 0 0 10px rgba(244, 42, 65, 0.4) !important;
    animation: theory-pulse 2s infinite !important;
}

@keyframes theory-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 42, 65, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(244, 42, 65, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 42, 65, 0);
    }
}

/* Tarjetas de vocabulario */
.lesson-vocab-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

/* Tarjeta Flashcard de Vocabulario en Lección (Elegante y Volteable) */
.lesson-vocab-card-wrapper {
    perspective: 1000px;
    height: 90px;
}

.lesson-vocab-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-in-out;
    cursor: pointer;
}

.lesson-vocab-card.flipped {
    transform: rotateY(180deg);
}

.lesson-vocab-card-front, .lesson-vocab-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.lesson-vocab-card-front {
    background: var(--card-bg);
    justify-content: space-between;
}

.lesson-vocab-card-back {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: rotateY(180deg);
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    text-align: center;
}

.vocab-word-info {
    display: flex;
    flex-direction: column;
}

.vocab-word-bangla {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.vocab-word-phonetic {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.audio-btn {
    background: #f1f5f9;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background var(--transition-fast);
}

.audio-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* Pie de Acción de la Lección */
.lesson-footer-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-light);
    border: 1px solid rgba(0, 106, 78, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .lesson-footer-action {
        flex-direction: column;
        text-align: center;
    }
}

.footer-action-info h4 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.footer-action-info p {
    color: var(--text-main);
    font-size: 0.9rem;
}

/* Cuestionario y Preguntas */
.quiz-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 580px) {
    .quiz-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

.quiz-title-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.quiz-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
    max-width: 400px;
    justify-content: flex-end;
}

@media (max-width: 580px) {
    .quiz-progress-wrapper {
        max-width: 100%;
        width: 100%;
    }
}

.quiz-progress-bar {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    flex-grow: 1;
    overflow: hidden;
}

.quiz-progress-fill {
    background: var(--primary-color);
    height: 100%;
    width: 0%;
    transition: width var(--transition-normal);
}

.quiz-progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.quiz-card-container {
    max-width: 650px;
    margin: 2rem auto;
}

.question-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    margin-bottom: 1.5rem;
}

.question-box h3 {
    font-size: 1.35rem;
    color: var(--text-main);
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.quiz-option-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.quiz-option-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.quiz-option-btn:focus {
    outline: 2px solid var(--primary-color);
}

/* Respuestas correctas e incorrectas en el Quiz */
.quiz-option-btn.correct {
    background: #d1fae5 !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-dark) !important;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(0, 106, 78, 0.25);
}

.quiz-option-btn.incorrect {
    background: var(--accent-light) !important;
    border-color: var(--accent-color) !important;
    color: #991b1b !important;
    font-weight: 700;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Caja de Explicación */
.quiz-explanation-box {
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1rem;
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

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

.explanation-icon {
    font-size: 1.5rem;
}

.explanation-text-content strong {
    color: #1e3a8a;
    display: block;
    margin-bottom: 0.25rem;
}

.explanation-text-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Contenedor de acciones del Quiz */
#quiz-action-container {
    margin-top: 1.25rem;
    width: 100%;
    animation: slideUp 0.3s ease;
}

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

/* Botón con autoplay animado y barra de progreso visual */
.btn-autoplay {
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-autoplay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: rgba(255, 255, 255, 0.25);
    z-index: -1;
    pointer-events: none;
    animation: btnAutoplayProgress 4s linear forwards;
}

@keyframes btnAutoplayProgress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Resultados del Quiz */
.results-summary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    top: -20px;
    z-index: 10;
    pointer-events: none;
    will-change: transform, opacity;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(600px) rotate(720deg);
        opacity: 0;
    }
}

.results-actions-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
    width: 100%;
}

@media (min-width: 640px) {
    .results-actions-container {
        flex-direction: row;
    }
}

.results-actions-container .btn {
    width: 100%;
}

@media (min-width: 640px) {
    .results-actions-container .btn {
        width: auto;
        min-width: 180px;
    }
}

.results-icon-achievement {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 1rem;
}

.results-summary h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

#results-score-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.results-xp-badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

/* GIMNASIO DE NÚMEROS */
.gym-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gym-tab {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.75rem 0.25rem;
    cursor: pointer;
    position: relative;
}

.gym-tab:hover {
    color: var(--text-main);
}

.gym-tab.active {
    color: var(--primary-color);
}

.gym-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.conversor-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .conversor-panel {
        grid-template-columns: 1fr;
    }
}

.input-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.input-panel label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

#num-converter-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    outline: none;
    margin-bottom: 1rem;
}

#num-converter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 106, 78, 0.15);
}

.conversor-help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.output-panel {
    background: var(--primary-light);
    border: 1px solid rgba(0, 106, 78, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.panel-card-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.bengali-display {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.phonetic-display {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-main);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.btn-audio-large {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

/* Configuración de juegos */
.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (max-width: 580px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }
}

.setup-group {
    display: flex;
    flex-direction: column;
}

.setup-group label {
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.setup-group select {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    outline: none;
    font-size: 0.95rem;
}

.setup-group select:focus {
    border-color: var(--primary-color);
}

/* Área de Juego Activo */
.game-stats-row {
    display: flex;
    justify-content: space-around;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 1.5rem;
}

.game-stat {
    font-size: 0.95rem;
    color: var(--text-main);
}

.num-question-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.question-header {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.num-question-display {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1;
}

.btn-sound-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Input para Escritura Directa */
.input-game-row {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

#num-game-direct-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    outline: none;
}

#num-game-direct-input:focus {
    border-color: var(--primary-color);
}

/* Caja de Feedback */
.num-feedback-box {
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    animation: fadeIn var(--transition-fast) ease;
}

#num-game-feedback-text, #letter-gym-feedback-text {
    font-weight: 700;
    font-size: 1.05rem;
}

.num-feedback-box.success {
    background: #d1fae5;
    border-left: 5px solid var(--primary-color);
    color: var(--primary-dark);
}

.num-feedback-box.fail {
    background: var(--accent-light);
    border-left: 5px solid var(--accent-color);
    color: #991b1b;
}

/* Tabla de Repaso de Errores */
.repaso-panel {
    margin-top: 2rem;
}

.repaso-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.repaso-table th, .repaso-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.repaso-table th {
    background: #f8fafc;
    color: var(--text-main);
    font-weight: 700;
}

.repaso-table td .erroneo {
    color: var(--accent-color);
    font-weight: bold;
    text-decoration: line-through;
}

.repaso-table td .correcto {
    color: var(--primary-color);
    font-weight: bold;
}

/* GIMNASIO DE LETRAS */
.letter-gym-container {
    display: grid;
    grid-template-columns: 1.1fr 1.5fr;
    gap: 2rem;
    max-width: 750px;
    margin: 2rem auto;
}

@media (max-width: 768px) {
    .letter-gym-container {
        grid-template-columns: 1fr;
    }
}

.letter-card-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.letter-giant-display {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 7rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 1.5rem;
}

.letter-question-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-sm);
}

.letter-question-box h3 {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

/* --- ESTILOS PARA EL MODAL DE EXITO Y SUGERENCIA DE LECCION --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    padding: 2.25rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: modalScaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScaleUp {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: iconBounce 1s infinite alternate ease-in-out;
}

@keyframes iconBounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-8px);
    }
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.modal-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.modal-actions-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pulse-btn {
    animation: pulseBreath 2s infinite ease-in-out;
}

@keyframes pulseBreath {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 106, 78, 0.4);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(0, 106, 78, 0);
    }
}

/* --- ESTILOS DE CONSULTA RÁPIDA (FICHAS) Y BOTÓN FLOTANTE --- */

.fichas-modal-card {
    max-width: 800px;
    width: 95%;
    padding: 2.25rem 2rem 2rem 2rem;
    position: relative;
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.close-modal-btn:hover {
    color: var(--accent-color);
}

.fichas-layout-wrapper {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    text-align: left;
}

.fichas-sidebar {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-right: 1px solid var(--border-color);
    padding-right: 1rem;
}

.ficha-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    width: 100%;
}

.ficha-tab-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.ficha-tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.fichas-content-area {
    flex-grow: 1;
    max-height: 420px; /* Tamaño sumamente razonable, evita salirse de los bordes */
    overflow-y: auto; /* Desplazamiento vertical interno */
    padding-right: 0.5rem; /* Margen para la barra de scroll */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Grilla Responsiva de Dos Columnas para Fichas Rápidas (Eye-Candy) */
.fichas-terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    padding: 0.15rem;
}

.ficha-term-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    transition: transform var(--transition-fast, 0.2s), border-color var(--transition-fast, 0.2s), box-shadow var(--transition-fast, 0.2s);
}

.ficha-term-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.ficha-term-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ficha-term-bangla {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.ficha-term-sub {
    font-size: 0.85rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.ficha-term-phonetic {
    font-style: italic;
    color: var(--text-muted);
}

.ficha-term-category-badge {
    font-size: 0.7rem;
    background: #e2e8f0;
    color: var(--text-muted);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 600;
}

.ficha-term-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ficha-header-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.ficha-active-icon {
    font-size: 2.25rem;
}

.ficha-active-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.ficha-active-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.compact-table th, 
.compact-table td {
    padding: 0.5rem 0.75rem !important;
}

/* Botón Flotante Global: Ir a Lección Actual */
.floating-global-lesson-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(244, 42, 65, 0.4);
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform var(--transition-fast), background-color var(--transition-fast);
    animation: breathPulse 2s infinite ease-in-out;
}

.floating-global-lesson-btn:hover {
    background-color: #d11f35;
    transform: translateY(-2px);
}

@keyframes breathPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(244, 42, 65, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(244, 42, 65, 0.8);
    }
}

/* Estilos para el Buscador de Fichas */
.fichas-search-container {
    margin-bottom: 1.25rem;
    width: 100%;
}

#fichas-search-input {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-pill, 50px);
    border: 2px solid var(--border-color, #e2e8f0);
    background-color: var(--card-bg, #ffffff);
    color: var(--text-color, #1e293b);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast, 0.2s);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
    outline: none;
}

#fichas-search-input:focus {
    border-color: var(--primary-color, #006A4E);
    box-shadow: 0 0 0 3px rgba(0, 106, 78, 0.15);
}

/* Botón Flotante Global: Fichas de Ayuda */
.floating-global-fichas-btn {
    position: fixed;
    top: 5.5rem;
    right: 2rem;
    background: #006A4E;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 106, 78, 0.4);
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform var(--transition-fast, 0.2s), background-color var(--transition-fast, 0.2s), box-shadow 0.2s ease;
    animation: greenBreathPulse 2s infinite ease-in-out;
}

.floating-global-fichas-btn:hover {
    background-color: #00543e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 106, 78, 0.6);
}

@keyframes greenBreathPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 106, 78, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(0, 106, 78, 0.8);
    }
}

/* Botón de Estrella de Favoritos */
.fav-star-btn {
    background: none !important;
    border: none !important;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s ease, color 0.2s ease;
    outline: none;
    line-height: 1;
}

.fav-star-btn.inactive {
    color: #cbd5e1; /* Gris claro */
}

.fav-star-btn.inactive:hover {
    color: #fbbf24; /* Ámbar al pasar cursor */
    transform: scale(1.2);
}

.fav-star-btn.active {
    color: #fbbf24; /* Ámbar brillante */
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
    transform: scale(1.1);
    animation: starPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fav-star-btn.active:hover {
    transform: scale(1.25);
}

@keyframes starPop {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1.1); }
}

/* Contenedor de Favoritos Vacío Premium */
.empty-favorites-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    border: 2px dashed var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    background-color: rgba(248, 250, 252, 0.5);
    text-align: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.empty-favorites-icon {
    font-size: 3rem;
    animation: floatingIcon 3s infinite ease-in-out;
}

.empty-favorites-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color, #1e293b);
    margin: 0;
}

.empty-favorites-text {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    max-width: 320px;
    margin: 0;
    line-height: 1.4;
}

@keyframes floatingIcon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(5deg); }
}

/* Badge de Categoría de Origen */
.ficha-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background-color: var(--primary-light, #e6f0ed);
    color: var(--primary-color, #006A4E);
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Responsivo para móviles (≤ 580px) */
@media (max-width: 580px) {
    .fichas-layout-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .fichas-sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 0.75rem;
        overflow-x: auto;
        white-space: nowrap;
        gap: 0.5rem;
        scrollbar-width: none; /* Ocultar barra de scroll en Firefox */
    }
    
    .fichas-sidebar::-webkit-scrollbar {
        display: none; /* Ocultar barra de scroll en Webkit */
    }
    
    .ficha-tab-btn {
        width: auto;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .floating-global-lesson-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
        bottom: 1.5rem;
        left: 1.5rem;
    }
    
    .floating-global-text {
        display: none;
    }

    .floating-global-fichas-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
        top: 4.5rem;
        right: 1rem;
        z-index: 99;
    }

    .floating-fichas-text {
        display: none;
    }
}

/* ==========================================================================
   TAB: HISTORIA DE BANGLADESH E INFOGRAFÍA INTERACTIVA
   ========================================================================== */
.timeline-container {
    position: relative;
    padding: 1.5rem 0.5rem;
    margin-bottom: 2.5rem;
    overflow-x: auto;
}

.timeline-connector-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: var(--border-color);
    z-index: 1;
}

.timeline-track {
    display: flex;
    gap: 1.25rem;
    position: relative;
    z-index: 2;
    min-width: max-content;
    padding: 0.5rem;
}

.timeline-node-card {
    flex: 0 0 220px;
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.timeline-node-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.timeline-node-card.active {
    border: 3px solid #006A4E;
    background-color: #f0fdf4; /* Verde pastel claro */
    box-shadow: 0 4px 15px rgba(0, 106, 78, 0.15);
    transform: translateY(-2px);
}

.timeline-node-icon {
    font-size: 2rem;
}

.timeline-node-period {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    background: var(--primary-light);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.timeline-node-title {
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
}

.timeline-node-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.timeline-selection-indicator {
    display: none;
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    color: #006A4E;
    font-size: 1.2rem;
    line-height: 1;
    z-index: 10;
}

.timeline-selection-indicator::before {
    content: "▼";
}

.timeline-node-card.active .timeline-selection-indicator {
    display: block;
}

/* HISTORIA DETALLE CARD */
.history-detail-card {
    border-top: 5px solid #006A4E;
    padding: 2rem;
    margin-top: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.history-detail-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.history-detail-header-icon {
    font-size: 2.5rem;
}

.history-detail-header-title {
    display: flex;
    flex-direction: column;
}

.history-detail-header-title h3 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-dark);
}

.history-detail-header-title .era-period {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.25rem;
}

.history-detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.history-detail-main h4,
.history-detail-sidebar h4 {
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.history-detail-context {
    line-height: 1.6;
    color: var(--text-main);
    font-size: 0.95rem;
}

.history-detail-context p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.history-detail-context p:last-child {
    margin-bottom: 0;
}

.characters-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.characters-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
}

.monuments-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.monument-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.monument-item h5 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-weight: 700;
}

.monument-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Audio Pronunciation Button */
.btn-history-audio {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--primary-color);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.btn-history-audio:hover {
    background-color: var(--primary-light);
}

/* Responsive Media Query for History (≤ 768px) */
@media (max-width: 768px) {
    .timeline-container {
        padding-left: 1.5rem;
        overflow-x: visible;
    }

    .timeline-connector-line {
        left: 36px;
        width: 3px;
        height: 100%;
        top: 0;
        bottom: 0;
        transform: none;
    }

    .timeline-track {
        flex-direction: column;
        gap: 1.25rem;
        min-width: unset;
        padding-left: 1rem;
    }

    .timeline-node-card {
        flex: 1;
        width: 100%;
        text-align: left;
        padding: 1rem 1.25rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .timeline-node-card.active .timeline-selection-indicator {
        display: block;
        bottom: auto;
        left: auto;
        right: -10px;
        top: 50%;
        transform: translateY(-50%);
    }

    .timeline-selection-indicator::before {
        content: "►";
    }

    .timeline-selection-indicator {
        font-size: 1rem;
    }

    .history-detail-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   Continuous Book Mode Styles (Unit Libro de Lectura Continua)
   ========================================================================== */
.book-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow: visible; /* Indispensable para que position: sticky funcione en sus hijos */
}

.book-lesson-section {
    padding: 3rem 0;
    border-bottom: 1px solid transparent;
    background-image: linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
    background-size: 100% 1px;
    background-position: bottom;
    background-repeat: no-repeat;
    transition: opacity 0.4s ease, border-color 0.4s ease;
    opacity: 0.6; /* Enfoque de lectura suave (atenuado si está fuera de foco) */
}

.book-lesson-section.active-reading {
    opacity: 1;
    /* Hacemos que la línea divisoria activa brille en verde */
    background-image: linear-gradient(to right, transparent, var(--primary-light) 20%, var(--primary-color) 50%, var(--primary-light) 80%, transparent);
}

.book-lesson-section:last-child {
    background-image: none;
}

.book-lesson-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    padding-top: 1.25rem; /* Margen superior para que no se pegue al borde cuando esté sticky */
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 5rem; /* Pinned right below sticky desktop header */
    background: var(--bg-color); /* Fondo sólido indispensable para tapar el contenido de la lección */
    z-index: 30; /* Encima del contenido pero debajo del Unit Book Header */
    transition: all 0.3s ease;
}
.book-lesson-header.is-stuck {
    border-bottom-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.book-lesson-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.book-lesson-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.book-theory-page {
    margin: 1.5rem 0;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.book-theory-page h4 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.book-vocab-container {
    margin-top: 2rem;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.book-vocab-container h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Beautiful responsive vocabulary table */
.book-vocab-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.book-vocab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.book-vocab-table th {
    background: #f1f5f9;
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.book-vocab-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.book-vocab-table tr:last-child td {
    border-bottom: none;
}

.book-vocab-table tr:nth-child(even) td {
    background-color: rgba(0, 0, 0, 0.01);
}

.book-vocab-table tr:hover td {
    background-color: rgba(0, 106, 78, 0.015) !important;
}

.book-vocab-bengali {
    font-family: 'SolaimanLipi', 'Noto Sans Bengali', sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-main);
}

.book-vocab-phonetic {
    font-style: italic;
    color: var(--text-muted);
}

.book-vocab-spanish {
    font-weight: 500;
    color: var(--text-main);
}

/* Custom inline speaker button styles */
.audio-btn-sm,
.book-vocab-audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 106, 78, 0.05);
    border: 1px solid rgba(0, 106, 78, 0.1);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.85rem !important;
    transition: all 0.2s ease;
    color: var(--primary-color);
}

.audio-btn-sm:hover,
.book-vocab-audio-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
}

.book-footer-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1rem;
}

/* Specific styling for the Global Final Exam milestones */
.milestone-badge-global {
    border-color: #ffd700 !important;
    background: #fffdf0 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ==========================================================================
   Continuous Book Mode Enhancements: Sidebar & Action Boxes
   ========================================================================== */
.book-layout-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    margin-top: 1.5rem;
    position: relative; /* Para soporte sticky del menú lateral */
}

.book-sidebar {
    background: #f8fafc; /* Soft slate/blue background */
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 5rem; /* Pinned right below sticky desktop header */
    max-height: calc(100vh - 8rem);
    overflow-y: auto; /* Permite scroll interno si la pantalla vertical es muy reducida */
    height: fit-content;
    align-self: start; /* PREVIENE ESTIRAMIENTO EN GRID - INDISPENSABLE PARA STICKY */
    z-index: 10;
}

.book-sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.book-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569; /* Slate 600 para un excelente contraste de lectura */
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: none;
    border: 1px solid transparent;
    text-align: left;
    width: 100%;
}

.book-sidebar-link:hover {
    color: var(--primary-color);
    background: rgba(0, 106, 78, 0.04);
    /* NO modificamos border-color para evitar que Chrome/Safari dibujen un borde de 1px que mueva la maquetación */
}

.book-sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(0, 106, 78, 0.15);
    border-color: transparent;
}

.book-content {
    padding: 1.5rem 0;
    scroll-behavior: smooth;
}

.book-quiz-action-box {
    background: rgba(0, 106, 78, 0.03);
    border: 1px solid rgba(0, 106, 78, 0.15);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
    margin-left: 2.5rem;
    margin-right: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.book-chat-action-box {
    background: rgba(59, 130, 246, 0.03);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
    margin-left: 2.5rem;
    margin-right: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.book-quiz-score-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.book-quiz-score-info span:first-child {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}

.book-featured-ficha-box {
    background: rgba(217, 119, 6, 0.03);
    border: 1px solid rgba(217, 119, 6, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
    margin-left: 2.5rem;
    margin-right: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ficha-hint-icon {
    font-size: 1.4rem;
}

.ficha-hint-text {
    flex: 1;
}

@media (max-width: 768px) {
    .book-layout-wrapper {
        grid-template-columns: 1fr;
        max-height: none;
        overflow: visible;
    }
    .book-sidebar {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        position: sticky;
        top: 3.75rem; /* Pinned right below mobile sticky header */
        z-index: 90;
        background: var(--card-bg);
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem 1rem;
        max-height: none;
        height: auto;
        -webkit-overflow-scrolling: touch;
    }
    .book-sidebar-title {
        display: none;
    }
    .book-sidebar-link {
        width: auto;
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .book-content {
        padding: 1rem 0;
        overflow-y: visible;
        height: auto;
    }
    .lesson-header-bar,
    .book-lesson-header {
        position: static;
        background: transparent;
    }
    .book-lesson-header {
        padding-top: 0;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .book-theory-page,
    .book-vocab-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .book-quiz-action-box,
    .book-chat-action-box,
    .book-featured-ficha-box {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }
}

@media (max-width: 640px) {
    .book-quiz-action-box {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .book-featured-ficha-box, .book-chat-action-box {
        flex-direction: column;
        text-align: center;
    }
    .book-featured-ficha-box button, .book-chat-action-box button {
        margin-left: 0 !important;
    }
}

/* --- REDISEÑO DEL HERO (EYE-CANDY) --- */
.hero-redesigned {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 106, 78, 0.05) 0%, rgba(0, 106, 78, 0.01) 100%);
    padding: 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 106, 78, 0.1);
    margin-bottom: 3rem;
}

.hero-redesigned .hero-text h2 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-redesigned .hero-text p {
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Mega CTA Button */
.hero-mega-action {
    margin-top: 2rem;
}

.btn-mega-cta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    width: 100%;
    text-align: left;
    box-shadow: 0 10px 25px rgba(0, 106, 78, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-mega-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 106, 78, 0.4);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.btn-mega-cta .cta-icon {
    font-size: 2.5rem;
    background: rgba(255,255,255,0.2);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-mega-cta .cta-text {
    display: flex;
    flex-direction: column;
}

.btn-mega-cta .cta-text strong {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.btn-mega-cta .cta-text span {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Premium Passport Card */
.passport-card {
    background: #fff;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    position: relative;
    box-shadow: var(--shadow-md);
    background-image: radial-gradient(rgba(0, 106, 78, 0.03) 2px, transparent 2px);
    background-size: 20px 20px;
    transform: rotate(2deg);
    transition: transform 0.3s ease;
    min-height: 420px; /* Asegura altura estable para evitar saltos de maquetación */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.passport-card:hover {
    transform: rotate(0deg) scale(1.02);
}

.passport-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.passport-slide.active {
    display: flex;
    opacity: 1;
    animation: fadeInSlide 0.5s forwards;
}

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

.passport-footer-link {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Indicadores del Carrusel */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.carousel-indicators .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-indicators .indicator.active {
    background: var(--primary-color);
    transform: scale(1.25);
}

.passport-seal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3rem;
    opacity: 0.8;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.passport-header h3 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.passport-header .bengali-script {
    font-size: 1.5rem;
    color: var(--accent-color);
    display: block;
    margin-bottom: 1.5rem;
}

.passport-details p {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.passport-details span {
    font-weight: 700;
    color: var(--text-muted);
    display: inline-block;
    width: 90px;
}

.passport-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* Responsive Hero */
@media (max-width: 992px) {
    .hero-redesigned {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1.5rem;
    }
    .passport-card {
        transform: rotate(0);
    }
}

/* --- GLOBAL FOOTER --- */
.site-footer {
    background: var(--bg-main);
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    margin-top: 4rem;
    text-align: center;
}

.site-footer .footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.site-footer .bengali-quote {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-family: 'SolaimanLipi', serif;
    margin-bottom: 1rem;
}

.site-footer p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.site-footer .creator-credits {
    margin-top: 1.5rem;
    font-weight: 600;
}

.site-footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #b45309;
    text-decoration: underline;
}

@media (min-width: 769px) {
    /* Compresión de la Cabecera de Unidad al quedar sticky */
    .lesson-header-bar.is-stuck {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    }
    .lesson-header-bar.is-stuck #libro-viewer-subtitle {
        max-height: 0;
        opacity: 0;
        margin: 0;
    }
    .lesson-header-bar.is-stuck #libro-viewer-title {
        font-size: 1.25rem;
    }

    /* Compresión de la Cabecera de Lección al quedar sticky */
    .book-lesson-header.is-stuck {
        padding-top: 0.5rem;
        padding-bottom: 0.25rem;
        margin-bottom: 0.5rem;
    }
    .book-lesson-header.is-stuck h4 {
        font-size: 1.1rem;
        margin-top: 0;
        margin-bottom: 0.25rem;
    }
}

/* ==========================================================================
   Sección de Perfil de Usuario (ID: 3d5ae909)
   ========================================================================== */

.profile-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.profile-avatar {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
}

.profile-info h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color var(--transition-fast);
}

.profile-info h3:hover {
    border-bottom-color: var(--text-muted);
}

.profile-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.chart-card h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-main);
}

.progress-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle-bg {
    stroke-linecap: round;
}

.progress-ring-circle {
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 0.5s ease-in-out;
    stroke-linecap: round;
}

.progress-percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.chart-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.trophy-room-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.trophy-room-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.trophy-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.trophy-item:hover {
    transform: scale(1.03);
    border-color: var(--text-muted);
}

.trophy-icon {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.trophy-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.trophy-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Estado Bloqueado de Trofeos */
.trophy-item.locked {
    opacity: 0.5;
}

.trophy-item.locked .trophy-icon {
    filter: grayscale(100%);
}

.trophy-item.locked .trophy-title {
    color: var(--text-muted);
}

.dev-toolbox-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.dev-toolbox-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.dev-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dev-buttons .btn {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.btn-reset {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    background: transparent;
}

.btn-reset:hover {
    background: var(--accent-light);
}

.btn-unlock {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
}

.btn-unlock:hover {
    background: var(--primary-dark);
}

@media (max-width: 600px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Modo Libro - Pantalla Completa y Sticky Headers (ID: 3d5ae909 - Tarea Libro)
   ========================================================================== */

/* Habilitar ancho de borde a borde para el contenedor del libro */
body.book-mode-active .content-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Redefinir la cabecera del visor del libro (Unit Header) como sticky */
body.book-mode-active .lesson-header-bar {
    position: sticky;
    top: 5rem;
    z-index: 100;
    background: var(--bg-color); /* Fondo sólido para ocultar el contenido inferior */
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 0;
    width: 100%;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-fast), padding var(--transition-fast), box-shadow var(--transition-fast);
}

/* Centrar el contenido de la cabecera dentro de un ancho máximo de lectura estándar (1200px) */
.lesson-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Centrar y limitar el ancho del cuerpo del libro para proteger la legibilidad */
body.book-mode-active .book-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    /* Ajuste de posición de adherencia (sticky top) para la barra lateral y cabeceras de lección individuales */
    body.book-mode-active .book-sidebar {
        top: 10rem !important;
        transition: top var(--transition-fast);
    }
    body.book-mode-active .book-lesson-header {
        top: 10rem !important;
        background: var(--bg-color);
        transition: top var(--transition-fast);
    }

    /* Cuando la cabecera de la unidad está comprimida (.is-stuck), reducimos la posición para evitar huecos */
    body.book-mode-active .lesson-header-bar.is-stuck ~ .book-container .book-sidebar {
        top: 8.5rem !important;
    }
    body.book-mode-active .lesson-header-bar.is-stuck ~ .book-container .book-lesson-header {
        top: 8.5rem !important;
    }
}

@media (max-width: 768px) {
    body.book-mode-active .lesson-header-bar {
        position: static;
        background: transparent;
        padding: 1rem 1.5rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
    }
    .lesson-header-container {
        padding: 0;
    }
}

/* Enlaces de Gramática en Lecciones */
.grammar-links-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.grammar-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(0, 106, 78, 0.05);
    border-color: rgba(0, 106, 78, 0.2);
    color: var(--primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.grammar-link-btn:hover {
    background-color: var(--primary);
    color: white;
}

