/* css/style.css */
:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #00ffcc;
    --accent-secondary: #7b2cbf;
    --glass-bg: rgba(25, 25, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        linear-gradient(rgba(5, 5, 5, 0.85), rgba(5, 5, 5, 0.95)),
        url('../imagenes/fondo_tech.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 50px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 1.5px;
    color: var(--text-color);
}

.logo-container .logo {
    height: 50px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
    transition: transform 0.3s;
}

.logo-container:hover .logo {
    transform: scale(1.05);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 300;
    transition: color 0.3s;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a:hover {
    color: #fff;
}

.btn-login {
    border: 1px solid var(--glass-border);
    padding: 8px 20px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
}
.btn-login:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-color);
}

/* Secciones Comunes */
.section {
    min-height: 100vh;
    padding: 100px 20px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 50px;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, #555);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Hero Section */
.hero-section {
    text-align: center;
    overflow: hidden;
}

.hero-content {
    z-index: 10;
    max-width: 800px;
}

.hero-section h1 {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(45deg, var(--accent-secondary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    font-size: 1.2rem;
    font-weight: 300;
    color: #aaa;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-scroll {
    display: inline-block;
    padding: 15px 40px;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    border-radius: 30px;
    border: 1px solid var(--accent-color);
    background: rgba(0, 255, 204, 0.05);
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.2);
}

.btn-scroll:hover {
    background: rgba(0, 255, 204, 0.2);
    box-shadow: 0 0 25px rgba(0, 255, 204, 0.4);
    transform: translateY(-3px);
}

/* Animaciones del Canvas y orbes */
.glow-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(123,44,191,0.4) 0%, transparent 60%);
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    filter: blur(50px);
    z-index: 1;
    animation: pulse 8s infinite alternate;
    pointer-events: none;
}

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); opacity: 0.5; }
    100% { transform: translateX(-50%) scale(1.2); opacity: 0.8; }
}

.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

/* About Section */
.grid-about {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    padding: 40px 30px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    text-align: center;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0, 255, 204, 0.1);
    border-color: rgba(0, 255, 204, 0.3);
}

.card .icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-family: monospace;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.card p {
    color: #999;
    font-weight: 300;
    font-size: 1rem;
}

/* Contact Section */
.contact-subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 40px;
    font-weight: 300;
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
}

.input-group {
    margin-bottom: 25px;
}

input, textarea {
    width: 100%;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-secondary);
    background: rgba(0,0,0,0.5);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-main);
}

.btn-submit:hover {
    background: var(--accent-color);
    box-shadow: 0 0 15px rgba(0,255,204,0.4);
}

.form-status {
    margin-top: 15px;
    text-align: center;
    font-weight: 300;
}

