/* ============================================================
   Variables Globales (Diseño Premium)
   ============================================================ */
:root {
    --bg-primary: #080f1e;
    --bg-secondary: #111827;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-secondary: #38bdf8;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --color-info: #38bdf8;
    --color-tip: #34d399;
    --color-warning: #fbbf24;
    --color-analogy: #a78bfa;
    --color-success: #34d399;
    --color-error: #f87171;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 24px;
    --glass-border-hover: rgba(139, 92, 246, 0.45);
    --accent-liquid: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --text-dim: #94a3b8;
    --code-bg: #030712;
    --sidebar-bg: rgba(8, 15, 30, 0.85);
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --font-sans: 'Outfit', 'Inter', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --sidebar-width: 300px;
    --topbar-height: 68px;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   Reset & Global Scrollbar
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(139, 92, 246, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 90% 20%, rgba(56, 189, 248, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 60% 90%, rgba(52, 211, 153, 0.07) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.8;
    overflow-x: hidden;
    font-size: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.25;
    margin-bottom: 1rem;
}

/* ============================================================
   Glassmorphism
   ============================================================ */
.glass-panel {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--gl-blur) saturate(200%);
    backdrop-filter: var(--gl-blur) saturate(200%);
    border: 1px solid var(--glass-border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 20px 60px -10px rgba(0, 0, 0, 0.6),
        0 0 0 0 var(--accent-glow);
    border-radius: var(--gl-radius);
    position: relative;
    overflow: hidden;
    transition: border-color 0.35s var(--transition-smooth),
        box-shadow 0.35s var(--transition-smooth);
}

.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.glass-panel:hover {
    /* Brillo y sombras masivas DESACTIVADOS completamente para evitar
       efectos indeseados en contenedores grandes como #contentArea.
       Las interacciones se manejan granularmente! */
    border-color: var(--glass-border-hover);
}

/* Accent Controller */
.accent-controller {
    margin: 1rem;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.accent-options {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.accent-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.accent-dot:hover {
    transform: scale(1.2);
}

.accent-dot.active {
    border-color: white;
    box-shadow: 0 0 10px var(--gl-accent);
}

/* Color-specific classes for accent dots */
.accent-dot.accent-purple {
    background-color: #6d5dfc;
}

.accent-dot.accent-red {
    background-color: #e11d48;
}

.accent-dot.accent-green {
    background-color: #10b981;
}

.accent-dot.accent-orange {
    background-color: #f59e0b;
}

/* Focus states for keyboard accessibility */
.accent-dot:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.accent-dot:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 3px;
}

/* Animaciones de Interacción */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 var(--gl-accent);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

.nav-btn.completed.pulsed {
    position: relative;
    overflow: visible;
}

/* ============================================================
   Layout Principal
   ============================================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.35s var(--transition-smooth);
    border-right: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 0 20px 20px 0;
    background: var(--sidebar-bg);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, rgba(139, 92, 246, 0.05), transparent);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-info span {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
}

.progress-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label strong {
    color: var(--color-tip);
    font-size: 0.82rem;
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--color-tip));
    border-radius: 99px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Sidenav Active */
.sidebar.active {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
}

/* Botón de Copia Premium */
.code-block-container {
    position: relative;
    margin: 1.5rem 0;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.copy-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.copy-btn.copied {
    background: #10b981;
    color: white;
}

/* Animación Sincronización */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.syncing {
    display: inline-block;
    animation: spin 1s linear infinite;
    cursor: wait;
}

/* Buscador */
.search-container {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.search-input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Menú de navegación */
.nav-menu {
    list-style: none;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

.category-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.category-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding: 0.875rem 1.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.category-icon {
    font-size: 0.75rem;
    transition: transform 0.3s;
    opacity: 0.6;
}

.category-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
    background: rgba(0, 0, 0, 0.2);
    list-style: none;
}

.category-items.open {
    max-height: 600px;
}

.category-btn.open .category-icon {
    transform: rotate(180deg);
}

.nav-item {
    margin: 0;
}

.nav-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1rem 0.6rem 2rem;
    border-radius: 0 8px 8px 0;
    margin-right: 0.5rem;
    font-family: inherit;
    font-size: 0.855rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.22s var(--transition-smooth);
    border-left: 2px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-btn:hover {
    background: rgba(139, 92, 246, 0.07);
    color: var(--text-primary);
    transform: translateX(4px);
    border-left-color: rgba(139, 92, 246, 0.4);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.18) 0%, rgba(56, 189, 248, 0.06) 100%);
    color: var(--text-primary);
    border-left: 2px solid var(--accent-primary);
    font-weight: 600;
    box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.05);
}

.nav-btn .nav-btn-icons {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.completed-check {
    display: none;
    color: #10b981; /* Esmeralda neón */
    font-size: 0.9rem;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    margin-right: 4px;
}

.completed-check.visible,
.nav-btn.completed .completed-check {
    display: inline-block;
    animation: bounceIn 0.5s var(--transition-spring);
}

.diff-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.7;
}

.diff-dot.beginner {
    background: var(--color-tip);
}

.diff-dot.intermediate {
    background: var(--color-warning);
}

.diff-dot.advanced {
    background: var(--color-error);
}

/* ============================================================
   Área Principal
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 1rem;
    background: rgba(8, 15, 30, 0.7);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
}

.menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

#pageTitle {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.7rem;
    border-radius: 99px;
    flex-shrink: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.topbar-badge.beginner {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-tip);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.topbar-badge.intermediate {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.topbar-badge.advanced {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.content-area {
    margin: 1.5rem;
    border-radius: 20px;
    padding: 2.5rem;
    flex: 1;
    box-sizing: border-box;
    align-self: stretch;
    box-shadow: var(--gl-shadow);
}

/* ============================================================
   Bento Grid & Masterclass Components
   ============================================================ */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.bento-card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    height: 100%;
    background: var(--gl-bg);
    -webkit-backdrop-filter: var(--gl-blur);
    backdrop-filter: var(--gl-blur);
    border: var(--gl-border);
    border-radius: var(--gl-radius);
    transition: all 0.4s var(--transition-smooth);
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Roadmap Clickable Cards */
.roadmap-card {
    cursor: pointer;
    transition: all 0.4s var(--transition-spring);
    position: relative;
    overflow: hidden;
}

.roadmap-card:hover {
    transform: translateY(-8px) scale(1.05);
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

.roadmap-card:active {
    transform: scale(0.98);
}

.roadmap-card::after {
    content: 'Ver Módulo →';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: bold;
    color: var(--accent-primary);
    transition: bottom 0.3s ease;
    opacity: 0;
}

.roadmap-card:hover::after {
    bottom: 8px;
    opacity: 1;
}

.bento-card.large {
    grid-column: 1;
}

.bento-card.small {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.bento-sidebar {
    display: flex;
    flex-direction: column;
}

/* Project Step Box */
.project-step-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-left: 4px solid var(--accent-primary);
    background: rgba(139, 92, 246, 0.05);
}

.step-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-liquid);
    color: white;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.copy-btn.mini {
    position: static;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
}

/* Toast & Notifications */
.glass-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border-hover);
    padding: 1rem 2rem;
    border-radius: 99px;
    color: white;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 3000;
}

