* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Encabezado */
.main-header {
    width: 100%;
    background-color: #0047ab; /* CAMBIADO: Antes #0047ab (Azul), ahora Negro */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 0; /* CAMBIADO: Quitamos el padding (antes 12px 0) para eliminar el espacio de arriba */
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* CAMBIADO: Quitamos el espacio interno entre elementos hijos */
}

/* NUEVO: Bot車n Hamburguesa */
.hamburger-btn {
    position: absolute;
    left: 15px;
    top: 15px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 20px;
    z-index: 1001;
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.logo {
    width: 80%;
    height: auto;
    max-height: 80%; /* Permite que se adapte al contenedor */
    display: block;
    object-fit: cover;
}

.selector-container {
    position: absolute;
    /* Ahora 15px significa: "15 píxeles abajo del borde superior del mapa" */
    top: 15px; 
    left: 50%;
    transform: translateX(-50%);
    
    /* El resto de tus estilos se mantienen igual */
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999; /* Asegura que flote sobre las capas de Leaflet */
    background-color: rgba(255, 255, 255, 0.95); 
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: auto;
    max-width: 90%;
}

.selector-container label {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

#tipo-vehiculo {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ffffff;
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    font-weight: 600;
    outline: none;
}

#btn-ubicacion {
    width: 34px;
    height: 34px;
    background-color: #ffffff;
    border: none;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
}

#btn-ubicacion:hover { background-color: #e0e0e0; }
#btn-ubicacion img { width: 20px; height: 20px; object-fit: contain; }

/* NUEVO: Estilos del Menu Lateral Desplegable */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px; /* Oculto por defecto a la izquierda */
    width: 280px;
    height: 100%;
    /* Fondo azul corporativo con transparencia (0.85) */
    background-color: rgba(0, 71, 171, 0.50); 
    /* Efecto moderno de desenfoque detr芍s del men迆 */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000; /* Por encima de todo, incluido el mapa */
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease-in-out; /* Animaci車n fluida de deslizamiento */
    padding: 60px 20px;
}

/* Clase activa que inyectar芍 JS para mostrar el men迆 */
.side-menu.active {
    left: 0;
}

/* Bot車n de cerrar dentro del men迆 */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
}

.menu-items {
    list-style: none;
    margin-top: 10px;
}

.menu-items li {
    margin-bottom: 10px;
}

.menu-items li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    display: block;
    padding: 10px 15px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

