:root {
    --bg-color: #050510;
    --card-bg: rgba(20, 20, 35, 0.6);
    --primary: #00f2ff;
    --secondary: #7000ff;
    --accent: #ff0055;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --success: #00ff9d;
    --error: #ff0055;
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Orbitron', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(112, 0, 255, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 242, 255, 0.15) 0%, transparent 20%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography Utils */
h1,
h2,
h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(0, 242, 255, 0.3);
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.highlight {
    color: var(--primary);
    font-weight: 600;
}

.trick-text {
    color: var(--secondary);
    font-style: italic;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

header {
    padding: 1rem 0;
    /* Reduced padding */
    border-bottom: 1px solid rgba(0, 242, 255, 0.1);
    background: rgba(5, 5, 16, 0.95);
    /* More opaque */
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.logo {
    font-weight: 900;
    font-size: 1.4rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

.logo span {
    color: var(--primary);
}

/* ===== HEADER & NAVBAR ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Logo Left, Controls Right */
    height: 100%;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* Space between Badge and Burger */
}

/* HAMBURGER (GLOBAL) */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
}

/* HAMBURGER BARS */
.bar {
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    /* Cyan Color */
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px var(--primary);
}

/* Adjust Badge for Header */
.badge-rank {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    border: 1px solid var(--success);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    background: rgba(0, 255, 157, 0.05);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.1);
    white-space: nowrap;
    /* Prevent breaking */
}

@media (max-width: 600px) {
    .badge-rank {
        display: none;
        /* Hide badge on very small screens if needed, or reduce padding */
    }
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* OFF-CANVAS MENU (GLOBAL) */
.nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    /* Sidebar Width */
    height: 100vh;
    background: rgba(5, 5, 20, 0.99);
    /* Deep background */
    border-left: 1px solid rgba(0, 242, 255, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Start from top */
    align-items: flex-start;
    /* Align left */
    padding: 6rem 1.5rem 2rem 1.5rem;
    /* Top padding for header space */
    gap: 0.5rem;
    transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(30px);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.9);
    z-index: 1001;
    overflow-y: auto;
}

.nav-links.active {
    right: 0;
}

.nav-links a {
    font-size: 0.95rem;
    text-transform: none;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(0, 242, 255, 0.05);
    /* Subtle glow */
    color: var(--primary);
    border-color: rgba(0, 242, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.05);
    transform: translateX(5px);
}

/* SIDEBAR COMPONENTS */
.sidebar-section {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--secondary);
    /* Purple accent */
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    display: block;
    width: 100%;
    opacity: 0.9;
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    width: 100%;
    margin: 0.5rem 0;
}

/* Hero Section (Portada) */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
}

.hero-content {
    max-width: 900px;
    z-index: 2;
}

.hero-tag {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    border: 1px solid var(--primary);
    display: inline-block;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 10px var(--primary);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin: 1.5rem auto 3rem;
    max-width: 700px;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    text-align: left;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    text-decoration: none;
    display: block;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px) scale(1.02);
    border-color: var(--secondary);
}

.card-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.card-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- FEEDBACK & TERMINAL BOXES --- */
.feedback {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    display: none;
    animation: fadeIn 0.5s ease;
    border-left: 4px solid transparent;
    background: rgba(0,0,0,0.5); /* Asegurar fondo oscuro */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.feedback.correct {
    background: rgba(0, 255, 157, 0.1);
    border-left-color: var(--success);
    color: var(--success);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
}

.feedback.wrong {
    background: rgba(255, 0, 85, 0.1);
    border-left-color: var(--error);
    color: var(--error);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.2);
}

/* --- NEW INPUT STYLES --- */
.input-group-dark {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group-dark label {
    color: #a0a0b0;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.input-wrapped {
    background: #0d0d15;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.5rem;
    transition: border-color 0.3s;
}

.input-wrapped:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

.input-wrapped input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    outline: none;
}