/* Responsive Masterclass */
@media (max-width: 1100px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-sidebar {
        order: -1;
    }
}

/* Navegación entre lecciones */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 2rem 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    gap: 1rem;
}

.lesson-nav-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    padding: 0.75rem 1.1rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    max-width: 46%;
    min-width: 120px;
    overflow: hidden;
}

.lesson-nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lesson-nav-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.5);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.3);
}

.lesson-nav-btn:hover::before {
    opacity: 1;
}

.lesson-nav-btn.next-btn {
    text-align: right;
}

.lesson-nav-btn.next-btn:hover {
    transform: translateY(-3px) scale(1.02);
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* ============================================================
   Animaciones
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes latido {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

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

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

@keyframes popIn {
    from {
        transform: scale(0.92);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Animaciones Masterclass --- */
.confetti-particle {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(105vh) rotate(720deg);
        opacity: 0;
    }
}

.animate-reveal {
    animation: reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(20px); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Accent Dots Polish */
.accent-dot {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.accent-dot:hover {
    transform: scale(1.3);
    box-shadow: 0 0 15px var(--accent-primary);
}

.accent-dot.active {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ─── Sistema de Notificaciones Antigravity ─── */
.antigravity-notify {
    position: fixed;
    top: 30px;
    right: -400px;
    width: 320px;
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 15px;
    z-index: 20000;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.antigravity-notify.show {
    right: 30px;
}

.antigravity-notify.success {
    border-left: 4px solid var(--gl-accent);
}

.notify-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
}

.notify-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gl-accent);
    margin-bottom: 4px;
}

.notify-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* ─── Animaciones de Éxito ─── */
.success-anim {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   Tipografía de contenido
   ============================================================ */
.content-area h2 {
    font-size: 1.95rem;
    color: var(--text-primary);
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary) 60%, rgba(167, 139, 250, 0.8));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-area h2:first-child {
    margin-top: 0;
}

.content-area h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.content-area h4 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.content-area p {
    margin-bottom: 1.3rem;
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.9;
}

.content-area strong {
    color: var(--text-primary);
    font-weight: 600;
}

.content-area ul,
.content-area ol {
    margin: 0 0 1.3rem 1.25rem;
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.9;
}

.content-area li {
    margin-bottom: 0.35rem;
    padding-left: 0.25rem;
}

/* ============================================================
   Bloques de Código
   ============================================================ */
pre {
    background: var(--code-bg);
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.75rem 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

pre::before {
    content: '';
    display: block;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px 12px 0 0;
}

pre code {
    display: block;
    padding: 1.25rem 1.5rem;
    color: #d1d9e0;
    font-size: 0.88rem;
    line-height: 1.75;
    text-align: justify;
    hyphens: auto;
}

.copy-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.copy-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--text-primary);
}

.copy-btn.copied {
    background: rgba(52, 211, 153, 0.2);
    color: var(--color-tip);
    border-color: rgba(52, 211, 153, 0.4);
}

code {
    font-family: var(--font-mono);
    color: #c4b5fd;
    font-size: 0.88rem;
    background: rgba(139, 92, 246, 0.1);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

pre code {
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
    color: #d1d9e0;
    font-size: 0.88rem;
}

/* ============================================================
   Botones
   ============================================================ */
.btn-primary {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.6rem;
    border-radius: 99px;
    /* Pill shape */
    font-family: var(--font-sans);
    font-size: 0.975rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 99px;
    padding: 2px;
    /* Border thickness */
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: borderFlow 3s linear infinite;
}

@keyframes borderFlow {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.3));
}

.btn-primary:hover::before {
    transform: translateX(200%);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 5px 10px -5px rgba(139, 92, 246, 0.5);
}

/* ============================================================
   Cajas Pedagógicas
   ============================================================ */

/* Resumen de lección */
.summary-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 14px;
    padding: 1.75rem;
    margin: 0 0 2.5rem;
    animation: popIn 0.4s ease forwards;
}

.summary-box h4 {
    color: var(--accent-primary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin: 0 0 1rem;
}

.summary-box ul {
    margin: 0 0 0 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.summary-box li {
    margin-bottom: 0.35rem;
}

.lesson-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.difficulty-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.difficulty-badge.beginner {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-tip);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.difficulty-badge.intermediate {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.difficulty-badge.advanced {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Caja Concepto Clave (azul) */
.info-box {
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-left: 4px solid var(--color-info);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
}

.info-box .box-title {
    color: var(--color-info);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.info-box p,
.info-box li {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.info-box ul {
    margin: 0.5rem 0 0 1.25rem;
}

/* Caja Consejo (verde) */
.tip-box {
    background: rgba(34, 197, 94, 0.07);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-left: 4px solid var(--color-tip);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
}

.tip-box .box-title {
    color: var(--color-tip);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tip-box p,
.tip-box li {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.tip-box ul {
    margin: 0.5rem 0 0 1.25rem;
}

/* Caja Advertencia (naranja) */
.warning-box {
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid var(--color-warning);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
}

.warning-box .box-title {
    color: var(--color-warning);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.warning-box p,
.warning-box li {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.warning-box ul {
    margin: 0.5rem 0 0 1.25rem;
}

/* Caja Analogía (violeta) */
.analogy-box {
    background: rgba(139, 92, 246, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-left: 4px solid var(--color-analogy);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
}

.analogy-box .box-title {
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.analogy-box p,
.analogy-box li {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

/* ============================================================
   Ejercicios Interactivos
   ============================================================ */
.exercise-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--accent-secondary);
    padding: 2rem;
    border-radius: 14px;
    margin: 2.5rem 0;
}

.exercise-box h3 {
    color: var(--accent-secondary);
    margin-top: 0;
    font-size: 1.1rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.input-group select {
    font-family: var(--font-sans);
    cursor: pointer;
}

.output-area {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    min-height: 80px;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: var(--text-secondary);
}

.success-anim {
    animation: successPulse 0.5s ease;
    border-color: #22c55e !important;
}

.error-anim {
    animation: shake 0.4s ease;
    border-color: #ef4444 !important;
}

/* ============================================================
   Sistema de Quiz
   ============================================================ */
.quiz-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0 1rem;
    animation: slideDown 0.4s ease;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quiz-header h3 {
    color: var(--accent-primary);
    margin: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-progress-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.quiz-question-block {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideDown 0.3s ease;
}

.quiz-question-block:last-of-type {
    border-bottom: none;
}

.quiz-question-num {
    font-size: 0.72rem;
    color: var(--accent-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.5rem;
}

.quiz-question-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.55;
    text-align: justify;
}

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

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: left;
    transition: all 0.2s ease;
    line-height: 1.5;
    width: 100%;
}

.quiz-option:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.12);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateX(6px);
    box-shadow: 4px 0 15px rgba(139, 92, 246, 0.1);
}

.option-letter {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    /* Square-ish with smooth corners for a modern look */
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-secondary);
    transition: all 0.25s var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-option.correct {
    background: rgba(34, 197, 94, 0.12);
    border-color: var(--color-tip);
    color: var(--text-primary);
    cursor: default;
}

.quiz-option.correct .option-letter {
    background: var(--color-tip);
    color: white;
}

.quiz-option.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-error);
    color: var(--text-secondary);
    cursor: default;
}

.quiz-option.incorrect .option-letter {
    background: var(--color-error);
    color: white;
}

.quiz-option:disabled {
    cursor: default;
    transform: none !important;
}

.quiz-feedback {
    margin-top: 0.875rem;
    padding: 0.875rem 1.1rem;
    border-radius: 8px;
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: justify;
    animation: slideDown 0.25s ease;
    display: none;
}

.quiz-feedback.correct {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #bbf7d0;
    display: block;
}

.quiz-feedback.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fecaca;
    display: block;
}

.quiz-feedback strong {
    color: inherit;
}

.quiz-final-score {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    animation: popIn 0.4s ease;
}

.quiz-final-score.perfect {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.quiz-final-score.good {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.quiz-final-score.needs-work {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.quiz-score-number {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.quiz-final-score.perfect .quiz-score-number {
    color: var(--color-tip);
}

.quiz-final-score.good .quiz-score-number {
    color: var(--color-info);
}

.quiz-final-score.needs-work .quiz-score-number {
    color: var(--color-warning);
}

.quiz-score-msg {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.quiz-retry-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-retry-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-primary);
}

/* ============================================================
   Tabs de Código (HTML / Jinja / Output)
   ============================================================ */
.code-tabs {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    margin: 1.75rem 0;
    background: var(--code-bg);
}

.code-tabs-header {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
}

.code-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.7rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.code-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.code-tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.08);
}

.code-tab-content {
    display: none;
    padding: 1.25rem;
}

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

.code-tab-content pre {
    margin: 0;
    border: none;
    background: transparent;
    padding: 0;
}

/* ============================================================
   Preview Panel Jinja
   ============================================================ */
.jinja-preview {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.06), rgba(20, 184, 166, 0.04));
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.75rem 0;
    position: relative;
}

.jinja-preview::before {
    content: '⚡ Jinja Output';
    position: absolute;
    top: -0.65rem;
    left: 1rem;
    background: var(--bg-secondary);
    padding: 0 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #06b6d4;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.jinja-preview-output {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: #5eead4;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================================
   Highlights de Sintaxis Jinja (Inline)
   ============================================================ */
.jinja-var {
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.jinja-tag {
    background: rgba(251, 146, 60, 0.12);
    color: #fb923c;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.jinja-comment {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-style: italic;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* ============================================================
   Panel de Contexto JSON
   ============================================================ */
.context-panel {
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    position: relative;
}

.context-panel::before {
    content: '📦 Contexto (Variables)';
    position: absolute;
    top: -0.65rem;
    left: 1rem;
    background: var(--bg-secondary);
    padding: 0 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.context-panel pre {
    margin: 0;
    border: none;
    background: transparent;
    padding: 0;
}

.context-panel code {
    color: #c4b5fd;
    font-size: 0.88rem;
}

/* ============================================================
   Jinja Interactive Playground
   ============================================================ */
.jinja-playground {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.75rem 0;
}

.jinja-playground-input,
.jinja-playground-output {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.jinja-playground-label {
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--glass-border);
}

.jinja-playground-input .jinja-playground-label {
    background: rgba(251, 146, 60, 0.08);
    color: #fb923c;
}

.jinja-playground-output .jinja-playground-label {
    background: rgba(6, 182, 212, 0.08);
    color: #06b6d4;
}

.jinja-playground textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: var(--code-bg);
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    resize: vertical;
    outline: none;
}

.jinja-playground-result {
    padding: 1rem;
    background: var(--code-bg);
    min-height: 120px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: #5eead4;
    white-space: pre-wrap;
    line-height: 1.6;
}

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

/* ============================================================
   Tabla de Referencia estilizada
   ============================================================ */
.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.reference-table thead tr {
    background: rgba(139, 92, 246, 0.12);
}

.reference-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.reference-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.reference-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.reference-table code {
    font-size: 0.85rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }

    .menu-btn {
        display: block;
    }

    .content-area {
        margin: 1rem;
        padding: 1.25rem;
    }

    .lesson-nav {
        margin: 1rem 1.25rem 1.25rem;
    }
}

@media (max-width: 576px) {
    .content-area {
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 12px;
    }

    .topbar {
        padding: 0 1.25rem;
        height: 64px;
    }

    .content-area h2 {
        font-size: 1.65rem;
    }

    .lesson-nav {
        flex-direction: column;
        align-items: stretch;
        margin: 1rem 0.75rem;
    }

    .lesson-nav-btn {
        max-width: 100%;
    }

    .quiz-container {
        padding: 1.25rem;
    }
}

/* ============================================================
   Splash Screen De Carga
   ============================================================ */
.initial-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
    font-family: 'Inter', sans-serif;
}

.splash-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

.splash-title {
    color: white;
    font-weight: 700;
    letter-spacing: -1px;
    margin: 0;
}

.splash-accent {
    color: #8b5cf6;
}

.splash-text {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Indicador de Sincronización ─── */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-status {
    font-size: 1.2rem;
    cursor: help;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.sync-status.syncing {
    animation: syncRotate 2s infinite linear;
    color: var(--gl-accent);
}

.sync-status.synced {
    color: #10b981;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

/* ─── HUD de Estabilidad ─── */
.stability-hud {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stability-hud:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.hud-stability-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.hud-stability-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
}

.stability-fill {
    height: 100%;
    width: 100%; /* Valor inicial movido de inline style */
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(58, 123, 213, 0.4);
}

.stability-fill.critical-stability {
    box-shadow: 0 0 15px rgba(255, 75, 43, 0.6);
}

.hud-stability-value {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    font-family: var(--font-mono);
}

@keyframes syncRotate {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.7;
    }

    50% {
        transform: rotate(180deg) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: rotate(360deg) scale(1);
        opacity: 0.7;
    }
}

/* ============================================================
   SECCIÓN PREMIUM: Reto Interactivo Didáctico
   ============================================================ */

/* --- Contenedor principal del módulo de pruebas/reto --- */
.test-guide-box {
    margin-top: 3rem;
    border-radius: 20px;
    overflow: hidden;
    animation: slideUp 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* --- Header del test guide --- */
.test-guide-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(135deg, rgba(56,189,248,0.07) 0%, transparent 60%);
}

.test-guide-header .tgh-icon {
    font-size: 1.65rem;
    filter: drop-shadow(0 0 8px rgba(56,189,248,0.5));
}

.test-guide-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-sans);
    background: linear-gradient(90deg, #e2e8f0 30%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.test-guide-body {
    padding: 1.5rem 1.75rem;
}

/* --- Guía de pasos de testing --- */
.test-guide-steps {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
}

.test-guide-steps ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.test-guide-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s, border-color 0.2s;
}

.test-guide-steps li:hover {
    background: rgba(56,189,248,0.05);
    border-color: rgba(56,189,248,0.2);
}

.test-guide-steps li::before {
    content: '›';
    color: var(--accent-secondary);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    flex-shrink: 0;
}

/* --- Ejercicio Guiado Premium --- */
.guided-exercise-section {
    margin-top: 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: linear-gradient(135deg, rgba(139,92,246,0.07) 0%, rgba(59,130,246,0.04) 100%);
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.xp-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    width: fit-content;
}

.xp-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.quiz-container {
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.quiz-opt {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-opt:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.xp-gain-bubble {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent-liquid);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 800;
}

.guided-exercise-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(139,92,246,0.15);
    background: rgba(139,92,246,0.08);
}

.guided-exercise-header .ge-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 6px rgba(139,92,246,0.6));
}

.guided-exercise-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.guided-exercise-body {
    padding: 1.1rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ─── Sort Game Styles ────── */
.sort-game-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sort-items-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    min-height: 80px;
}

.sort-item {
    padding: 0.5rem 1rem;
    background: rgba(var(--gl-accent-rgb, 99, 102, 241), 0.1);
    border: 1px solid rgba(var(--gl-accent-rgb, 99, 102, 241), 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
}

.sort-item:hover {
    background: rgba(var(--gl-accent-rgb, 99, 102, 241), 0.2);
    transform: translateY(-2px);
}

.sort-item.active {
    background: var(--gl-accent);
    color: white;
    box-shadow: 0 0 15px rgba(var(--gl-accent-rgb, 99, 102, 241), 0.3);
}

.sort-item.matched {
    cursor: default;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10B981;
}

.sort-item.error {
    animation: shake 0.4s ease;
    background: rgba(239, 68, 68, 0.2);
}

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

.sort-target-zone {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    min-height: 120px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-target-zone:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--gl-accent);
}

.zone-label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.zone-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* --- Reto Interactivo (Didactic Game) PREMIUM --- */
.didactic-game-section {
    margin-top: 1.25rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, rgba(109,78,242,0.12) 0%, rgba(56,189,248,0.07) 100%);
    box-shadow:
        0 0 0 1px rgba(139,92,246,0.15) inset,
        0 10px 40px rgba(0,0,0,0.3),
        0 0 60px rgba(109,78,242,0.08);
    position: relative;
}

/* Efecto partícula/brillo decorativo */
.didactic-game-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.didactic-game-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(56,189,248,0.15) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.didactic-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid rgba(139,92,246,0.2);
    background: linear-gradient(90deg, rgba(109,78,242,0.18) 0%, rgba(56,189,248,0.08) 100%);
    position: relative;
    z-index: 1;
}

.didactic-game-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.game-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139,92,246,0.4), rgba(59,130,246,0.3));
    border: 1px solid rgba(139,92,246,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 16px rgba(109,78,242,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    animation: gameBadgePulse 3s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes gameBadgePulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(109,78,242,0.4), inset 0 1px 0 rgba(255,255,255,0.15); }
    50%       { box-shadow: 0 4px 24px rgba(109,78,242,0.7), inset 0 1px 0 rgba(255,255,255,0.2); }
}

.game-title-group h4 {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-sans);
    color: #e2e8f0;
    letter-spacing: -0.01em;
}

.game-title-group .game-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #a78bfa;
}

