/* style.css */
:root {
    --bg-color: #050a14;
    --primary-color: #00f3ff; /* Cian eléctrico */
    --accent-color: #ff0055;  /* Rosa neón */
    --warning-color: #ffff00; /* Amarillo para Modo Edición */
    --text-main: #e0e6ed;
    --text-dim: #8b9bb4;
    --glass-bg: rgba(5, 10, 20, 0.90);
}

body, html {
    width: 100%; height: 100%; margin: 0; padding: 0;
    overflow: hidden;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    touch-action: pan-x pan-y;
}

/* --- Cesium Clean Up --- */
#cesiumContainer { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }
.cesium-viewer-animationContainer, .cesium-viewer-timelineContainer,
.cesium-viewer-bottom, .cesium-viewer-fullscreenContainer, 
.cesium-viewer-toolbar, .cesium-widget-credits { display: none !important; }

/* --- UI Overlay --- */
#ui-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: none;
    display: flex; flex-direction: column;
}

header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 3rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 100%);
    pointer-events: auto;
}
.logo { font-family: 'Orbitron', sans-serif; font-size: 1.8rem; font-weight: 700; letter-spacing: 2px; }
.highlight { color: var(--primary-color); text-shadow: 0 0 10px var(--primary-color); }

.nav-btn {
    background: transparent; border: none; color: var(--text-dim);
    font-family: 'Orbitron', sans-serif; margin: 0 15px; cursor: pointer;
    font-size: 0.9rem; transition: 0.3s;
}

/* BARRA DE BÚSQUEDA */
.search-bar {
    position: absolute; top: 6rem; left: 3rem;
    display: flex; pointer-events: auto; z-index: 20;
}
.search-bar input {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--text-dim); border-right: none;
    color: white; padding: 12px 15px;
    font-family: 'Rajdhani', sans-serif; font-size: 1rem;
    width: 250px; outline: none; backdrop-filter: blur(5px);
}
.search-bar button {
    background: var(--glass-bg); border: 1px solid var(--primary-color);
    color: var(--primary-color); font-family: 'Orbitron', sans-serif;
    padding: 0 20px; cursor: pointer; font-weight: bold;
}

/* NUEVO: LISTA DINÁMICA DE SITIOS (Lado Derecho) */
.visible-spots-container {
    position: absolute;
    top: 180px; /* Debajo de los controles rápidos */
    right: 0;
    width: 220px;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    pointer-events: none; /* Dejar pasar clicks fuera de los items */
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 15;
}

.spot-item {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-right: 3px solid var(--primary-color);
    padding: 10px 15px;
    color: var(--text-main);
    text-align: right;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateX(20px); /* Efecto entrada */
    opacity: 0.8;
    margin-right: 10px; /* Espacio desde el borde */
    border-radius: 4px 0 0 4px;
}

.spot-item:hover {
    transform: translateX(0);
    background: var(--primary-color);
    color: black;
    opacity: 1;
    box-shadow: -5px 0 15px rgba(0, 243, 255, 0.3);
}

.spot-item strong { display: block; font-family: 'Orbitron', sans-serif; font-size: 0.9rem; }
.spot-item span { font-size: 0.75rem; opacity: 0.8; }


/* BOTONES RÁPIDOS (Ajustados) */
.quick-controls {
    position: absolute; top: 120px; right: 20px; /* Ajustado arriba */
    display: flex;
    flex-direction: row; /* CORREGIDO: flex-direction en lugar de flex-row */
    gap: 10px;
    pointer-events: auto;
    justify-content: flex-end;
}
.quick-controls button {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer; backdrop-filter: blur(4px);
    font-size: 1.1rem; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
}

/* Estilo especial para el botón "Añadir" cuando está activo */
.quick-controls button.active-mode {
    background: rgba(255, 255, 0, 0.2);
    box-shadow: 0 0 15px var(--warning-color);
    transform: scale(1.1);
}

/* PANEL INFO */
.info-panel {
    position: absolute; top: 25%; left: 3rem;
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-left: 3px solid var(--primary-color);
    padding: 2rem;
    pointer-events: auto;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 90% 100%, 0 100%);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateX(0);
    opacity: 1;
}

.info-panel.hidden {
    transform: translateX(-150%);
    opacity: 0;
    pointer-events: none;
}

.info-panel h2 {
    font-family: 'Orbitron', sans-serif; color: var(--primary-color);
    border-bottom: 1px solid rgba(255,255,255,0.1); margin-top: 0; padding-right: 20px;
}

.close-btn {
    position: absolute; top: 10px; right: 10px;
    background: none; border: none; color: var(--text-dim);
    font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 5px;
}
.close-btn:hover { color: var(--accent-color); }

/* NOTIFICACIÓN FLOTANTE */
#notification {
    position: fixed; top: 110px; left: 50%; transform: translateX(-50%);
    background: rgba(20, 20, 0, 0.8);
    border: 1px solid var(--warning-color); color: var(--warning-color);
    padding: 10px 20px; border-radius: 50px;
    font-family: 'Orbitron', sans-serif; font-size: 0.9rem;
    z-index: 100; pointer-events: none; backdrop-filter: blur(5px);
    transition: opacity 0.3s;
}
#notification.hidden { opacity: 0; }

.scan-lines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1) 1px, transparent 1px, transparent 3px);
    pointer-events: none; z-index: 20; opacity: 0.2;
}

/* --- MÓVIL --- */
@media (max-width: 768px) {
    header { padding: 1rem; background: rgba(5, 10, 20, 0.95); }
    .desktop-only { display: none; }
    .logo { font-size: 1.4rem; }

    .search-bar {
        position: fixed; top: 60px; left: 5%; width: 90%;
    }
    .search-bar input { width: 100%; font-size: 16px; }

    /* En móvil, la lista de sitios visible se oculta o se reduce mucho para no tapar */
    .visible-spots-container {
        top: 120px;
        width: 160px;
        max-height: 30vh;
        /* Opcional: display: none; si molesta mucho */
    }
    .spot-item { padding: 8px 10px; font-size: 0.8rem; }
    .spot-item strong { font-size: 0.8rem; }

    .quick-controls {
        top: auto; bottom: 40px; right: 15px; 
        flex-direction: column; /* Vuelta a columna en móvil */
        gap: 15px;
    }
    .quick-controls button { width: 50px; height: 50px; font-size: 1.2rem; }

    .info-panel {
        top: auto; bottom: 0; left: 0;
        width: 100%; height: auto; max-height: 50vh;
        border-left: none; border-top: 3px solid var(--primary-color);
        clip-path: none; border-radius: 20px 20px 0 0;
        z-index: 100;
        transform: translateY(0);
    }

    .info-panel.hidden {
        transform: translateY(110%);
        opacity: 1;
    }
}