.form-status.success { color: var(--accent-color); }
.form-status.error { color: #ff3366; }

/* ==================================
   NUEVAS SECCIONES ABSTRACTAS
   ================================== */

/* Manifesto (Máquina de escribir) */
.manifesto-box { padding: 60px; max-width: 800px; margin: 0 auto; text-align: left; min-height: 200px; }
.typewriter-content { font-family: monospace; font-size: 1.5rem; color: #00ffcc; display: inline; }
.cursor { font-family: monospace; font-size: 1.5rem; color: #00ffcc; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Telemetría */
.telemetry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.telemetry-card { padding: 30px; text-align: center; }
.telemetry-card h4 { color: #fff; margin-bottom: 15px; font-weight: 400; }
.progress-bar { width: 100%; height: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; margin: 15px 0; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-color); transition: width 0.3s ease; }
.telemetry-val { font-family: monospace; font-size: 1.2rem; color: #aaa; }
.telemetry-big-val { font-family: monospace; font-size: 4rem; color: #ff3366; font-weight: 700; margin-top: 10px; line-height: 1; }

/* Terminal Interactiva */
.terminal-window { max-width: 800px; margin: 0 auto; background: rgba(10, 10, 15, 0.95); border: 1px solid #333; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.8); transition: all 0.3s ease; }
.terminal-window.maximized { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; max-width: none; z-index: 10000; border-radius: 0; margin: 0; border: none; background: #000; }
.terminal-window.maximized .terminal-body { height: calc(100vh - 100px); flex: 1; }
.terminal-header { background: #222; padding: 10px 15px; display: flex; align-items: center; border-bottom: 1px solid #333; position: relative; }
.terminal-header .btn-close, .terminal-header .btn-min, .terminal-header .btn-max { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; cursor: pointer; transition: transform 0.2s; }
.terminal-header .btn-close:hover, .terminal-header .btn-min:hover, .terminal-header .btn-max:hover { transform: scale(1.2); }
.btn-close { background: #ff5f56; } .btn-min { background: #ffbd2e; } .btn-max { background: #27c93f; }
.terminal-title { position: absolute; left: 50%; transform: translateX(-50%); color: #888; font-family: monospace; font-size: 0.9rem; white-space: nowrap; }
.terminal-body { padding: 20px; font-family: monospace; color: #0f0; height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 0.95rem; text-align: left; }
.terminal-log { margin: 0; }
.terminal-input-line { display: flex; padding: 0 20px 20px; font-family: monospace; color: #0f0; align-items: center; }
.prompt { margin-right: 10px; color: #00ffcc; }
#terminal-input { background: transparent; border: none; color: #0f0; font-family: monospace; font-size: 0.95rem; width: 100%; outline: none; }
#terminal-input::placeholder { color: rgba(0, 255, 204, 0.3); }

/* Galería Glitch */
.glitch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.glitch-card { background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border); padding: 50px 30px; text-align: center; position: relative; overflow: hidden; transition: 0.3s; border-radius: 12px; }
.glitch-card h3 { color: #fff; margin-bottom: 10px; }
.glitch-card p { color: #888; font-size: 0.95rem; }
.glitch-card::before {
    content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color); color: var(--accent-color); font-family: monospace; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0s; z-index: 2;
    border-radius: 12px;
}
.glitch-card:hover::before {
    opacity: 1;
    animation: glitch-anim 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}
@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-5px, 5px); color: #ff3366; }
    40% { transform: translate(-5px, -5px); color: #00ffcc; }
    60% { transform: translate(5px, 5px); color: #fff; }
    80% { transform: translate(5px, -5px); color: #7b2cbf; }
    100% { transform: translate(0); }
}

/* Test de Turing */
.turing-box { text-align: center; padding: 60px; max-width: 800px; margin: 0 auto; }
.turing-box h2 { color: var(--accent-color); margin-bottom: 20px; font-size: 2.2rem; }
.turing-box p { font-size: 1.2rem; color: #ddd; margin-bottom: 40px; }
.turing-buttons { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.turing-buttons button { cursor: pointer; background: rgba(255,255,255,0.05); }
.turing-response { font-family: monospace; color: #00ffcc; font-size: 1.2rem; margin-top: 30px; border: 1px solid var(--accent-color); padding: 20px; border-radius: 8px; background: rgba(0,255,204,0.05); }

/* Modal 404 Hack */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-window { width: 90%; max-width: 800px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.8); animation: dropIn 0.4s ease; }
.hack-window { background: #f4f4f4; border: 1px solid #ccc; }
.hack-content { padding: 50px; text-align: center; color: #333; font-family: sans-serif; }
@keyframes dropIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--glass-border);
    color: #666;
    font-weight: 300;
    font-size: 0.9rem;
}

/* Responsividad */
@media (max-width: 768px) {
    /* Ajustes generales de espaciado */
    .section { padding: 100px 15px 40px; }
    .section-title { font-size: 2rem; margin-bottom: 40px; }
    
    /* Hero y tipografías */
    .hero-section h1 { font-size: 2.5rem; }
    .hero-section p { font-size: 1rem; }
    
    /* Header: ocultar menú, centrar logo */
    header { padding: 10px 15px; background: rgba(5, 5, 5, 0.95); }
    header.scrolled { padding: 10px 15px; }
    nav { display: none; }
    .logo-container { width: 100%; justify-content: center; gap: 8px; flex-wrap: nowrap; }
    .logo-container .logo { height: 32px; }
    .logo-text { display: inline-block; font-size: 1.05rem; text-align: center; white-space: nowrap; }
    
    /* Rejillas a 1 columna */
    .grid-about { grid-template-columns: 1fr; }
    .telemetry-grid { grid-template-columns: 1fr; }
    .glitch-grid { grid-template-columns: 1fr; }
    
    /* Ocultar la consola en dispositivos móviles */
    #terminal { display: none; }
    
    /* Ajustes de cajas para que no desborden */
    .card, .manifesto-box, .telemetry-card, .turing-box, .glitch-card, .form-container {
        padding: 25px 15px;
    }
    
    .typewriter-content { font-size: 1.2rem; }
    
    /* Botones apilados en el Test de Turing */
    .turing-buttons { flex-direction: column; width: 100%; }
    .turing-buttons button { width: 100%; }
}

/* ==================================
   ADMIN LAYOUT (SIDEBAR)
   ================================== */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg-color); }
.admin-sidebar { width: 220px; background: #0a0a0c; border-right: 1px solid #222; transition: width 0.3s ease; display: flex; flex-direction: column; z-index: 100; flex-shrink: 0; }
.sidebar-header { display: flex; align-items: center; padding: 20px; border-bottom: 1px solid #222; height: 70px; overflow: hidden; justify-content: flex-start; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; width: 100%; }
.sidebar-logo { width: 30px; flex-shrink: 0; }
.sidebar-title { font-weight: 700; white-space: nowrap; font-size: 1.1rem; }
.btn-toggle { background: transparent; border: none; color: #aaa; font-size: 1.2rem; cursor: pointer; flex-shrink: 0; }
.btn-toggle:hover { color: var(--accent-color); }
.sidebar-nav { padding: 15px 0; display: flex; flex-direction: column; gap: 5px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav a { display: flex; align-items: center; gap: 15px; padding: 12px 20px; color: #aaa; text-decoration: none; transition: 0.2s; white-space: nowrap; border-left: 3px solid transparent; }
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1.2rem; flex-shrink: 0; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(0,255,204,0.05); color: var(--accent-color); border-left-color: var(--accent-color); }
.admin-main { flex: 1; padding: 30px; overflow-y: auto; overflow-x: hidden; }
.admin-topbar { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #222; padding-bottom: 20px; }
.admin-topbar h2 { margin: 0; font-size: 1.8rem; }

/* Collapsed state */
.admin-layout.sidebar-collapsed .admin-sidebar { width: 70px; }
.admin-layout.sidebar-collapsed .sidebar-title, 
.admin-layout.sidebar-collapsed .nav-text { display: none !important; opacity: 0; width: 0; visibility: hidden; }
.admin-layout.sidebar-collapsed .sidebar-header { justify-content: center; padding: 20px 0; }
.admin-layout.sidebar-collapsed .sidebar-brand { justify-content: center; gap: 0; }
.admin-layout.sidebar-collapsed .sidebar-nav a { padding: 15px 0; justify-content: center; gap: 0; }

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.modal-body {
    flex: 1;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.iframe-container {
    flex: 1;
    position: relative;
    background: #000;
    margin-top: 15px;
}

#hack-iframe {
    width: 100%;
    height: 100%;
    border: none;
    transition: all 2s ease-in-out;
    filter: grayscale(0) blur(0);
    opacity: 1;
}

#hack-iframe.fade-out {
    opacity: 0.1;
    filter: grayscale(1) blur(10px);
    transform: scale(1.05);
}

.overlay-404 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    /* Oculto inicialmente */
    transition: opacity 1.5s ease-in-out;
}

.overlay-404.show {
    opacity: 1;
}

.error-404-content {
    text-align: center;
    transform: translateY(20px);
    transition: transform 1.5s ease-out;
}

.overlay-404.show .error-404-content {
    transform: translateY(0);
}

.error-404-content h1 {
    font-size: 8rem;
    color: #ff3366;
    margin: 0;
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

.glitch-line {
    height: 2px;
    background: var(--accent-color);
    width: 100%;
    margin-top: 10px;
    animation: glitch-line 2s infinite;
}

@keyframes glitch-line {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    50% {
        transform: scaleX(1);
        opacity: 1;
    }

    100% {
        transform: scaleX(0);
        opacity: 0;
    }
}

/* Utilidades de Visibilidad Responsive */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}

/* ============================================================
   ESTILOS DEL MODAL DE HACKEO (SISTEMA DE INFILTRACIÓN)
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-content {
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    border: 1px solid var(--accent-color);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 255, 204, 0.2);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.modal-body {
    flex: 1;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.iframe-container {
    flex: 1;
    position: relative;
    background: #000;
    margin-top: 15px;
}

#hack-iframe {
    width: 100%;
    height: 100%;
    border: none;
    transition: all 2s ease-in-out;
    filter: grayscale(0) blur(0);
    opacity: 1;
}

#hack-iframe.fade-out {
    opacity: 0.1;
    filter: grayscale(1) blur(10px);
    transform: scale(1.05);
}

.overlay-404 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.overlay-404.show {
    opacity: 1;
}

.error-404-content {
    text-align: center;
    transform: translateY(20px);
    transition: transform 1.5s ease-out;
}

.overlay-404.show .error-404-content {
    transform: translateY(0);
}

.error-404-content h1 {
    font-size: 8rem;
    color: #ff3366;
    margin: 0;
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

.glitch-line {
    height: 2px;
    background: var(--accent-color);
    width: 100%;
    margin-top: 10px;
    animation: glitch-line 2s infinite;
}

@keyframes glitch-line {
    0% { transform: scaleX(0); opacity: 0; }
    50% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(0); opacity: 0; }
}