.game-badge-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    background: rgba(139,92,246,0.2);
    border: 1px solid rgba(139,92,246,0.4);
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    flex-shrink: 0;
}

.didactic-game-body {
    padding: 1.35rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* Matching pairs dentro del juego (Interactivo 2.0) */
.game-pairs-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem 1rem;
    margin-top: 1.25rem;
    perspective: 1000px;
}

@media (max-width: 768px) {
    .game-pairs-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .matching-col {
        width: 100%;
    }
    .game-pair-arrow {
        display: none;
    }
}

.matching-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}


/* Base de los items seleccionables */
.game-pair-item, .game-pair-desc {
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    min-height: 0;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.game-pair-item {
    font-family: var(--font-mono);
    color: var(--gl-accent);
    justify-content: center;
    text-align: center;
    font-weight: 600;
    border-color: rgba(168, 85, 247, 0.2);
    white-space: pre-wrap;
    word-break: break-all;
}

.game-pair-desc {
    color: var(--text-secondary);
    border-color: rgba(56, 189, 248, 0.15);
    line-height: 1.5;
    word-break: break-word;
    text-align: left;
}


/* Hovers */
.game-pair-item:hover, .game-pair-desc:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.game-pair-item:hover { border-color: rgba(139, 92, 246, 0.5); }
.game-pair-desc:hover { border-color: rgba(56, 189, 248, 0.4); }

/* Seleccionado */
.game-pair-item.selected, .game-pair-desc.selected {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--gl-accent);
    color: white;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
    z-index: 2;
}

