/* src/styles/programming.css - VERSIÓN FINAL: CINE MODE + VIDEO FIX */

/* =========================================
   BASE & FONDOS
   ========================================= */
body { 
    background-color: #020211; 
    font-family: 'Courier New', monospace; 
    margin: 0; 
    overflow: hidden; 
}

#grid-scan-canvas { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: 1; pointer-events: none; 
}

/* FADE OUT LOGIC (Cuando el modal se abre) */
.fade-target { transition: opacity 0.5s ease, filter 0.5s ease; }
body.modal-active .fade-target { opacity: 0; pointer-events: none; filter: blur(5px); }

/* =========================================
   NAVEGACIÓN SUPERIOR
   ========================================= */
.nav-btn {
    position: fixed; top: 40px; z-index: 100;
    font-family: 'Courier New', monospace; font-size: 0.9rem; font-weight: bold;
    text-decoration: none; letter-spacing: 2px; padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px); color: white; 
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    opacity: 0; animation: fadeInSimple 1s forwards 3s;
}
.nav-btn.left { left: 40px; } 
.nav-btn.right { right: 40px; text-align: right; }

.nav-btn:hover { 
    background: rgba(255, 255, 255, 0.1); border-color: #00e5ff; color: #00e5ff; 
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3); transform: translateY(-2px); 
}
.switch-mode:hover { 
    border-color: #ff0055; color: #ff0055; box-shadow: 0 0 15px rgba(255, 0, 85, 0.3); 
}

/* =========================================
   INTRO & SCROLL PRINCIPAL
   ========================================= */
.intro-container { 
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    text-align: center; z-index: 20; pointer-events: none; 
    animation: titleExit 0.8s cubic-bezier(0.55, 0.085, 0.68, 0.53) 2.5s forwards; 
}
.glitch-title { 
    font-size: 5rem; color: #fff; font-weight: 900; 
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.9), 0 0 60px rgba(0, 229, 255, 0.5); 
}
.intro-subtitle { 
    color: #fff; letter-spacing: 5px; margin-top: 15px; font-size: 1.2rem; 
    opacity: 0; animation: fadeInSimple 0.5s forwards 0.5s; 
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.8); 
}

.infinite-scroll-viewport { 
    position: relative; z-index: 10; width: 100%; height: 100vh; 
    overflow-y: auto; scrollbar-width: none; scroll-behavior: auto; 
    opacity: 0; animation: fadeInSimple 1s forwards 3s; 
}
.infinite-scroll-content { display: flex; flex-direction: column; }
.project-slide { 
    width: 100%; height: 100vh; display: flex; justify-content: center; align-items: center; 
    position: relative; scroll-snap-align: start; scroll-snap-stop: always; 
}

/* =========================================
   TARJETAS DE PROYECTOS (DASH CARDS)
   ========================================= */
.tech-card {
    width: 60%; max-width: 800px; height: 120px;
    background: rgba(10, 10, 18, 0.85); border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--card-color, #00e5ff); border-radius: 10px; backdrop-filter: blur(15px);
    display: flex; align-items: center; padding: 0 40px; gap: 30px;
    cursor: pointer; overflow: hidden; transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6); position: relative;
}

.tech-card:hover { 
    height: 550px; flex-direction: column; align-items: flex-start; justify-content: center; 
    padding: 50px; border-color: var(--card-color); 
    box-shadow: 0 0 60px var(--card-glow), inset 0 0 30px var(--card-glow-low); 
    transform: scale(1.05); 
}

/* Elementos internos de la tarjeta */
.tech-card:hover .card-icon { align-self: center; margin-bottom: 20px; transform: scale(1.3); }
.tech-card:hover .card-header { align-self: center; text-align: center; margin-bottom: 40px; }
.tech-card:hover .card-body { opacity: 1; width: 100%; height: auto; display: flex; flex-direction: column; align-items: center; text-align: center; }

