/* css/estilo.css - Optimizado para GPU y renderizado rápido */

:root {
    /* Paleta Kanye / Minimalista Beige */
    --c-bg: #FAF8F5; /* Fondo crudo/beige */
    --c-bg-alt: #F1EFEA; /* Beige ligeramente más oscuro para paneles */
    --c-text-main: #1C1C1C; /* Casi negro para máximo contraste pero suave */
    --c-text-muted: #737373; /* Gris medio */
    --c-accent: #D4C9A8; /* Tono dorado/beige oscuro */
    --c-accent-dark: #A59B7E;
    
    /* Variables de UI */
    --sidebar-width: 140px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.05);


    /* Switch Variables */
    --light-switch: 95;
    --light-switch-border: 75;
    --light-switch-top: 75;
    --light-switch-bottom: 95;
    --shadow-opacity: 0.2;

    /* Background parallax */
    --bg-x: 0px;
    --bg-y: 0px;
}

body.dark-mode, html.dark-mode-preload body {
    --c-bg: #1B1B1B; 
    --c-bg-alt: #222222; 
    --c-text-main: #F1EFEA; 
    --c-text-muted: #888888; 
    
    --light-switch: 15;
    --light-switch-border: 10;
    --light-switch-top: 15;
    --light-switch-bottom: 25;
    --shadow-opacity: 0;
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.3);
}

/* ==========================================
   ANTI-FOUC (Carga Directa)
   ========================================== */
html.direct-logica #intro-screen {
    display: none !important;
}

html.direct-logica #main-app {
    display: grid !important; 
    opacity: 0;
    animation: fadeAppIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

html.direct-logica #global-header {
    opacity: 0;
    pointer-events: auto;
    animation: fadeAppIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

html.direct-logica #global-header.hidden-element {
    display: flex !important; /* Overriden so animation takes place */
}

@keyframes fadeAppIn {
    to { opacity: 1; }
}

/* Reset Extremo */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--c-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* Control total del layout */
    width: 100vw;
    height: 100vh;
    
    /* Subtle plant background */
    background-color: var(--c-bg);
    background-image: url("https://static.vecteezy.com/system/resources/previews/056/652/082/non_2x/hand-drawn-white-flower-seamless-pattern-floral-repeating-wallpaper-for-textile-design-fabric-print-wrapping-paper-cute-daisy-flowers-on-blue-background-repeated-ditsy-texture-vector.jpg");
    background-size: 300px;
    background-repeat: repeat;
    background-position: calc(50% + var(--bg-x)) calc(50% + var(--bg-y));
}

/* Pseudo-element to control background opacity independently */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--c-bg);
    opacity: 0.95; /* Makes the pattern almost invisible */
    z-index: -1;
    pointer-events: none;
}

/* ==========================================
   SISTEMA DE PANTALLAS (Views)
   ========================================== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: opacity, transform;
}

.hidden {
    display: none !important;
}

/* Global Header */
.global-header {
    transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}

.hidden-element {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-20px) scale(0.95);
    filter: blur(10px);
}

.icon-btn.top-nav {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin: 0;
    transition: all var(--transition-fast);
}

.icon-btn.top-nav:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    position: relative;
}

h1#header-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -2px;
    color: rgba(0, 0, 0, 0.06); /* Agujero sutil en modo claro */
}

body.dark-mode h1#header-text {
    color: rgba(255, 255, 255, 0.06); /* Agujero sutil en modo oscuro */
}

h1#intro-text {
    font-family: 'Outfit', sans-serif;
    font-size: 5rem;
    font-weight: 400;
    letter-spacing: -2px;
    margin-bottom: 0; /* Eliminado el margin-bottom para un centrado perfecto */
    will-change: opacity, transform;
    z-index: 2;
}

#intro-reveal {
    position: absolute;
    top: calc(50% + 60px); /* Situado exactamente debajo del texto que está en el 50% */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    will-change: opacity, transform;
    z-index: 1;
}

button#logic-btn {
    appearance: none;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    background: transparent;
    color: var(--c-text-main);
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
}