/* Emparejado (Correcto) */
.game-pair-item.matched, .game-pair-desc.matched {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    color: #10b981;
    cursor: default;
    pointer-events: none;
    opacity: 0.75;
    box-shadow: none;
    transform: scale(0.98);
}

.game-pair-item.matched::after, .game-pair-desc.matched::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 900;
}

/* Error (Animación) */
.game-pair-item.error, .game-pair-desc.error {
    animation: matchErrorShake 0.4s ease;
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

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

.game-pair-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    font-weight: 300;
}

/* --- Entregables Premium --- */
.deliverables-section {
    margin-top: 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(16,185,129,0.3);
    background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, transparent 100%);
}

.deliverables-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(16,185,129,0.12);
    background: rgba(16,185,129,0.07);
}

.deliverables-header .del-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(16,185,129,0.5));
}

.deliverables-header h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-tip);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.deliverables-list {
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.deliverables-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.deliverables-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(16,185,129,0.04);
    border: 1px solid rgba(16,185,129,0.08);
    transition: background 0.2s, border-color 0.2s;
}

.deliverables-list li:hover {
    background: rgba(16,185,129,0.09);
    border-color: rgba(16,185,129,0.25);
}

.deliverables-list li::before {
    content: '✓';
    color: var(--color-tip);
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* --- Pro Tip footer --- */
.pro-tip-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(56,189,248,0.05);
    border: 1px solid rgba(56,189,248,0.12);
    font-size: 0.85rem;
    color: var(--accent-secondary);
}

