/* --- COMPONENTES DE IMAGEN Y VISUALIZADOR (EDIMH) --- */

/* 1. Miniaturas Contenidas (Previsualización antes del clic) */
.subtle-reference-wrapper {
    max-width: 320px; /* Evita que la imagen se vea enorme antes del clic */
    margin: 0 auto;
    padding: 15px;
    background: #f8f9fa;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: zoom-in;
    transition: 0.3s;
    text-align: center;
}

.subtle-reference-wrapper:hover {
    border-color: #333;
    transform: translateY(-3px);
}

.subtle-reference-img {
    width: 100%;
    max-height: 200px; /* Limita el alto de la miniatura */
    object-fit: contain; /* Asegura que la imagen no se deforme */
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
}

.ref-label {
    font-family: -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 2. Visualizador Expandido (Lightbox) */
.image-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out; /* Indica que clic afuera cierra */
}

.image-modal-overlay.active {
    display: flex;
}

.modal-img-container {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    cursor: default; /* Clic en la imagen no cierra por sí solo */
}

#modal-img-expanded {
    max-width: 100%;
    max-height: 80vh; /* Limita la expansión para que no desborde el monitor */
    object-fit: contain;
    border-radius: 12px;
    border: 4px solid #fff;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.close-modal-btn {
    position: absolute;
    top: -45px;
    right: 0;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #e63946;
}/* Estructura de Pantalla Fija (Viewport Lock) */
html, body {
    margin: 0; padding: 0; 
    width: 100%; 
    height: 100vh; /* Fija el alto exacto a la pantalla del usuario */
    background-color: #fdfdfd;
    background-image: 
        linear-gradient(#e5e5e5 1px, transparent 1px),
        linear-gradient(90deg, #e5e5e5 1px, transparent 1px);
    background-size: 30px 30px;
    overflow: hidden; /* Evita que la página completa se deslice hacia abajo */
}

/* Contenedor Maestro de Diapositivas */
.showcase-wrapper {
    display: flex; 
    width: 500vw; /* Ajustar según el número de secciones */
    height: 100vh; 
    overflow-x: scroll; 
    scroll-snap-type: x mandatory;
    scrollbar-width: none; 
    scroll-behavior: smooth;
}

/* Cada Sección (Slide) */
section {
    width: 100vw; 
    height: 100vh; /* Se ajusta al alto del monitor */
    flex-shrink: 0; 
    scroll-snap-align: start; 
    display: flex;
    align-items: flex-start; 
    justify-content: center;
    padding-top: 90px; /* Espacio exacto para el Header */
    padding-bottom: 100px; /* Espacio para la navegación inferior */
    overflow-y: auto; /* PERMITE SCROLL INTERNO: Si el contenido es mucho, se desliza solo por dentro */
    box-sizing: border-box;
}

/* Contenedor de Información */
.content-container {
    width: 100%; 
    max-width: 1200px; 
    padding: 10px 30px; /* Padding más compacto para ganar espacio vertical */
    display: flex; 
    flex-direction: column;
}

/* ==========================================================================
   DARK MODE (MODO OSCURO GLOBAL)
   ========================================================================== */

/* Transición suave para el cambio de tema */
body, header, .note-card, .formula-box, .css-graphic-box, .header-btn, .control-btn {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 1. Fondo y Texto Base */
body.dark-mode {
    background-color: #121212;
    background-image: 
        linear-gradient(#222 1px, transparent 1px),
        linear-gradient(90deg, #222 1px, transparent 1px);
    color: #e2e8f0;
}

body.dark-mode p, body.dark-mode li { color: #cbd5e1; }
body.dark-mode strong { color: #fff; }

/* 2. Encabezado (Header) y Botones */
body.dark-mode header.rainbow-header {
    background: rgba(18, 18, 18, 0.98);
    border-bottom-color: #333;
}

/* Magia CSS: Reemplazo del logo a la versión clara/negativa */
body.dark-mode header.rainbow-header img {
    content: url("../images/logo/logo-dark 2.png");
}

body.dark-mode .header-btn {
    background: #1e1e1e;
    color: #e2e8f0;
    border-color: #555;
    box-shadow: 2px 2px 0px #000;
}
body.dark-mode .header-btn:hover {
    box-shadow: 4px 4px 0px #000;
    color: #fff;
    background: #2a2a2a;
}
body.dark-mode .header-btn.primary {
    background: #005f92;
    border-color: #003f62;
    color: #fff;
}

/* 3. Tarjetas, Fórmulas y Contenedores */
body.dark-mode .note-card,
body.dark-mode .sc-card,
body.dark-mode .css-graphic-box {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
}

body.dark-mode .formula-box {
    background: #1a1a1a;
    border-color: #444;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
}
body.dark-mode .formula-box:hover {
    box-shadow: 6px 6px 0px rgba(0,0,0,0.5);
    border-color: #555;
}

/* 4. Navegación Inferior y Controles Laterales */
body.dark-mode .nav-item { color: #555; }
body.dark-mode .nav-item.active { color: #fff; }
body.dark-mode .control-btn {
    background: #1e1e1e;
    border-color: #555;
    color: #fff;
    box-shadow: 3px 3px 0px #000;
}
body.dark-mode .control-btn:hover {
    background: #333;
    box-shadow: 4px 4px 0px #000;
}

/* 5. Atajos de Teclado (KBD) */
body.dark-mode .kbd-key {
    background: #2d3748;
    color: #f1f5f9;
    border-color: #475569;
    border-bottom-color: #1e293b;
    box-shadow: inset 1px 1px 0px rgba(255,255,255,0.1), 0 2px 0 rgba(0,0,0,0.5);
}

/* 6. Adaptación de Gráficos CSS y Referencias visuales */
/* Evita que los documentos falsos o lienzos simulados cieguen al usuario */
body.dark-mode .ui-canvas,
body.dark-mode .tm-box,
body.dark-mode .doc-sheet,
body.dark-mode .biz-card,
body.dark-mode .brand-page,
body.dark-mode .pl-page,
body.dark-mode .am-body,
body.dark-mode .dummy-handle,
body.dark-mode .subtle-reference-wrapper {
    background-color: #222;
    border-color: #444;
}

body.dark-mode .subtle-reference-wrapper:hover {
    background-color: #2a2a2a;
    border-color: #666;
}
body.dark-mode .subtle-reference-img { border-color: #111; }

/* 7. Ribbon (Menú estilo Office en las Prácticas) */
body.dark-mode .ribbon-menu { background: #1e1e1e; border-color: #444; }
body.dark-mode .ribbon-tab { background: #2a2a2a; border-color: #444; color: #94a3b8; }
body.dark-mode .ribbon-tab.active, 
body.dark-mode .ribbon-tab span.active { background: #1e1e1e; color: #fff; }
body.dark-mode .ribbon-tools { background: #1e1e1e; }
body.dark-mode .ribbon-btn { color: #cbd5e1; border-color: #555; }
/* ==========================================================================
   TIPOGRAFÍA Y PALETA DE COLORES UTILITY
   ========================================================================== */
h2, h4, p, li, span { font-family: 'Kalam', cursive; }
h2 { font-weight: 700; font-size: 37px; line-height: 1.1; margin-bottom: 15px; }
h4 { font-weight: 700; font-size: 24px; margin-bottom: 10px; line-height: 1.2; display: flex; align-items: center; gap: 12px;}

/* FUENTE DE DESCRIPCIONES AUMENTADA A 20PX */
p, li { font-size: 20px; line-height: 1.4; color: #444; margin-bottom: 12px; }
strong { font-weight: 700; color: #111; }

.t-rojo { color: #e63946; } 
.t-azul { color: #0077b6; }
.t-naranja { color: #fca311; } 
.t-purpura { color: #7209b7; }
.t-verde { color: #217346; } 
.t-cyan { color: #00b4d8; }
.t-magenta { color: #d946ef; } 
.t-lima { color: #84cc16; }

/* ==========================================================================
   COMPONENTES UI (TARJETAS, CAJAS Y ATAJOS)
   ========================================================================== */
.note-card { 
    padding: 30px 35px; 
    box-shadow: 8px 8px 0px rgba(0,0,0,0.05);
    border: 2px solid #02b4d8; 
    position: relative; 
    z-index: 2; 
    margin-bottom: 20px; 
    border-radius: 12px;
}

.tape-top {
    position: absolute; 
    top: -15px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 120px; 
    height: 30px; 
    opacity: 0.8; 
    z-index: 5;
}

.formula-box {
    background: #fdfdfd; 
    border: 2px dashed #bbb; 
    padding: 20px; 
    border-radius: 12px;
    margin-bottom: 15px; 
    transition: 0.3s; 
    box-shadow: 4px 4px 0px rgba(0,0,0,0.02);
}
.formula-box:hover { 
    transform: translate(-2px, -2px); 
    box-shadow: 6px 6px 0px rgba(0,0,0,0.05); 
    border-style: solid; 
}

.title-icon { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 10px; 
}

/* Comandos 3D */
.kbd-key {
    display: inline-block; 
    padding: 3px 12px;
    font-family: -apple-system, system-ui, sans-serif;
    font-weight: 900; 
    color: #222; 
    background: #f4f4f5; 
    border: 2px solid #cbd5e1; 
    border-bottom: 4px solid #94a3b8; 
    border-radius: 8px;
    margin: 0 4px; 
    font-size: 15px; 
    transform: translateY(-2px);
    box-shadow: inset 1px 1px 0px rgba(255,255,255,1), 0 2px 0 rgba(0,0,0,0.1);
}

.shortcuts-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; 
    width: 100%; 
    padding-bottom: 20px;
}
.sc-card { 
    background: #fff; 
    border: 1px solid #e2e8f0; 
    border-left: 6px solid #d946ef; 
    padding: 15px 20px; 
    border-radius: 12px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

/* ==========================================================================
   NAVEGACIÓN (HEADER, SLIDERS Y BOTTOM NAV)
   ========================================================================== */
header.rainbow-header {
    position: fixed;
    top: 0; width: 100%; z-index: 1000;
    background: rgba(255,255,255,0.98);
    border-bottom: 2px dashed #ccc;
}

.header-btn {
    font-family: 'Kalam', cursive;
    font-weight: 700; font-size: 16px;
    border: 2px solid #333; background: #fff; color: #333;
    padding: 5px 15px; border-radius: 8px; text-decoration: none;
    box-shadow: 2px 2px 0px #333; transition: 0.2s;
    white-space: nowrap;
}
.header-btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0px #333; color: #000; }
.header-btn.primary { background: #0077b6; color: #fff; border-color: #005f92; }

.bottom-nav { position: fixed; bottom: 20px; left: 5%; z-index: 100; display: flex; gap: 15px; flex-wrap: wrap; max-width: 80%;}
.nav-item { font-size: 14px; font-weight: 700; text-transform: uppercase; color: #aaa; cursor: pointer; font-family: -apple-system, sans-serif;}
.nav-item.active { color: #000; border-bottom: 3px solid #00b4d8; padding-bottom: 2px;}

.slide-controls { position: fixed; bottom: 20px; right: 5%; z-index: 100; display: flex; gap: 15px;}
.control-btn { background: #fff; border: 2px solid #333; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 3px 3px 0px #333; transition: 0.2s;}

/* ==========================================================================
   CONTENEDORES DE SIMULADORES CSS (ESTÁNDAR)
   ========================================================================== */
.css-graphic-box {
    background: #ff121200; padding: 25px; border: 3px solid #333; border-radius: 12px;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.05); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sketch-caption {
    position: absolute; bottom: 8px; left: 0; width: 100%; text-align: center;
    font-weight: 900; font-size: 12px; color: #aaa; text-transform: uppercase;
    font-family: sans-serif; letter-spacing: 2px;
}
/* =============================================================
   SECCIÓN DE PRÁCTICAS - ACADEMIA EDIMH
   ============================================================= */

/* 1. Estructura de Pantalla y Contenedores */
.showcase-wrapper {
    display: flex; 
    width: 500vw; 
    height: 100vh; 
    overflow-x: scroll; 
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.showcase-wrapper::-webkit-scrollbar { display: none; }

section {
    width: 100vw; 
    height: 150vh; 
    flex-shrink: 0; 
    scroll-snap-align: start; 
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px; 
    padding-bottom: 120px;
}

.content-container {
    width: 100%; 
    max-width: 1200px; 
    padding: 15px 30px;
    display: flex; 
    flex-direction: column;
}

/* 2. Diseño de "Hoja de Cuaderno" (Notebook Page) */
.notebook-page {
   
    padding: 0 0 40px 0; 
    box-shadow: 8px 8px 0px rgba(0,0,0,0.05);
    border: 2px solid #ddd; 
    position: relative; 
    z-index: 2; 
    margin-bottom: 25px; 
    border-radius: 12px;
    overflow: hidden; 
}

.phase-header {
    padding: 15px 30px;
    color: white;
    font-family: -apple-system, sans-serif;
    font-weight: 900;
    letter-spacing: 2px;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.practice-content {
    padding: 0 40px;
}

/* 3. Componentes de Imagen (Miniaturas y Control de Escala) */
.subtle-reference-wrapper {
    background: #f8f9fa;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px; /* Evita que la imagen sea gigante antes del clic */
    margin: 0 auto; 
}

.subtle-reference-wrapper:hover {
    border-color: #333;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.subtle-reference-img {
    max-width: 100%;
    max-height: 200px; /* Altura controlada para la miniatura */
    object-fit: contain; 
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.ref-label {
    font-family: -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 4. Apoyos Visuales (Pistas y Hints) */
.hint-box {
    background: #fdf4ff; 
    border-left: 6px solid #7209b7;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.hint-number {
    background: #7209b7;
    color: white;
    font-family: -apple-system, sans-serif;
    font-weight: 900;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.inline-hint {
    background: #f0f9ff;
    border-left: 4px solid #0077b6;
    padding: 10px 15px;
    border-radius: 0 6px 6px 0;
    margin-top: 10px;
    font-size: 16px;
}

/* 5. Visualizador Lightbox (Imagen Expandida) */
.image-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.image-modal-overlay.active {
    display: flex;
}

.modal-img-container {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
}

#modal-img-expanded {
    max-width: 100%;
    max-height: 80vh; /* Seguridad para no desbordar el monitor */
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    border: 4px solid #fff;
    object-fit: contain;
}

.close-modal-btn {
    position: absolute;
    top: -45px;
    right: 0;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

/* 6. Paleta de Colores de Texto */
.t-rojo { color: #e63946; }
.t-azul { color: #0077b6; }
.t-naranja { color: #f59e0b; }
.t-purpura { color: #7209b7; }
.t-verde { color: #217346; }
.t-cyan { color: #00b4d8; }
/* ==========================================================================
   MEDIA QUERIES (ADAPTACIÓN MÓVIL)
   ========================================================================== */
@media (max-width: 768px) { 
    .bottom-nav { display: none; } 
    .shortcuts-grid { grid-template-columns: 1fr; } 
    
    /* ADAPTACIÓN DEL ENCABEZADO */
    header.rainbow-header .container {
        flex-direction: column !important; /* Apila logo y botones */
        gap: 12px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }
    
    /* Envuelve los botones si no caben */
    header.rainbow-header .d-flex.align-items-center.gap-2 {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Reduce el título para que no rompa la pantalla */
    header.rainbow-header span {
        font-size: 18px !important; 
        text-align: center;
    }
    
    /* Ajusta botones para dedos/móvil */
    .header-btn {
        font-size: 13px;
        padding: 6px 10px;
    }

    /* ADAPTACIÓN DE LAS SECCIONES Y CONTENIDO */
    section {
        padding-top: 150px; /* Compensa el nuevo alto del header apilado */
    }
    .content-scroll {
        padding: 5px 15px; /* Menos márgenes laterales en móvil */
    }

    /* ADAPTACIÓN DE GRÁFICOS GRANDES */
    .bauhaus-grid, .vr-container {
        flex-direction: column;
        gap: 20px;
    }
}