button#logic-btn:hover {
    color: var(--c-accent-dark);
    border-color: var(--c-accent-dark);
}

body.dark-mode button#logic-btn {
    border-color: rgba(255,255,255,0.2);
}

p#sub-text {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

/* ==========================================
   LIGHT SWITCH (Theme Toggle)
   ========================================== */
.light-switch-wrapper.intro-switch {
    position: absolute;
    top: 2.5rem;
    right: 4rem;
    z-index: 2000;
}

.light-switch-wrapper.sidebar-switch {
    position: relative;
    z-index: 10;
    margin-top: 4px;
}

.sidebar-divider {
    width: 24px;
    height: 1.5px;
    background: rgba(0,0,0,0.08); /* Sutil divisor estilo macOS */
    border-radius: 1px;
    margin: 6px 0;
}

body.dark-mode .sidebar-divider {
    background: rgba(255,255,255,0.12);
}

input.theme-toggle {
    height: 0;
    width: 0;
    opacity: 0;
    position: absolute;
}

.light-switch {
    height: 40px;
    width: 40px;
    position: relative;
    display: block;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

.light-switch:hover {
    transform: scale(1.1);
}

.light-switch:before {
    content: '';
    position: absolute;
    height: 30px;
    width: 30px;
    /* Uses dynamic HSL via custom properties to achieve the TV switch effect */
    background: hsl(0, 0%, calc(var(--light-switch) * 1%));
    box-shadow: 0 2px 2px 0 hsla(0, 0%, 35%, var(--shadow-opacity));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    border-radius: 4px;
}

.light-switch:after {
    content: '';
    height: 12px;
    width: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid hsl(0, 0%, calc(var(--light-switch-border) * 1%));
    /* Uses multiple calc strings to create the linear-gradient properly */
    background: linear-gradient(
        hsl(0, 0%, calc(var(--light-switch-top) * 1%)), 
        hsl(0, 0%, calc(var(--light-switch-bottom) * 1%))
    );
    transition: border 0.2s ease, background 0.3s ease;
    border-radius: 1px;
}

/* ==========================================
   APLICACIÓN PRINCIPAL (CSS Grid Layer)
   ========================================== */
#main-app {
    display: grid;
    grid-template-columns: 1fr;
    height: 100vh;
    opacity: 0; /* Inicia oculto para la transición de entrada */
    position: relative;
}

/* Sidebar — floats over main content so backdrop-filter can see through */
#sidebar {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
}

/* ==========================================
   LIQUID GLASS (reference-accurate)
   ========================================== */
.liquidGlass-wrapper {
    position: relative;
    display: flex;
    font-weight: 600;
    overflow: hidden;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

.liquidGlass-effect {
    position: absolute;
    z-index: 0;
    inset: 0;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    filter: url(#glass-distortion);
    overflow: hidden;
}

.liquidGlass-tint {
    z-index: 1;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.45);
}

body.dark-mode .liquidGlass-tint {
    /* Un poco más clara para que el cristal se note de verdad en oscuro */
    background: rgba(55, 55, 55, 0.7);
}

.liquidGlass-shine {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
                inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

body.dark-mode .liquidGlass-shine {
    box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.2),
                inset -1px -1px 1px 1px rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.18);
}

.liquidGlass-text {
    z-index: 3;
    position: relative;
}

/* Dock shape — applied to wrapper AND all child divs (per reference note) */
.sidebar-dock,
.sidebar-dock > div {
    border-radius: 2rem;
}

.sidebar-dock {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.sidebar-dock-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0.25rem;
}

/* ==========================================
   THEME BUTTONS (macOS app-icon style)
   ========================================== */
#theme-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.theme-btn {
    background: linear-gradient(145deg, #e8e4df, #d4cfc8);
    border: none;
    width: 52px;
    height: 52px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #5a5549;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2), 
                opacity 0.4s ease, 
                box-shadow 0.4s ease, 
                background 0.4s ease;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    will-change: transform, box-shadow;
}