.pro-tip-footer svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* ============================================================
   SISTEMA DE PUNTUACIÓN — GlassLearn Scoring v1.0
   ============================================================ */

/* ─── HUD de Puntos (Topbar) ──────────────────────────────── */
.score-hud {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(var(--hud-color, 34, 197, 94), 0.08);
    border: 1px solid rgba(var(--hud-color, 34, 197, 94), 0.2);
    border-radius: 99px;
    padding: 0.3rem 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    flex-shrink: 0;
    -webkit-user-select: none;
    user-select: none;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.score-hud:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.hud-points-icon { font-size: 0.85rem; }
.hud-points-value { font-weight: 800; color: #a78bfa; font-size: 0.9rem; }
.hud-points-label { color: var(--text-secondary); font-size: 0.72rem; }
.hud-level-sep { color: var(--text-secondary); opacity: 0.4; }
.hud-level-emoji { font-size: 0.85rem; }
.hud-level-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.78rem;
}


/* ─── Badge de puntos en actividades ─────────────────────── */
.activity-pts-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 0.03em;
    margin-left: auto;
}

.activity-pts-badge.game {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

/* ─── Fila de botón completar ─────────────────────────────── */
.activity-complete-row {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.activity-complete-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    background: transparent;
    border: 1px dashed rgba(139, 92, 246, 0.45);
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.activity-complete-btn:hover:not(.done) {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.6);
    color: #a78bfa;
    transform: translateY(-1px);
}

.activity-complete-btn.done {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
    cursor: default;
}

/* ─── Entregables como checklist ────────────────────────────── */
.deliverables-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.deliverable-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
}