.upload-area-modern {
    background: #050508;
    border: 1px dashed #333;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-upload-modern {
    background: linear-gradient(90deg, #6a00ff, #00d2ff);
    border: none;
    border-radius: 50px;
    padding: 1rem 3rem;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 20px rgba(106, 0, 255, 0.3);
}

.btn-upload-modern:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(106, 0, 255, 0.5);
}

/* --- CYBER TIMELINE --- */
.step-timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 2rem;
}

.step-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent);
}

.step-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    transition: transform 0.3s;
}

.step-item:hover {
    transform: translateX(10px);
    border-color: var(--primary);
    background: rgba(0, 242, 255, 0.05);
}

.step-number {
    position: absolute;
    left: -42px;
    top: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

.step-title {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
    display: block;
    font-family: var(--font-heading);
}

/* --- TERMINAL BOX --- */
.terminal-box {
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    position: relative;
    margin-top: 1rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.terminal-header {
    background: #222;
    padding: 5px 10px;
    font-size: 0.8rem;
    color: #888;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
}

.terminal-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #111;
}

.terminal-row span:last-child {
    color: var(--success);
    font-weight: bold;
}

/* Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }
}

/* --- CYBER TABLES --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #222;
}

th {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary);
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

tr:last-child td {
    border-bottom: none;
}

/* --- GAMIFICATION BADGES --- */
.badge-rank {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
}

.badge-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
}

/* --- PROFESSOR MODE --- */
.professor-mode {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--success);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.professor-mode::before {
    content: "PROFESSOR_AI_V2.0";
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--success);
    opacity: 0.7;
    font-family: monospace;
}

.step-card {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out;
}

.step-card h4 {
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    font-family: var(--font-heading);
}

.step-visual {
    background: #111;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    color: #ddd;
    margin-top: 0.5rem;
    border: 1px dashed #444;
}

.highlight-bits {
    color: var(--secondary);
    font-weight: bold;
}

/* --- ENHANCED CALCULATOR UI --- */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.calc-input-wrapper {
    position: relative;
}

.calc-input-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.calc-toggle-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.calc-toggle-btn.active {
    background: var(--primary);
    color: black;
    box-shadow: 0 0 15px var(--primary);
}

/* --- GAME MODES --- */
.game-mode-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;
}

.mode-btn:hover,
.mode-btn.active {
    background: var(--secondary);
    border-color: var(--secondary);
    box-shadow: 0 0 15px var(--secondary);
    transform: translateY(-2px);
}

/* --- TOOLTIPS --- */
.info-tooltip {
    border-bottom: 1px dotted var(--text-muted);
    cursor: help;
    position: relative;
    margin-left: 5px;
    font-size: 0.8rem;
}

.info-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--primary);
    color: white;
    padding: 0.8rem;
    width: 250px;
    font-size: 0.8rem;
    border-radius: 4px;
    z-index: 100;
    pointer-events: none;
    line-height: 1.4;
}

/* =================================================================
   TACTICAL HUD DESIGN (NUEVOS ESTILOS PARA LA ZONA DE COMBATE)
   ================================================================= */

/* 1. Contenedor Principal de la Misión */
.tactical-board {
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid var(--primary);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.1);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
    position: relative;
    animation: scanline 0.5s ease-in-out;
}

.tactical-board::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 5px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    opacity: 0.5;
}

/* 2. Cabecera (Título de la Misión) */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* 3. Enunciado del Problema */
.hud-mission {
    background: rgba(0, 242, 255, 0.05);
    border-left: 4px solid var(--secondary);
    padding: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 300;
}

.hud-mission strong {
    color: var(--success);
    font-weight: 700;
}

/* 4. Secciones del Formulario (Cajas con título solapado) */
.hud-section {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    transition: border-color 0.3s;
}

.hud-section:hover {
    border-color: var(--primary);
}

.hud-section-title {
    position: absolute;
    top: -10px;
    left: 20px;
    background: #050510; /* Color de fondo igual al body para tapar el borde */
    padding: 0 10px;
    color: var(--text-muted);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: bold;
    text-transform: uppercase;
}