/* Efecto al pasar el cursor sobre los items */
.menu-items li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Popups e Interactivos del Mapa... */
.popup-botones-container { display: flex; flex-direction: column; gap: 8px; padding-top: 5px; }
.btn-popup { padding: 6px 10px; font-size: 12px; font-weight: bold; border: none; border-radius: 4px; cursor: pointer; text-align: center; }
.btn-pedir { background-color: #0047ab; color: white; }
.btn-quitar { background-color: #dc3545; color: white; }

/* Mapa */
#map-container { flex: 1; width: 100%; position: relative; }
#map { width: 100%; height: 100%; }

/* Marcadores de Veh赤culos... */
.marcador-movil-container { display: flex; justify-content: center; align-items: center; width: 50px; height: 50px; }
.marcador-circulo { width: 24px; height: 24px; background-color: #007bff; border: 3px solid #ffffff; border-radius: 50%; display: flex; justify-content: center; align-items: center; box-shadow: 0 0 12px rgba(0, 123, 255, 0.6); z-index: 2; position: relative; }
.marcador-circulo::after { content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%; background-color: rgba(0, 123, 255, 0.5); animation: pulsar-onda 1.8s infinite ease-out; z-index: -1; }
.marcador-circulo.ocupado { background-color: #dc3545; box-shadow: 0 0 12px rgba(220, 53, 69, 0.6); }
.marcador-circulo.ocupado::after { background-color: rgba(220, 53, 69, 0.5); }
.marcador-flecha { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid #ffffff; transition: transform 0.3s ease-in-out; }
@keyframes pulsar-onda { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }







/* ==========================================
   ESTILOS PARA LOS MODALES
   ========================================== */

/* Fondo oscuro translúcido que cubre toda la pantalla */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 3000; /* Por encima del menú lateral y del mapa */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Clase activa para mostrar el modal */
.modal-overlay.modal-active {
    opacity: 1;
    pointer-events: auto;
}

/* Caja contenedora del contenido del modal */
.modal-content {
    background-color: #ffffff;
    width: 90%;
    max-width: 320px;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.modal-active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    font-size: 18px;
    color: #333333;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Estructura de campos de texto (inputs) */
.modal-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-inputs input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #cccccc;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-inputs input:focus {
    border-color: #0047ab;
}

/* Distribución de botones */
.modal-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-buttons-horizontal {
    display: flex;
    gap: 10px;
}

/* Botón base del modal */
.btn-modal {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex: 1;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #0047ab;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #003380;
}

.btn-secondary {
    background-color: #f1f1f1;
    color: #555555;
}

.btn-secondary:hover {
    background-color: #e2e2e2;
}

/* Enlace de registro inferior */
.modal-link {
    display: inline-block;
    color: #0047ab;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
}

.modal-link:hover {
    text-decoration: underline;
}




/* Contenedor del estado para darle un aspecto de botón/badge */
.popup-badge-estado {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    color: #ffffff;
    border-radius: 4px;
    margin-bottom: 8px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Estado Libre (Fondo Azul) */
.popup-badge-estado.libre {
    background-color: #007bff;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

/* Estado Ocupado (Fondo Rojo) */
.popup-badge-estado.ocupado {
    background-color: #dc3545;
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

/* Estilo de espaciado interno para los renglones de información */
.popup-info-line {
    margin-top: 3px;
    font-size: 13px;
    color: #333333;
}


/* Contenedor del enlace de WhatsApp para alinearlo con el texto */
.popup-whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px; /* Espacio entre el texto y el icono */
    color: #0047ab; /* Color azul corporativo para el enlace */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.popup-whatsapp-link:hover {
    color: #128c7e; /* Cambia a un tono verde de WhatsApp al pasar el cursor */
    text-decoration: underline;
}

/* Icono de WhatsApp */
.icon-whatsapp {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}



/* ==========================================
   ESTILOS PARA LA FOTO DEL CONDUCTOR EN POPUP
   ========================================== */
.popup-avatar-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #eeeeee; /* Línea divisoria sutil */
}

.popup-avatar {
    width: 70px;
    height: 70px;
    object-fit: cover; /* Asegura que la foto no se deforme */
    border-radius: 50%; /* Foto completamente circular */
    border: 2px solid #0047ab; /* Borde azul corporativo */
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}



/* ==========================================
   ESTILOS PARA EL EFECTO CLICK EN LA FOTO
   ========================================== */
.popup-avatar.tiene-foto {
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.popup-avatar.tiene-foto:hover {
    transform: scale(1.05);
    border-color: #007bff; /* Resalta el borde al pasar el mouse */
}



/* ==========================================
   NUEVO DISEÑO DE POPUP COMPACTO EN COLUMNAS
   ========================================== */

/* Contenedor principal en formato tabla */
.popup-tabla-layout {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
}

/* Celda de la izquierda (Foto) */
.popup-celda-foto {
    vertical-align: middle;
    padding-right: 12px; /* Espacio entre la foto y el texto */
    width: 75px; /* Ancho fijo para la columna de la foto */
}

/* Celda de la derecha (Información) */
.popup-celda-info {
    vertical-align: middle;
    text-align: left;
    white-space: nowrap; /* Evita saltos de línea raros en patentes o nombres cortos */
}

/* Estilo para la Foto Circular */
.popup-avatar-horizontal {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #0047ab; /* Borde azul corporativo */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    display: block;
}

/* Permitir clic en la foto */
.popup-avatar-horizontal.tiene-foto {
    cursor: pointer;
    transition: transform 0.2s ease;
}
.popup-avatar-horizontal.tiene-foto:hover {
    transform: scale(1.05);
}

/* Contenedor en línea para el Badge de Estado y la Patente en el mismo renglón */
.popup-fila-superior {
    display: block;
    margin-bottom: 6px;
    line-height: 20px;
}

/* Ajuste del Badge de Estado para que se alinee con el texto */
.popup-badge-estado-inline {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    color: #ffffff;
    border-radius: 4px;
    margin-right: 6px;
    text-transform: uppercase;
    vertical-align: middle;
}

.popup-badge-estado-inline.libre { background-color: #007bff; }
.popup-badge-estado-inline.ocupado { background-color: #dc3545; }

/* Renglones de texto comunes (Nombre, Teléfono) */
.popup-renglon-datos {
    font-size: 13px;
    color: #333333;
    margin-bottom: 4px;
    line-height: 1.2;
}

/* Enlace de WhatsApp idéntico a la imagen */
.popup-whatsapp-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0047ab;
    text-decoration: none;
    font-weight: bold;
    vertical-align: middle;
}

.popup-whatsapp-link-inline:hover {
    text-decoration: underline;
    color: #128c7e;
}

.icon-whatsapp-inline {
    width: 15px;
    height: 15px;
    object-fit: contain;
    vertical-align: middle;
}



/* ==========================================
   ESTILOS PARA EL ENLACE SUBRAYADO
   ========================================== */
.modal-link-underline {
    color: #0047ab;
    text-decoration: underline; /* Fuerza el subrayado solicitado */
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    transition: color 0.2s ease;
}

.modal-link-underline:hover {
    color: #003380; /* Tono de azul más oscuro al pasar el cursor */
}




.spinner-cargando {
    width: 50px;
    height: 50px;
    margin: auto;
    border: 5px solid #ddd;
    border-top: 5px solid #0047ab;
    border-radius: 50%;
    animation: girarSpinner 1s linear infinite;
}

@keyframes girarSpinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}




#modal-esperando {
    z-index: 9999;
}




/* ==========================================================================
   Ajustes para Pantallas Grandes (PC y Notebooks)
   ========================================================================== */
@media (min-width: 768px) {
    .main-header {
        /* Limitamos la altura total del contenedor azul en PC */
        height: 90px; 
        background-color: #0047ab; /* CAMBIADO: Asegura el fondo negro también en PC */
        overflow: hidden;
        display: flex;
        align-items: center;
    }

    .header-content {
        width: 100%;
        height: 100%;
        flex-direction: row; /* Alinea horizontalmente el contenido en PC si fuera necesario */
        justify-content: center;
    }

    .logo {
        /* Limitamos la altura del logo para que no se coma la pantalla */
        height: 90px; 
        width: auto; /* Cambia a auto para que no se estire a lo ancho artificialmente */
        object-fit: contain; /* Evita que la imagen se corte en los bordes */
        margin: 0 auto;
    }
}





#visor-foto {
    display: none; /* Se cambia a 'flex' por JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Fondo negro semitransparente */
    justify-content: center;
    align-items: center;
    z-index: 4000;
}



.popup-badge-estado-inline.en-camino {
    background-color: #ffc107;
    color: #000000;
}






/* Contenedor del registro */
#registro-lista {
    max-height: 380px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Tabla estilo Excel */
.tabla-registro {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 480px; /* permite scroll horizontal en móvil */
}

.tabla-registro thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.tabla-registro thead tr {
    background-color: #0047ab;
    color: #ffffff;
}

.tabla-registro th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-right: 1px solid #1a5fd4;
}

.tabla-registro th:last-child {
    border-right: none;
}

.tabla-registro td {
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    color: #333;
    white-space: nowrap;
}

.tabla-registro td:last-child {
    border-right: none;
    white-space: normal; /* la dirección puede wrappear */
    min-width: 140px;
}

.tabla-registro tbody tr:nth-child(even) {
    background-color: #f5f8ff;
}

.tabla-registro tbody tr:hover {
    background-color: #e8efff;
}









.mensaje-item {
    padding: 10px 14px;
    margin: 6px 4px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mensaje-item:hover {
    background-color: #f0f4ff;
}

.mensaje-texto {
    font-size: 14px;
    color: #222;
    line-height: 1.4;
    text-align: left;
}

.mensaje-meta {
    font-size: 11px;
    color: #888;
    text-align: right;
}

.mensaje-meta.conductor {
    color: #0047ab;
    font-weight: 600;
}

.mensaje-meta.pasajero {
    color: #555;
}





#banner-ciudad {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 71, 171, 0.85);
    color: #ffffff;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 0;
    letter-spacing: 0.5px;
    z-index: 1000;
    pointer-events: none;
}

/* Asegurarse que map-container tenga posición relativa */
#map-container {
    flex: 1;
    width: 100%;
    position: relative;
}