.deliverable-item:hover:not(.done) {
    background: rgba(139, 92, 246, 0.07);
    border-color: rgba(139, 92, 246, 0.2);
}

.deliverable-item.done {
    background: rgba(52, 211, 153, 0.06);
    border-color: rgba(52, 211, 153, 0.2);
    opacity: 0.85;
}

.del-check {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ─── Quiz Score Chip ─────────────────────────────────────── */
.quiz-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quiz-score-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #a78bfa;
    transition: all 0.3s ease;
}

/* ─── Quiz Final Actions ──────────────────────────────────── */
.quiz-final-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.quiz-level-btn {
    padding: 0.55rem 1.4rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(56, 189, 248, 0.12));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-level-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(56, 189, 248, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

/* ─── Quiz Bonus Chip ─────────────────────────────────────── */
.quiz-bonus-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 1rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fbbf24;
    margin: 0.5rem auto 0;
    animation: popIn 0.4s var(--transition-spring);
}

/* ─── Quiz Level Chip ─────────────────────────────────────── */
.quiz-level-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #a78bfa;
    margin: 0.5rem auto 0;
}

/* ─── Animación Puntos Flotantes ──────────────────────────── */
@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(-55px) scale(1.15); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.9); }
}

.points-float {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    font-size: 1rem;
    font-weight: 800;
    color: #a78bfa;
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.8);
    animation: floatUp 1.5s ease-out forwards;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
}