body.dark-mode .theme-btn {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    color: #c8c0b4;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.theme-btn:hover {
    transform: scale(0.92);
    transform-origin: center center;
}

.theme-btn.active {
    background: linear-gradient(145deg, var(--c-text-main), #333);
    color: var(--c-bg);
    transform: scale(1.05);
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

/* En oscuro, el tema activo destaca mucho más (pastilla clara claramente diferenciada) */
body.dark-mode .theme-btn.active {
    background: linear-gradient(145deg, #f5f0e2, #c7b894);
    color: #1b1b1b;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.7), 0 10px 30px rgba(0,0,0,0.8);
}

/* Liquid Back Mode Transition - Softer, non-aggressive color */
.theme-btn.back-mode {
    background: linear-gradient(145deg, var(--c-accent), var(--c-accent-dark)) !important;
    color: white !important;
    transform: rotate(-360deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(212, 201, 168, 0.4);
}

.theme-btn svg {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

.theme-btn.back-mode svg {
    transform: scale(1.2);
}

body.dark-mode .theme-btn.back-mode {
    background: linear-gradient(145deg, #a59b7e, #8a7d66) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px; /* Standardize height for art homogeneity */
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    z-index: 1001; /* Above all views */
    pointer-events: none; /* Let clicks feel "background-like" except for the button */
}

#global-back {
    pointer-events: auto;
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: all 0.5s var(--transition-smooth);
    margin-top: 1.5rem; 
    margin-left: 0.5rem;
}

#global-back svg {
    width: 20px;
    height: 20px;
    transition: transform 0.4s var(--transition-smooth);
}

#global-back:hover svg {
    transform: translateX(-3px);
}

#global-back:hover {
    color: var(--c-text-main);
}

#global-back span {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

#global-back span::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    background: currentColor;
    bottom: -4px;
    left: 0;
    transition: width 0.4s var(--transition-smooth);
}

#global-back:hover span::after {
    width: 100%;
}

#header-text { display: none; } /* Clean artistic look, no redundant @pepelluba here */


/* First button (Wiki) gets a distinct accent color */
.theme-btn:first-child {
    background: linear-gradient(145deg, #c9b896, #a89978);
    color: #fff;
}

body.dark-mode .theme-btn:first-child {
    background: linear-gradient(145deg, #8a7d66, #6b604d);
    color: #f0ebe5;
}

/* Main Content Area */
#content-area {
    position: relative;
    overflow: hidden;
    height: 100vh;
}

.view {
    position: absolute;
    top: 0;
    left: 7rem;
    width: calc(100% - 7rem);
    height: 100%;
    padding: 0 3rem 1.5rem 0.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
    will-change: opacity, transform;
}

.section-header, .isabelle-header {
    height: 100px; /* Matched to global header height! */
    display: flex;
    flex-direction: column; /* Allow progress bar below or centering */
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    background: transparent;
    z-index: 100;
}

body.dark-mode .section-header, body.dark-mode .isabelle-header {
    border-bottom-color: rgba(255,255,255,0.02);
}

.section-header h3, #exercise-title {
    font-size: 1rem !important; /* Artistically small, non-obtrusive */
    font-family: 'Outfit', sans-serif;
    color: var(--c-text-muted);
    letter-spacing: 2px;
    font-weight: 500;
    text-transform: uppercase;
    margin: 0;
}

.isabelle-header {
    gap: 12px; /* Increased gap for better balance */
}