.card-icon svg { width: 50px; height: 50px; fill: #fff; filter: drop-shadow(0 0 8px var(--card-glow)); transition: 0.4s; }
.card-header h2 { margin: 0; color: #fff; font-size: 2rem; text-transform: uppercase; letter-spacing: 3px; text-shadow: 0 0 15px var(--card-glow); }
.card-header span { font-size: 0.8rem; color: #aaa; letter-spacing: 1px; }

.card-body { opacity: 0; width: 0; height: 0; overflow: hidden; transition: 0.4s; }
.detail-desc { color: #d0d0d0; font-size: 1.15rem; line-height: 1.8; max-width: 650px; margin-bottom: 30px; }
.detail-tags { display: flex; gap: 15px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.tag { border: 1px solid var(--card-color); color: var(--card-color); background: rgba(0,0,0,0.3); padding: 8px 20px; border-radius: 4px; font-size: 0.9rem; box-shadow: 0 0 10px var(--card-glow-low); }

/* Temas de color */
.blue-theme { --card-color: #00e5ff; --card-glow: rgba(0, 229, 255, 0.8); --card-glow-low: rgba(0, 229, 255, 0.2); }
.red-theme  { --card-color: #ff3a3a; --card-glow: rgba(255, 58, 58, 0.8); --card-glow-low: rgba(255, 58, 58, 0.2); }


/* =========================================
   RADAR CLICK HINT (INTERNO)
   ========================================= */
.click-hint-radar {
    position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
    font-family: 'Courier New', monospace; font-size: 0.75rem; color: var(--card-color, #00e5ff);
    letter-spacing: 2px; font-weight: bold; white-space: nowrap;
    opacity: 0; transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none; display: flex; align-items: center; justify-content: center;
}

.tech-card:hover .click-hint-radar { opacity: 1; right: 50px; }

.radar-ping {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 0; height: 0; border-radius: 50%; border: 2px solid var(--card-color);
    opacity: 0; z-index: 1;
}

.tech-card:hover .radar-ping { animation: radarWave 2s infinite ease-out; }

@keyframes radarWave {
    0% { width: 10px; height: 10px; opacity: 0.8; border-width: 3px; }
    100% { width: 140px; height: 140px; opacity: 0; border-width: 1px; }
}

@media (max-width: 500px) { .click-hint-radar { display: none; } }


/* =========================================
   SEÑALIZACIÓN SCROLL (HUD INFERIOR)
   ========================================= */
.scroll-hud-indicator {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    z-index: 100; display: flex; align-items: center; gap: 15px;
    opacity: 0.7; pointer-events: none;
    --hud-color: #00e5ff; --hud-glow: rgba(0, 229, 255, 0.5);
    transition: all 0.5s ease;
}

.scroll-hud-indicator.red-theme-active { --hud-color: #ff3a3a; --hud-glow: rgba(255, 58, 58, 0.5); }

.hud-line {
    width: 40px; height: 1px; background: linear-gradient(90deg, transparent, var(--hud-color), transparent);
    transition: background 0.5s ease;
}

.hud-text {
    color: var(--hud-color); font-family: 'Courier New', monospace; font-size: 0.75rem;
    letter-spacing: 2px; display: flex; flex-direction: column; align-items: center; gap: 5px;
    text-shadow: 0 0 5px var(--hud-glow); transition: color 0.5s ease, text-shadow 0.5s ease;
}
.hud-arrow { font-size: 1rem; animation: bounceArrow 1.5s infinite; }
@keyframes bounceArrow { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(5px); opacity: 1; } }


/* =========================================
   HUD MODAL (VERSIÓN CINE - GRANDE)
   ========================================= */

#prog-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 5000; opacity: 0; pointer-events: none;
    background: rgba(0, 5, 10, 0.85);
    transition: opacity 0.4s ease;
    display: flex; justify-content: center; align-items: center;
}
#prog-modal-overlay.active { opacity: 1; pointer-events: auto; }

.hud-container {
    /* MODIFICACIÓN: Modal mucho más grande */
    width: 96vw; 
    max-width: 1920px; 
    height: 85vh; /* Ocupa 85% de la altura */
    
    display: flex; 
    gap: 30px; 
    perspective: 2000px; 
    transform-style: preserve-3d;
    align-items: stretch; 
}

/* CAJAS COMUNES */
.hud-box {
    position: relative; flex-grow: 1; flex-shrink: 0;
    transform-style: preserve-3d; 
    transform: translateZ(0); 
    opacity: 0;
    background: transparent; box-shadow: none; border: none;
    transition: transform 0.1s; 
}

#prog-modal-overlay.active .hud-box { opacity: 1 !important; transform: none; }


/* === CAPA DE FONDO VISUAL === */
.hud-panel-bg {
    position: absolute; inset: 0; z-index: 0;
    
    background: rgba(5, 10, 15, 0.95);
    border: 2px solid var(--modal-color, #00e5ff);
    
    /* Glow interno sutil base */
    box-shadow: inset 0 0 60px rgba(0,0,0,0.8);
    backdrop-filter: blur(20px);
    
    /* El Recorte */
    clip-path: polygon(
        30px 0, calc(100% - 30px) 0, 
        100% 30px, 100% calc(100% - 30px), 
        calc(100% - 30px) 100%, 30px 100%, 
        0 calc(100% - 30px), 0 30px
    );
    
    pointer-events: none; 
    transition: border-color 0.3s, background-color 0.3s, filter 0.3s;
}

/* GLOW AL HACER HOVER EN LA CAJA */
.hud-box:hover .hud-panel-bg {
    border-color: #fff;
    background: rgba(15, 25, 35, 1);
    filter: drop-shadow(0 0 20px var(--modal-glow));
}


/* === CONTENIDO INTERNO === */
.info-content-wrapper { 
    position: relative; 
    z-index: 20; 
    height: 100%; 
    padding: 40px; 
    display: flex; flex-direction: column; 
    transform-style: preserve-3d; 
}

/* VIDEO BOX - PRIORIDAD MAXIMA */
.video-box { 
    flex: 4; /* El video toma 4 veces más espacio */
    min-width: 0; /* Previene desbordamiento flex */
}

/* BRACKETS DECORATIVOS */
.hud-bracket { position: absolute; width: 50px; height: 50px; border: 3px solid var(--modal-color); box-shadow: 0 0 15px var(--modal-glow); z-index: 10; pointer-events: none; }
.top-left { top: 15px; left: 15px; border-right: none; border-bottom: none; }
.top-right { top: 15px; right: 15px; border-left: none; border-bottom: none; }
.bottom-left { bottom: 15px; left: 15px; border-right: none; border-top: none; }
.bottom-right { bottom: 15px; right: 15px; border-left: none; border-top: none; }

/* === VIDEO CONTAINER NUEVO (VERSIÓN BLINDADA + CINE) === */
.video-content-area { 
    width: 96%; height: 96%; 
    background: #000; 
    border: 1px solid rgba(255,255,255,0.1); 
    position: relative; overflow: hidden; z-index: 5; 
    
    /* Flexbox para centrar a la fuerza */
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

/* VIDEO/IMAGEN AJUSTES - CON !IMPORTANT PARA EVITAR RESETS */
.hud-video-content {
    /* Forzamos al video a usar sus dimensiones naturales */
    width: 100% !important; 
    height: 100% !important; 
    
    /* Pero le prohibimos salirse del contenedor */
    max-width: 100% !important; 
    max-height: 100% !important; 
    
    /* Aseguramos que se vea entero */
    object-fit: contain !important; 
    
    display: block; 
    margin: 0 auto; 
    
    background: #000;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.video-placeholder { 
    width: 100%; height: 100%; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    color: var(--modal-color); font-family: monospace; letter-spacing: 3px; 
    background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, #000 120%); 
}

/* IMPORTANTE: pointer-events: none permite clic en controles */
.scan-line { 
    position: absolute; top: 0; left: 0; width: 100%; height: 3px; 
    background: var(--modal-color); opacity: 0.5; 
    animation: scanMove 4s linear infinite; 
    box-shadow: 0 0 20px var(--modal-glow); 
    pointer-events: none !important; 
}

@keyframes scanMove { 0% { top: -10%; } 100% { top: 110%; } }
.video-icon { font-size: 5rem; margin-bottom: 20px; text-shadow: 0 0 30px var(--modal-glow); }

/* INFO BOX - MENOR TAMAÑO PERO LEGIBLE */
.info-box { 
    flex: 1; 
    min-width: 350px; /* Asegura que no se aplaste */
    max-width: 500px;
}

.hud-controls { margin-bottom: 10px; }
.back-text-btn { background: transparent; border: none; color: #fff; font-family: 'Courier New', monospace; font-size: 0.8rem; letter-spacing: 2px; cursor: pointer; padding: 0; opacity: 0.6; transition: 0.3s; position: relative; z-index: 30; pointer-events: auto; }
.back-text-btn:hover { opacity: 1; color: var(--modal-color); text-shadow: 0 0 10px var(--modal-glow); }

/* BOTÓN CERRAR - UBICACIÓN FIJA */
.modal-close-btn {
    position: absolute; 
    top: -15px; 
    right: -15px; 
    z-index: 5000; 
    width: 40px; height: 40px; 
    background: #000; 
    border: 2px solid var(--modal-color); 
    color: #fff; border-radius: 50%;
    font-size: 1.5rem; line-height: 1; 
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    transition: 0.3s; 
    box-shadow: 0 0 15px var(--modal-glow); 
    pointer-events: auto !important; 
    transform: translateZ(100px); 
}

.modal-close-btn:hover { 
    background: var(--modal-color); 
    color: #000; 
    transform: translateZ(100px) scale(1.1); 
}

/* TEXTOS Y DETALLES */
.info-header-tech { border-bottom: 2px solid var(--modal-color); padding-bottom: 20px; margin-bottom: 25px; }
#modal-title { font-size: 2.8rem; color: #fff; margin: 0; line-height: 0.9; text-transform: uppercase; letter-spacing: -1px; }
#modal-subtitle { color: var(--modal-color); font-size: 0.9rem; letter-spacing: 4px; margin-top: 10px; display: block; opacity: 0.8; }
.info-scroll-area { flex-grow: 1; overflow-y: auto; padding-right: 15px; pointer-events: auto; }
#modal-desc { color: #ccc; font-size: 1.1rem; line-height: 1.6; margin-bottom: 30px; }
.tech-divider { display: flex; align-items: center; margin: 25px 0 15px 0; color: var(--modal-color); font-size: 0.8rem; letter-spacing: 3px; font-weight: bold; }
.tech-divider::after { content: ''; flex-grow: 1; height: 2px; background: var(--modal-color); margin-left: 15px; opacity: 0.3; }
.tags-row { display: flex; flex-wrap: wrap; gap: 10px; }
.extra-visuals { display: flex; gap: 15px; margin-top: 15px; }
.visual-slot { width: 90px; height: 60px; border: 1px dashed var(--modal-color); color: #666; display: flex; justify-content: center; align-items: center; font-size: 0.7rem; transition: 0.3s; cursor: pointer; border-radius: 6px; }
.visual-slot:hover { background: var(--modal-color); color: #000; box-shadow: 0 0 20px var(--modal-glow); transform: scale(1.1); }

/* =========================================
   BOTÓN "INICIAR SISTEMA"
   ========================================= */
.info-footer { 
    margin-top: 30px; 
    position: relative; 
    z-index: 100; 
    transform-style: preserve-3d; 
}

.cyber-btn-mega {
    display: flex; justify-content: center; align-items: center; 
    width: 100%; padding: 22px 0; 
    text-decoration: none;
    
    background: rgba(0, 0, 0, 0.4); 
    color: var(--modal-color); 
    border: 2px solid var(--modal-color);
    
    font-weight: 900; font-size: 1.2rem; letter-spacing: 4px;
    font-family: 'Courier New', monospace; text-transform: uppercase;
    
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1); 
    position: relative; overflow: visible; 
    
    cursor: pointer;
    pointer-events: auto !important; 
    transform: translateZ(50px); 
}

.cyber-btn-mega::before { 
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; 
    background: var(--modal-color); transform: skewX(-20deg); transition: left 0.3s ease; z-index: -1; 
}

.cyber-btn-mega:hover { 
    color: #000; border-color: #fff; background: transparent;
    box-shadow: 0 0 30px var(--modal-glow), 0 0 60px var(--modal-color), inset 0 0 20px rgba(255,255,255,0.5); 
    transform: translateZ(60px) scale(1.02); 
}

.cyber-btn-mega:hover::before { left: -10%; width: 120%; }
.btn-content { position: relative; z-index: 2; transition: color 0.2s; pointer-events: none; }

.btn-glare {
    position: absolute; top: 0; left: -100%; width: 50px; height: 100%;
    background: rgba(255,255,255,0.8); transform: skewX(-20deg);
    opacity: 0; transition: 0s; pointer-events: none; z-index: 5;
}
.cyber-btn-mega:hover .btn-glare { animation: btnFlash 0.5s linear; }

@keyframes btnFlash {
    0% { left: -100%; opacity: 0; }
    50% { opacity: 1; }
    100% { left: 200%; opacity: 0; }
}

@keyframes fadeInSimple { to { opacity: 1; } }
@keyframes titleExit { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -150%) scale(0.5); filter: blur(10px); } }

/* RESPONSIVE */
@media (max-width: 1100px) {
    .hud-container { flex-direction: column; height: 90vh; width: 95vw; overflow-y: auto; }
    .video-box { height: 300px; flex: none; width: 100%; }
    .info-box { height: auto; flex: none; width: 100%; min-height: 500px; }
}