/* 5. Grid de Inputs */
.hud-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.hud-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hud-field label {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.hud-field input {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    color: #fff;
    padding: 0.8rem;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    border-radius: 4px;
    transition: all 0.3s;
    outline: none;
    text-align: center;
}

.hud-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
    transform: scale(1.02);
}

/* Feedback Visual en Inputs */
.hud-field input.correct {
    border-color: var(--success);
    background: rgba(0, 255, 157, 0.1);
    color: var(--success);
}

.hud-field input.wrong {
    border-color: var(--error);
    background: rgba(255, 0, 85, 0.1);
    color: var(--error);
    animation: shake 0.4s;
}

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

/* 6. Botones (Generalizados) */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-family: 'Orbitron', sans-serif;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.6);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
}

/* 7. Explicaciones del Profesor (Al fallar) */
.explanation-card {
    background: rgba(0,0,0,0.8);
    border: 1px solid var(--error);
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 8px;
    animation: fadeIn 0.5s;
}

.explanation-step {
    border-left: 2px solid var(--primary);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.explanation-step h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.explanation-step p {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.math-highlight {
    color: var(--secondary);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--primary);
    font-size: 1.2rem;
    font-family: 'Orbitron';
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* --- AI TACTICAL BOT (N.E.T.O.) --- */
.bot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: radial-gradient(circle, #00f2ff 0%, #000 100%);
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 2rem;
    animation: pulse-glow 3s infinite;
}

.bot-widget:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 40px rgba(0, 242, 255, 0.8);
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 10px rgba(0, 242, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(0, 242, 255, 0.8);
    }

    100% {
        box-shadow: 0 0 10px rgba(0, 242, 255, 0.4);
    }
}

.bot-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: rgba(5, 10, 15, 0.95);
    border: 1px solid var(--primary);
    border-radius: 12px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 242, 255, 0.1);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5) translateY(50px);
}

.bot-window.open {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

/* Header */
.bot-header {
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.1), transparent);
    padding: 1rem;
    border-bottom: 1px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--primary);
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--primary);
}

/* Chat Body */
.bot-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Scrollbar styling */
.bot-body::-webkit-scrollbar {
    width: 6px;
}

.bot-body::-webkit-scrollbar-track {
    background: #000;
}

.bot-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* Messages */
.msg {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 0.9rem;
    position: relative;
    animation: msg-pop 0.3s ease;
}

@keyframes msg-pop {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.msg.bot {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary);
    border-top-left-radius: 0;
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
}

.msg.user {
    background: linear-gradient(135deg, var(--secondary), #4a00e0);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
    box-shadow: 0 5px 15px rgba(112, 0, 255, 0.3);
}

/* Footer */
.bot-footer {
    padding: 1rem;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    background: #050508;
}

.bot-input {
    flex: 1;
    background: #111;
    border: 1px solid #333;
    color: white;
    font-family: 'Inter', sans-serif;
    outline: none;
    padding: 0.8rem;
    border-radius: 50px;
    transition: border-color 0.3s;
}

.bot-input:focus {
    border-color: var(--primary);
}

.bot-send {
    background: var(--primary);
    border: none;
    color: #000;
    cursor: pointer;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.bot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary);
}

/* ... (existing styles) ... */

/* --- TACTICAL ASCII REPORT --- */
.ascii-report {
    background-color: #000;
    color: #cccccc;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    padding: 2rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    white-space: pre; /* Mantiene el formato de espacios y saltos de línea */
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.2;
    box-shadow: inset 0 0 30px rgba(0, 50, 0, 0.5);
    margin-top: 1.5rem;
}

.ascii-title {
    color: var(--primary); /* Cyan */
    font-weight: bold;
}

.ascii-green {
    color: var(--success); /* Green */
    font-weight: bold;
}

.ascii-yellow {
    color: #ffcc00;
}

.ascii-dim {
    color: #555;
}

.ascii-bin-one {
    color: var(--primary);
    font-weight: bold;
}

.ascii-bin-zero {
    color: #444;
}