.progress-bar-container {
    width: 280px; /* Slightly wider for the centered look */
    height: 4px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

body.dark-mode .progress-bar-container {
    background: rgba(255,255,255,0.05);
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: var(--c-accent-dark);
    transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.view.active-view {
    opacity: 1;
    pointer-events: auto;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 1.8rem; /* Smaller, matches isabelle title homogeneity */
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    color: var(--c-text-main);
}

/* Grid Ejercicios */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    perspective: 1000px; /* Requisito para el efecto 3D holográfico */
}

/* TARJETAS DE EJERCICIOS - HOLOGRÁFICAS (3D) Y LIQUID GLASS */
.exercise-card {
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    background: transparent;
    border: none;
    /* Configuracion 3D Holografica */
    position: relative;
    overflow: hidden;
    --ratio-x: 0;
    --ratio-y: 0;
    --correction: 100%;
    transform-style: preserve-3d;
    backface-visibility: hidden; /* Prevent flickering */
    transition: transform 0.1s linear, box-shadow var(--transition-fast), opacity var(--transition-fast);
    transform: translate3d(0,0,0) rotateY(calc(-20deg * var(--ratio-x))) rotateX(calc(20deg * var(--ratio-y))) scale(1);
    will-change: transform;
}

.exercise-card:hover {
    transform: rotateY(calc(-20deg * var(--ratio-x))) rotateX(calc(20deg * var(--ratio-y))) scale(1.02);
    --correction: 0%;
}

body.dark-mode .exercise-card:hover .liquidGlass-shine {
    box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.25),
                inset -1px -1px 1px 1px rgba(255, 255, 255, 0.25);
}

/* El contenido superior (títulos y tal) se empuja hacia adelante en 3D! */
.exercise-card .card-content {
    position: relative;
    z-index: 3;
    pointer-events: none;
    transform: translateZ(30px); /* Esto hace que el texto "flote" encima de la tarjeta 3D */
    transition: transform 0.1s linear;
}

.exercise-card h4 {
    font-size: 2.8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.exercise-card p {
    font-size: 0.8rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* ==========================================
   ISABELLE EDITOR VIEW
   ========================================== */
#isabelle-view {
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Isabelle specific header components (Unified with Section headers) */
.progress-bar-container {
    width: 240px; /* Standard artistic width */
    height: 3px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 0 auto; /* CENTER it! */
}

body.dark-mode .progress-bar-container {
    background: rgba(255,255,255,0.05);
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: var(--c-accent-dark);
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1);
}

.isabelle-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 2rem; /* Increased padding for elegance */
    gap: 2rem;
    /* Removed negative margin: homogeneity focus */
}

.panel {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.03);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    contain: paint; /* Optimization: isolate paint */
    will-change: transform, opacity;
}

body.dark-mode .panel {
    /* Misma sensación de vidrio en oscuro: un poco de opacidad, no bloque negro */
    background: rgba(20, 20, 20, 0.88);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 18px 50px rgba(0,0,0,0.8);
}

/* Custom Scrollbar minimalista */
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }

.code-panel {
    border-right: 1px solid rgba(0,0,0,0.05);
    /* Panel de código con ligera opacidad sobre el vidrio */
    background: rgba(255,255,255,0.92);
}

body.dark-mode .code-panel {
    border-right: 1px solid rgba(255,255,255,0.10);
    background: rgba(15,15,15,0.92);
}

.code-font {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--c-text-muted);
}

.isabelle-item {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.isabelle-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.isabelle-item.active-line {
    color: var(--c-text-main);
    font-weight: 500;
}

/* Syntax Highlighting Minimalista */
.keyword { color: #8A7A57; font-weight: 600; }
.highlight { 
    background-color: var(--c-accent); 
    color: #fff;
    padding: 0 4px;
    border-radius: 2px;
}

.explanation-panel {
    position: relative;
    /* Usa el mismo tipo de vidrio que el resto del panel */
    background: rgba(255,255,255,0.88);
}

body.dark-mode .explanation-panel {
    background: rgba(18,18,18,0.9);
}

h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--c-text-muted);
    margin-bottom: 1.5rem;
}

.explanation-section {
    margin-bottom: 4rem;
}