/* ─── Modal de Clasificación de Nivel ─────────────────────── */
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.level-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.level-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.level-modal {
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    border-radius: 24px !important;
    animation: modalSlideUp 0.4s var(--transition-spring) both;
}

.level-modal-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.level-modal-close:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* Header del modal */
.level-modal-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.25rem;
    background: linear-gradient(135deg,
        rgba(var(--level-color, 139,92,246), 0.12),
        rgba(var(--level-color, 139,92,246), 0.04));
    border: 1px solid rgba(var(--level-color, 139,92,246), 0.2);
    border-radius: 16px;
    margin-bottom: 1.25rem;
}

.level-big-emoji {
    font-size: 2.8rem;
    line-height: 1;
    flex-shrink: 0;
}

.level-modal-titles {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.level-modal-sublabel {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
}

.level-modal-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    background: linear-gradient(135deg, #a78bfa, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.level-modal-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.level-total-pts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.ltp-num {
    font-size: 2rem;
    font-weight: 900;
    color: #a78bfa;
    line-height: 1;
}

.ltp-unit {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Descripción */
.level-description {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-style: italic;
    text-align: center;
    padding: 0 0.5rem;
}

/* Barra de progreso al siguiente nivel */
.level-progress-section {
    margin-bottom: 1.5rem;
}

.lps-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.lps-bar-track {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
}

.lps-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 1s ease;
}

.lps-remaining {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    display: block;
    text-align: right;
}

.level-max-reached {
    padding: 0.75rem;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fbbf24;
    background: rgba(251,191,36,0.08);
    border-radius: 10px;
    border: 1px solid rgba(251,191,36,0.2);
    margin-bottom: 1.5rem;
}

/* Tiers section */
.level-tiers-section h4,
.level-breakdown-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.level-tiers-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.level-tier {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    border: 1px solid transparent;
    opacity: 0.4;
    transition: all 0.2s;
}

.level-tier.unlocked {
    opacity: 0.7;
}

.level-tier.active {
    opacity: 1;
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.35);
}

.tier-emoji { font-size: 1.3rem; width: 2rem; text-align: center; }

.tier-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.tier-info strong {
    font-size: 0.88rem;
    color: var(--text-primary);
}

.tier-info span {
    font-size: 0.73rem;
    color: var(--text-secondary);
}

.tier-badge-active {
    font-size: 0.65rem;
    font-weight: 800;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 0.18rem 0.55rem;
    border-radius: 99px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Desglose */
.level-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.level-breakdown-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 0.82rem;
}

.lbr-icon { font-size: 1rem; }
.lbr-label { flex: 1; color: var(--text-secondary); }
.lbr-pts { font-weight: 700; color: #a78bfa; }

/* Tip footer */
.level-tip-footer {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem;
    background: rgba(56,189,248,0.05);
    border: 1px solid rgba(56,189,248,0.12);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--accent-secondary);
    margin-bottom: 1.25rem;
}

/* Acciones del modal */
.level-modal-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.level-action-btn {
    flex: 1;
    min-width: 130px;
    padding: 0.65rem 1.2rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.level-action-btn.primary {
    background: linear-gradient(135deg, var(--accent-primary), #38bdf8);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.level-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45);
}

.level-action-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: rgba(255,255,255,0.12);
}

.level-action-btn.secondary:hover {
    background: rgba(255,60,60,0.08);
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
}

/* ─── Guided Exercise Header flex ─────────────────────────── */
.guided-exercise-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.deliverables-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* ─── Sistema de Notificaciones Antigravity ─── */
.antigravity-notify {
    position: fixed;
    top: 30px;
    right: -400px;
    width: 320px;
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 15px;
    z-index: 20000;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.antigravity-notify.show {
    right: 30px;
}

.antigravity-notify.success {
    border-left: 4px solid var(--gl-accent);
}

.antigravity-notify.info {
    border-left: 4px solid var(--color-info);
}

.antigravity-notify.error {
    border-left: 4px solid var(--color-error);
}

.notify-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
}

.notify-body {
    flex: 1;
}

.notify-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.notify-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* ============================================================
   Antigravity Control Center (Dashboard)
   ============================================================ */
.cas-dashboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 18, 0.4);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--transition-smooth);
}

