:root {
    /* --- PALETA DE COLORES --- */
    --color-primary: #0A2463;
    --color-primary-dark: #051130;
    --color-accent: #00E5FF;
    --color-accent-hover: #00B2C7;
    --color-white: #FFFFFF;
    --color-text-body: #E0E0E0;
    --color-text-muted: #94A3B8;

    /* --- VARIABLES DE EFECTOS --- */
    --glass-bg: rgba(10, 25, 65, 0.92);
    --glass-border: rgba(0, 229, 255, 0.25);
    --shadow-glow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* --- TIPOGRAFÍA --- */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 1. RESET Y BASES --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html { 
    scroll-behavior: smooth; 
    scrollbar-width: thin; 
    scrollbar-color: var(--color-accent) var(--color-primary-dark); 
}

body { 
    font-family: var(--font-body); 
    background-color: var(--color-primary-dark); 
    color: var(--color-text-body); 
    line-height: 1.6; 
    overflow-x: hidden; 
    -webkit-font-smoothing: antialiased; 
}

/* --- 2. POPUP PERSONALIZADO (Estilo Glassmorphism Oscuro) --- */
.cyber-popup .maplibregl-popup-content,
.maplibregl-popup-content,
div.cyber-popup {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid var(--glass-border) !important;
    padding: 12px 14px !important;
    box-shadow: var(--shadow-glow) !important;
    border-radius: 10px !important;
    min-width: 310px !important;
}

/* Textos e información base en blanco (excluyendo la X) */
.cyber-popup *:not(.maplibregl-popup-close-button),
.maplibregl-popup-content *:not(.maplibregl-popup-close-button) {
    color: #ffffff;
}

/* Nombre del vehículo en color cian */
.cyber-popup .maplibregl-popup-content h3,
.maplibregl-popup-content h3 {
    color: var(--color-accent) !important;
    -webkit-text-fill-color: var(--color-accent) !important;
    font-weight: 900 !important;
    font-size: 14px !important;
    margin-bottom: 4px !important;
    text-transform: uppercase;
}

/* Etiquetas internas (ÚLTIMA HORA, IGNICIÓN, BATERÍA, etc.) */
.maplibregl-popup-content b,
.maplibregl-popup-content strong,
.cyber-popup .maplibregl-popup-content b,
.cyber-popup .maplibregl-popup-content strong {
    font-weight: 800 !important;
    font-size: 11px !important;
    color: var(--color-text-muted) !important;
    -webkit-text-fill-color: var(--color-text-muted) !important;
    text-transform: uppercase !important;
}

/* Líneas divisorias sutiles */
.cyber-popup div[style*="border-top"],
.cyber-popup div[style*="border-bottom"] {
    border-color: rgba(0, 229, 255, 0.2) !important;
}

/* Botón MAPS */
.cyber-popup a[href*="maps"],
.maplibregl-popup-content a[href*="maps"] {
    background-color: var(--color-accent) !important;
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
    font-weight: bold !important;
}

/* Botones inferiores (GEOCERCA, COMPARTIR, etc.) */
.maplibregl-popup-content button:not(.maplibregl-popup-close-button),
.cyber-popup button:not(.maplibregl-popup-close-button),
.maplibregl-popup-content a:not([href*="maps"]),
.cyber-popup a:not([href*="maps"]) {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    font-weight: 800 !important;
}

/* --- GLOBO DE VELOCIDAD (KM/H) --- */
.maplibregl-popup-content div[style*="border-radius: 50%"],
.cyber-popup div[style*="border-radius: 50%"] {
    background-color: #000000 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 2px solid #F2E016 !important; /* Borde azul #F2E016 con 2px de grosor */
}

.maplibregl-popup-content div[style*="border-radius: 50%"] * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* --- BOTÓN DE CERRAR (X) FORZADO EN AMARILLO #F2E016 --- */
button.maplibregl-popup-close-button,
.maplibregl-popup-close-button { 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #F2E016 !important;
    -webkit-text-fill-color: #F2E016 !important;
    font-size: 26px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    padding: 2px 8px !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    z-index: 9999 !important;
}

/* Forzar color amarillo en el caracter tipográfico y elementos vectoriales internos */
button.maplibregl-popup-close-button *,
.maplibregl-popup-close-button * {
    color: #F2E016 !important;
    -webkit-text-fill-color: #F2E016 !important;
    fill: #F2E016 !important;
}

button.maplibregl-popup-close-button:hover,
.maplibregl-popup-close-button:hover {
    color: #00E5FF !important;
    -webkit-text-fill-color: #00E5FF !important;
    background: rgba(5, 35, 232, 0.15) !important;
    border-radius: 4px !important;
}

/* Flecha apuntadora del popup */
.cyber-popup .maplibregl-popup-tip,
.maplibregl-popup-tip { 
    border-top-color: rgba(10, 25, 65, 0.92) !important; 
}

/* Ocultar etiquetas flotantes duplicadas sobre los vehículos */
.maplibregl-marker .maplibregl-popup,
.maplibregl-marker-title,
.traccar-marker-title {
    display: none !important;
}

/* --- 3. ESTILOS DE UI COMPLEMENTARIOS --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 10px;
}

.btn {
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 20px;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-primary-dark);
}

/* --- 4. CORRECCIONES MUI (Autocomplete y Menús) --- */
.MuiAutocomplete-paper,
.MuiPaper-root.MuiMenu-paper {
    background-color: #040e2a !important;
    color: #ffffff !important;
    border: 1px solid rgba(0, 229, 255, 0.3) !important;
}

.MuiMenuItem-root:hover {
    background-color: rgba(0, 229, 255, 0.1) !important;
}

/* --- 5. COMPONENTES GENERALES --- */
.navbar.scrolled {
    background: rgba(5, 17, 48, 0.95);
    backdrop-filter: blur(15px);
}

.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}
/* --- FORZAR TEXTO NEGRO EN HORA Y VELOCIDAD EN POPUP --- */
.cyber-popup .maplibregl-popup-content,
.maplibregl-popup-content,
.cyber-popup .maplibregl-popup-content span,
.maplibregl-popup-content span,
.cyber-popup .maplibregl-popup-content div,
.maplibregl-popup-content div,
.cyber-popup .maplibregl-popup-content p,
.maplibregl-popup-content p,
.cyber-popup .maplibregl-popup-content b,
.maplibregl-popup-content b,
.cyber-popup .maplibregl-popup-content strong,
.maplibregl-popup-content strong {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}