/* ========================================
   HACKING MAP - ESTILOS FOTORREALISTAS
   ======================================== */

:root {
    --primary-cyan: #00ffff;
    --primary-magenta: #ff00ff;
    --primary-blue: #0066ff;
    --dark-bg: #0a0e27;
    --darker-bg: #050814;
    --glass-border: rgba(0, 255, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --shadow-glow: 0 0 30px rgba(0, 255, 255, 0.4);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background: #020410;
    position: fixed;
    top: 0;
    left: 0;
}

/* ========================================
   MENÚ FLOTANTE
   ======================================== */

.menu-bar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 60px;
    border: 1px solid var(--glass-border);
    padding: 15px 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), var(--shadow-glow);
    transition: var(--transition-smooth);
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 30px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.menu-item i {
    font-size: 1.4rem;
}

.menu-item span {
    position: absolute;
    left: 70px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
    color: var(--darker-bg);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-15px);
    transition: var(--transition-smooth);
    pointer-events: none;
    box-shadow: var(--shadow-glow);
}

.menu-item:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--primary-cyan);
    transform: scale(1.05);
}

.menu-item:hover span {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
    color: var(--darker-bg);
    box-shadow: var(--shadow-glow);
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--primary-cyan);
    cursor: pointer;
    z-index: 1001;
    transition: var(--transition-smooth);
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

.globe-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0a0e27 0%, #020410 100%);
}

#globeCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    outline: none;
}

/* ========================================
   PANEL ESTADÍSTICAS
   ======================================== */

.stats-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    z-index: 100;
    min-width: 260px;
    max-width: 320px;
    transition: var(--transition-smooth);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.05), rgba(255, 0, 255, 0.05));
    border-radius: 20px 20px 0 0;
}

.stats-header h3 {
    font-size: 0.8rem;
    color: var(--primary-cyan);
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 700;
}

.stats-minimize {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    transition: var(--transition-smooth);
    border-radius: 8px;
}

.stats-minimize:hover {
    color: var(--primary-cyan);
    background: rgba(0, 255, 255, 0.1);
}

.stats-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 350px;
    padding: 0 20px 20px 20px;
}

.stats-panel.minimized .stats-content {
    max-height: 0;
    padding: 0 20px;
}

.attack-counter {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 15px 0;
    text-align: center;
    font-family: 'Inter', monospace;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 255, 255, 0.08);
    font-size: 0.9rem;
}

.stat-label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.stat-value {
    color: var(--primary-cyan);
    font-weight: 700;
    font-family: monospace;
    font-size: 1.1rem;
}

/* ========================================
   CONTROLES
   ======================================== */

.map-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 100;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.map-controls button {
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--primary-cyan);
    padding: 12px 22px;
    border-radius: 40px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.map-controls button:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.map-controls button.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
    color: var(--darker-bg);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

/* ========================================
   LEYENDA
   ======================================== */

.legend {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    z-index: 100;
    min-width: 170px;
    transition: var(--transition-smooth);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.03), rgba(255, 0, 255, 0.03));
    border-radius: 20px 20px 0 0;
}

.legend-header h4 {
    font-size: 0.75rem;
    color: var(--primary-cyan);
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 700;
}

.legend-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.legend-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 250px;
    padding: 0 18px 18px 18px;
}

.legend.minimized .legend-content {
    max-height: 0;
    padding: 0 18px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
    padding: 5px 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    box-shadow: 0 0 8px currentColor;
}

.severity {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 800;
    margin-left: auto;
    letter-spacing: 0.5px;
}

.severity.critical {
    background: rgba(255, 51, 102, 0.2);
    color: #ff3366;
    box-shadow: 0 0 8px rgba(255, 51, 102, 0.3);
}

.severity.high {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.3);
}

.severity.medium {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

/* ========================================
   CONTROL VELOCIDAD
   ======================================== */

.speed-control {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
    font-size: 0.85rem;
    color: var(--primary-cyan);
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.speed-control input {
    width: 140px;
    cursor: pointer;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-magenta));
    height: 4px;
    border-radius: 5px;
    -webkit-appearance: none;
}

.speed-control input:focus {
    outline: none;
}

.speed-control input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-cyan);
    cursor: pointer;
    box-shadow: 0 0 12px var(--primary-cyan);
    border: 2px solid white;
}

.coord-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(5, 8, 20, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--primary-cyan);
    border: 1px solid var(--glass-border);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(5, 8, 20, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 2000;
    border: 1px solid var(--glass-border);
    transition: opacity 0.5s ease;
    box-shadow: var(--shadow-glow);
}

.loading-indicator.hide {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 255, 0.2);
    border-top-color: var(--primary-cyan);
    border-right-color: var(--primary-magenta);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-progress {
    width: 200px;
    height: 3px;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-magenta));
    transition: width 0.3s ease;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .menu-bar {
        left: -300px;
        top: 0;
        transform: translateY(0);
        height: 100vh;
        border-radius: 0;
        padding: 80px 20px 30px;
        gap: 10px;
        width: 280px;
    }
    
    .menu-bar.active {
        left: 0;
    }
    
    .menu-item {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 20px;
        border-radius: 14px;
    }
    
    .menu-item span {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: none;
        color: var(--text-secondary);
        padding: 0;
        margin-left: 15px;
        box-shadow: none;
    }
    
    .stats-panel {
        top: 10px;
        right: 10px;
        min-width: 180px;
    }
    
    .attack-counter {
        font-size: 2rem;
    }
    
    .map-controls button span {
        display: none;
    }
    
    .map-controls button {
        padding: 10px 14px;
    }
    
    .speed-control {
        bottom: 10px;
        padding: 6px 16px;
    }
    
    .speed-control input {
        width: 100px;
    }
    
    .coord-panel {
        bottom: 10px;
        right: 10px;
        font-size: 0.65rem;
        padding: 5px 12px;
    }
}
/* ========================================
   SELECTOR DE CALIDAD
   ======================================== */

.quality-selector {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    padding: 6px;
    display: flex;
    gap: 5px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.quality-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.quality-btn:hover {
    color: var(--primary-cyan);
}

.quality-btn.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
    color: var(--darker-bg);
}

@media (max-width: 768px) {
    .quality-selector {
        top: auto;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        padding: 4px;
    }
    
    .quality-btn {
        padding: 4px 12px;
        font-size: 0.65rem;
    }
}