.cas-dashboard-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cas-dashboard-panel {
    width: 90%;
    max-width: 600px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(32px) saturate(210%);
    backdrop-filter: blur(32px) saturate(210%);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s var(--transition-spring);
    box-shadow: 
        0 30px 60px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(139, 92, 246, 0.1);
}

body {
    display: flex;
    background: #020617;
    color: #f8fafc;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Elite */
.sidebar-elite {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    border-radius: 0 24px 24px 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.nav-label {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    margin: 24px 0 12px 12px;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-dim);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 12px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--glass-border);
}

.nav-item i { font-size: 18px; }

/* Main Content Layout */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-elite {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-border);
    border-radius: 0 24px 24px 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}


.sidebar-header span {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

/* Bento Card Internals */
.bento-card .card-header {
    margin-bottom: 20px;
}

.bento-card .badge {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary {
    background: var(--accent-liquid);
    border: none;
}

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

.cas-dashboard-overlay.open .cas-dashboard-panel {
    transform: translateY(0) scale(1);
}

.cas-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.cas-dash-titles h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #a78bfa 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cas-dash-titles p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.cas-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cas-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    transform: rotate(90deg);
}

/* Metrics Grid */
.cas-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.cas-metric-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

.cas-metric-card:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
    transform: translateY(-4px);
}

.metric-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.metric-unit {
    font-size: 0.8rem;
    margin-left: 2px;
    opacity: 0.7;
}

/* LogicGuard Status */
.cas-guard-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(56, 189, 248, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.guard-icon-container {
    width: 50px;
    height: 50px;
    background: var(--accent-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.4);
    animation: guardPulse 2s infinite ease-in-out;
}

@keyframes guardPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 16px rgba(139, 92, 246, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6); }
}

.guard-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.guard-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.guard-status-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
}

@media (max-width: 640px) {
    .cas-metrics-grid {
        grid-template-columns: 1fr;
    }
    .cas-dashboard-panel {
        padding: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════
   CONTENT BODY - Estilos para el contenido pedagógico
   ═══════════════════════════════════════════════════════ */
.content-body {
    color: var(--text-primary);
    line-height: 1.75;
    font-size: 1rem;
    padding: 0.25rem 0;
}

.content-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.75rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.content-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary, #8b5cf6);
    margin: 1.25rem 0 0.5rem;
}

.content-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary, rgba(255,255,255,0.8));
}

.content-body ul,
.content-body ol {
    margin: 0.75rem 0 1rem 1.5rem;
    color: var(--text-secondary, rgba(255,255,255,0.8));
}

.content-body li {
    margin-bottom: 0.5rem;
}

.content-body code {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.875em;
}

.content-body pre {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.content-body pre code {
    background: transparent;
    color: #e2e8f0;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.content-body .motivational-quote-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.content-body .motivational-quote-card .quote-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.content-body .motivational-quote-card .quote-text {
    font-style: italic;
    color: var(--text-secondary, rgba(255,255,255,0.8));
    font-size: 0.95rem;
}

.content-body .info-box,
.content-body .warning-box,
.content-body .analogy-box {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.content-body .info-box {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    color: var(--text-secondary);
}

.content-body .warning-box {
    background: rgba(234, 179, 8, 0.1);
    border-left: 4px solid #eab308;
    color: var(--text-secondary);
}

.content-body .analogy-box {
    background: rgba(34, 197, 94, 0.08);
    border-left: 4px solid #22c55e;
    color: var(--text-secondary);
}

.content-body .box-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.content-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.25rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.content-body th {
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
    padding: 10px;
    text-align: left;
}

.content-body td {
    padding: 8px 10px;
}

.bento-card.large { grid-column: span 2; }
.bento-card .card-footer { margin-top: 1.5rem; }

/* Quiz enhancements */
.quiz-container { margin-top: 1.5rem; }
.quiz-container h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.quiz-container p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.quiz-opt {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}
.quiz-opt:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--text-primary);
}
.quiz-opt:disabled { opacity: 0.6; cursor: not-allowed; }
.text-success { color: #4ade80; }
.text-danger  { color: #f87171; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

/* ============================================================
   Botón Volver al Inicio (GlassLearn)
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s var(--transition-spring);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-primary);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 0 25px var(--accent-glow);
}

.back-to-top i {
    transition: transform 0.3s var(--transition-spring);
}

.back-to-top:hover i {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}