* {
    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: #FFFFFF;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 10;
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* 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: #0047ab;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.logo {
    width: 80%;
    height: auto;
    max-height: 80%;
    display: block;
    object-fit: cover;
}

/* ==========================================
   BARRA DE CONTROLES ENTRE EL LOGO Y EL MAPA
   ========================================== */
.barra-controles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 999;
    position: relative;
    flex-shrink: 0;
}

#tipo-vehiculo,
#seguir-movil {
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #cccccc;
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    font-weight: 600;
    outline: none;
    height: 34px;
}

#tipo-vehiculo {
    flex-shrink: 0;
}

#seguir-movil {
    flex: 1;
    min-width: 0;          /* permite que se achique en pantallas chicas */
    max-width: 320px;
    text-overflow: ellipsis;
}

#tipo-vehiculo:focus,
#seguir-movil:focus {
    border-color: #0047ab;
}

#btn-ubicacion {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    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; }

/* Menú Lateral Desplegable */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px; /* Oculto por defecto a la izquierda */
    width: 280px;
    height: 100%;
    background-color: rgba(0, 71, 171, 0.50); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease-in-out;
    padding: 60px 20px;
}

/* Clase activa que inyecta 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;
}

.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
   ========================================== */

.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;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.modal-active {
    opacity: 1;
    pointer-events: auto;
}

.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;
}

.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;
}

.modal-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-buttons-horizontal {
    display: flex;
    gap: 10px;
}

.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;
}

.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;
}




.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;
}

.popup-badge-estado.libre {
    background-color: #007bff;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.popup-badge-estado.ocupado {
    background-color: #dc3545;
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

.popup-info-line {
    margin-top: 3px;
    font-size: 13px;
    color: #333333;
}


.popup-whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0047ab;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.popup-whatsapp-link:hover {
    color: #128c7e;
    text-decoration: underline;
}

.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;
}

.popup-avatar {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #0047ab;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}



.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;
}



/* ==========================================
   DISEÑO DE POPUP COMPACTO EN COLUMNAS
   ========================================== */

.popup-tabla-layout {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
}

.popup-celda-foto {
    vertical-align: middle;
    padding-right: 12px;
    width: 75px;
}

.popup-celda-info {
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
}

.popup-avatar-horizontal {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #0047ab;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    display: block;
}

.popup-avatar-horizontal.tiene-foto {
    cursor: pointer;
    transition: transform 0.2s ease;
}
.popup-avatar-horizontal.tiene-foto:hover {
    transform: scale(1.05);
}

.popup-fila-superior {
    display: block;
    margin-bottom: 6px;
    line-height: 20px;
}

.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; }

.popup-renglon-datos {
    font-size: 13px;
    color: #333333;
    margin-bottom: 4px;
    line-height: 1.2;
}

.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;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    transition: color 0.2s ease;
}

.modal-link-underline:hover {
    color: #003380;
}




.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 {
        height: 90px; 
        background-color: #FFFFFF;
        overflow: hidden;
        display: flex;
        align-items: center;
    }

    .header-content {
        width: 100%;
        height: 100%;
        flex-direction: row;
        justify-content: center;
    }

    .logo {
        height: 90px; 
        width: auto;
        object-fit: contain;
        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);
    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;
}

.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;
    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;
} */


#map-container {
    flex: 1;
    width: 100%;
    position: relative;
}

/* Barra del último mensaje, flotando sobre el mapa */
.barra-ultimo-mensaje {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: rgba(135, 206, 250, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    padding: 8px 14px;
    cursor: pointer;
    z-index: 998;
}

.ultimo-mensaje-fila-usuario {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.barra-ultimo-mensaje .ultimo-mensaje-usuario {
    font-size: 11px;
    font-weight: 700;
    color: #00376b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-mostrar-mas {
    font-size: 11px;
    font-weight: 700;
    color: #00376b;
    background-color: rgba(255, 255, 255, 0.65);
    border: none;
    border-radius: 5px;
    padding: 2px 8px;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}

.barra-ultimo-mensaje .ultimo-mensaje-texto {
    font-size: 14px;
    color: #12222f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.barra-ultimo-mensaje .ultimo-mensaje-texto.expandido {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    word-break: break-word;
}