.text-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.hypothesis-box {
    padding: 1rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

/* ==========================================
   WIKI / GUIA COMPONENTES (VERTICAL + SCROLL INTERNO)
   ========================================== */
.wiki-content {
    /* Custom Scrollbar for Wiki */
    scrollbar-width: thin;
    scrollbar-color: var(--c-accent) transparent;
    /* Vertical simple — los items se apilan */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.wiki-content::-webkit-scrollbar {
    width: 6px;
}
.wiki-content::-webkit-scrollbar-thumb {
    background-color: var(--c-accent);
    border-radius: 10px;
}

/* Contenedor Principal de un Tema */
.wiki-grid-item {
    background: var(--c-bg-alt);
    border: 1px solid rgba(0,0,0,0.03);
    border-radius: 20px;
    padding: 2rem;
    transition: box-shadow var(--transition-fast);
    flex-shrink: 0;
}

.wiki-grid-item:hover {
    box-shadow: var(--shadow-soft);
}

.wiki-item-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--c-text-main);
    margin-bottom: 0.5rem;
    text-transform: none;
    letter-spacing: normal;
}

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

/* Sub-Bloques Interactivos (details/summary) */
.wiki-subcard {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.wiki-subcard[open] {
    border-color: rgba(0,0,0,0.15);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.wiki-subsummary {
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    position: relative;
    user-select: none;
    transition: background var(--transition-fast);
    color: var(--c-accent-dark);
}

.wiki-subsummary::-webkit-details-marker {
    display: none;
}

.wiki-subsummary::after {
    content: '+';
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: 300;
    transition: transform var(--transition-fast);
    font-family: 'Inter', sans-serif;
    color: var(--c-text-muted);
}

.wiki-subcard[open] .wiki-subsummary::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

.wiki-subsummary:hover {
    background: rgba(0,0,0,0.015);
}

.wiki-subinner {
    padding: 0 1.2rem 1.2rem 1.2rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--c-text-main);
    animation: fadeInDown 0.25s ease-out forwards;
}

.wiki-code-block {
    display: block;
    font-family: monospace;
    margin-top: 0.5rem;
    color: var(--c-text-muted);
    background: rgba(0,0,0,0.03);
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.controls {
    position: fixed;
    bottom: 4rem;
    right: 4rem;
    display: flex;
    gap: 1rem;
}

.control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    background: #fff;
    color: var(--c-text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-soft);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
    box-shadow: none;
}

.control-btn:not(:disabled):hover {
    transform: scale(1.05);
    border-color: var(--c-text-main);
}

.control-btn.primary {
    background: var(--c-text-main);
    color: var(--c-bg);
    border-color: var(--c-text-main);
}

.control-btn.primary:hover {
    background: #000;
}

body.dark-mode .control-btn.primary:hover {
    background: #fff;
}

/* ==========================================
   DARK MODE ADJUSTMENTS
   ========================================== */
body.dark-mode #sidebar { border-color: rgba(255,255,255,0.05); }

/* Las tarjetas de ejercicio mantienen el efecto de vidrio también en oscuro
   (la apariencia se controla con liquidGlass-*) */
body.dark-mode .exercise-card {
    background: transparent;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .hypothesis-box { background: #2A2A2A; border-color: rgba(255,255,255,0.05); }
body.dark-mode .control-btn { background: #2A2A2A; border-color: rgba(255,255,255,0.1); color: var(--c-text-main); }
body.dark-mode .code-font { color: #DDDDDD; }
body.dark-mode .progress-bar-container { background: rgba(255,255,255,0.1); }
body.dark-mode .icon-btn.top-nav { background: #2A2A2A; }

/* Dark Mode: Wiki Components */
body.dark-mode .wiki-grid-item { border-color: rgba(255,255,255,0.05); }
body.dark-mode .wiki-subcard { background: #2A2A2A; border-color: rgba(255,255,255,0.05); }
body.dark-mode .wiki-subcard[open] { border-color: rgba(255,255,255,0.15); }
body.dark-mode .wiki-subsummary:hover { background: rgba(255,255,255,0.02); }
body.dark-mode .wiki-code-block { background: rgba(255,255,255,0.05); }

/* ==========================================
   CUSTOM CURSOR
   ========================================== */
@media (pointer: fine) {
    body, body * {
        cursor: none !important;
    }
    body.native-cursor, body.native-cursor * {
        cursor: auto !important;
    }
}

#custom-cursor {
    position: fixed;
    top: -20px;
    left: -20px;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease;
}

#custom-cursor.hover {
    width: 45px;
    height: 45px;
}

/* ==========================================
   ADMIN PANEL (GitHub API)
   ========================================== */
.admin-container {
    max-width: 600px; /* Centrado como columna estrecha rollo login clásico */
    margin: 0 auto;
}

.admin-login-box, .admin-dashboard {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    animation: fadeInDown 0.4s ease-out;
}

body.dark-mode .admin-login-box,
body.dark-mode .admin-dashboard {
    background: #252525;
    border-color: rgba(255,255,255,0.05);
}

.admin-input-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-input-group label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text-muted);
    font-weight: 500;
}

.admin-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    background: var(--c-bg);
    color: var(--c-text-main);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color var(--transition-fast);
}

.admin-input:focus { border-color: var(--c-text-main); }

body.dark-mode .admin-input {
    background: #1B1B1B;
    border-color: rgba(255,255,255,0.1);
}

.admin-textarea {
    width: 100%;
    height: 350px;
    padding: 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    background: var(--c-bg);
    color: var(--c-text-main);
    resize: vertical;
    outline: none;
}

body.dark-mode .admin-textarea {
    background: #1B1B1B;
    border-color: rgba(255,255,255,0.1);
}

.admin-btn {
    height: 48px;
    font-size: 1rem;
    font-weight: 500;
}

.admin-msg {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1.5rem;
}

.admin-msg.error { color: #d93025; }
.admin-msg.success { color: #188038; }

body.dark-mode .admin-msg.error { color: #f28b82; }
body.dark-mode .admin-msg.success { color: #81c995; }

/* ==========================================
   ADMIN CRUD EDITOR
   ========================================== */
.adm-screen.hidden { display: none; }

.adm-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.5px;
    color: var(--c-text-main);
    margin-bottom: 1.5rem;
}

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

.adm-theme-card {
    background: var(--c-bg);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--c-text-main);
    transition: all var(--transition-fast);
}

.adm-theme-card:hover {
    border-color: var(--c-text-main);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

body.dark-mode .adm-theme-card {
    background: #1B1B1B;
    border-color: rgba(255,255,255,0.06);
}

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

.adm-ex-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-bg);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    transition: all var(--transition-fast);
}

.adm-ex-item:hover {
    border-color: rgba(0,0,0,0.1);
}

body.dark-mode .adm-ex-item {
    background: #1B1B1B;
    border-color: rgba(255,255,255,0.05);
}

.adm-ex-info {
    flex: 1;
    min-width: 0;
}

.adm-ex-info strong {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.15rem;
}

.adm-ex-info span {
    font-size: 0.8rem;
    color: var(--c-text-muted);
}

.adm-ex-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.adm-ex-actions button {
    background: none;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    color: var(--c-text-muted);
}

.adm-ex-actions button:hover {
    border-color: var(--c-text-main);
    color: var(--c-text-main);
}

.adm-ex-actions button.delete:hover {
    border-color: #d93025;
    color: #d93025;
    background: rgba(217, 48, 37, 0.05);
}

body.dark-mode .adm-ex-actions button {
    border-color: rgba(255,255,255,0.1);
}

/* Step cards in editor */
.adm-step-card {
    background: var(--c-bg);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
}

body.dark-mode .adm-step-card {
    background: #1B1B1B;
    border-color: rgba(255,255,255,0.06);
}

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

.adm-step-header strong {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--c-accent-dark);
}

.adm-step-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-text-muted);
    font-size: 1.1rem;
    transition: color var(--transition-fast);
}

.adm-step-header button:hover { color: #d93025; }

.adm-step-card textarea {
    width: 100%;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 0.7rem;
    background: var(--c-bg-alt);
    color: var(--c-text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    margin-bottom: 0.75rem;
}

.adm-step-card textarea:focus {
    border-color: var(--c-text-main);
}

.adm-step-card textarea.code-font {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
}

body.dark-mode .adm-step-card textarea {
    background: #222;
    border-color: rgba(255,255,255,0.08);
}

.adm-step-card label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text-muted);
    font-weight: 500;
    display: block;
    margin-bottom: 0.3rem;
}

