:root {
    --primary: #FFD700;
    --bg-dark: #121212;
    --surface: rgba(255, 255, 255, 0.05);
    --text-main: #FFFFFF;
    --text-dim: #A0A0A0;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    /* PWA Optimizations */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    /* iOS Touch Optimizations - Elimina delay de 300ms */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    display: flex;
    /* Changed from Grid to Flex for easier centering */
    justify-content: space-between;
    align-items: center;
    padding: calc(10px + env(safe-area-inset-top)) 15px 10px;
    background: rgba(12, 12, 12, 0.95);
    backdrop-filter: blur(20px);
    z-index: 900;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    height: auto;
    min-height: calc(75px + env(safe-area-inset-top));
    /* Slightly taller for stack */
    flex-shrink: 0;
}



/* Centered Brand Container */
.brand-container-centered {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.brand-logo-header {
    width: 30px;
    height: 30px;
    margin-bottom: 2px;
    /* mix-blend-mode removed as image is now transparent */
}

.brand-title-header {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    letter-spacing: -0.5px;
    color: var(--text-light);
}

.brand-subtitle-header {
    font-size: 0.6rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    margin-top: 2px;
}

.brand-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
    margin: 0;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.65rem;
    color: #FFD700 !important;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 900;
    margin-top: 1px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    display: block;
    width: 100%;
    text-align: center;
}

.user-info {
    text-align: right;
}

.user-info h2 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.user-role-tag {
    font-size: 0.65rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}

/* User Box Styles */
.framed-user-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 85px;
    backdrop-filter: blur(5px);
}

.rating-badge-mini {
    font-size: 0.75rem;
    color: #FFD700;
    font-weight: 700;
}

.user-name-mini {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-mini {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.logout-pill {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.25);
    padding: 8px 16px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.05);
}

.logout-pill:hover {
    background: #ff3b30;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 59, 48, 0.35);
    border-color: transparent;
}

.logout-pill:active {
    transform: scale(0.94);
}

.logout-pill span {
    font-size: 1.1rem;
}

/* Auth Styles */
.auth-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;

    background: rgba(0, 0, 0, 0.05) !important;
    /* Cristal limpio */
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;

    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000 !important;
    /* Alto, pero menor que driver-interface (2147...) por si acaso */
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Si el overlay está visible, ocultar todo lo demás por seguridad */
.auth-overlay:not(.hidden)~#app {
    display: none !important;
}

.auth-card {
    width: 95%;
    max-width: 400px;
    text-align: center;
    margin: auto 0;
    padding: 40px 25px;
    border-radius: 32px !important;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-container-auth {
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
    /* Transparent image used */
    background-color: transparent;
    border-radius: 12px;
    /* Suavizar bordes por si acaso */
}

/* Para el header principal, logo más pequeño */
.app-header .brand-logo {
    width: 35px;
    height: 35px;
    margin-bottom: 0;
    margin-right: 10px;
}

.brand-title-auth {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    letter-spacing: -1px;
}

.brand-subtitle-auth {
    font-size: 0.9rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 5px;
    font-weight: 800;
    display: block;
    margin-top: 8px;
    margin-top: 8px;
    margin-bottom: 5px;
}

/* Interfaz del Conductor (Overlay Global) se define más adelante para evitar conflictos */


.auth-tagline {
    color: var(--text-dim);
    margin-bottom: 30px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
}

.tab-btn.active {
    background: var(--primary);
    color: black;
}

.input-group {
    text-align: left;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
}

.auth-msg {
    margin-top: 15px;
    font-size: 0.9rem;
}

.auth-msg.error {
    color: #ff4d4d;
}

.auth-msg.success {
    color: #4CAF50;
}

.map-container {
    flex-grow: 1;
    position: relative;
    background: #1a1a1a;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    touch-action: none;
    /* Crucial para rendimiento en móviles: evita scroll/zoom nativo del navegador */
    -webkit-tap-highlight-color: transparent;
}

/* MAPA PREMIUM NATIVO: Sin filtros. Usamos el diseño profesional original */
.leaflet-tile {
    filter: none !important;
}

.leaflet-container {
    background: #1a1d21 !important;
    /* Color de fondo exacto de Stadia Dark */
}

.motorcycle-icon {
    position: absolute;
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px var(--primary));
    animation: pulse 2s infinite;
    will-change: transform;
    /* Optimización para movimiento suave */
}

.user-location {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 2rem;
    transform: translate(-50%, -50%);
}

.interaction-panel {
    position: fixed;
    top: 70px;
    right: 0;
    width: 380px;
    height: calc(100vh - 70px - 100px);
    /* Restando header y banner */
    z-index: 1000;
    /* MENOR QUE SIDEBAR (10001) Y OVERLAY (10000) */
    pointer-events: none;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 20px;
}

.search-card {
    pointer-events: auto;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 25px;
    border: 1px solid var(--glass-border);
    box-shadow: -10px 10px 40px rgba(0, 0, 0, 0.6);
    width: 100%;
    transform: translateX(0);
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(110%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}


.search-header-split {
    display: flex;
    flex-direction: column;
    /* Stacked on mobile */
    gap: 10px;
    margin-bottom: 15px;
}

.modern-input {
    background: rgba(255, 255, 255, 0.05);
    /* Ultra clean glass */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 100%;
    font-size: 1rem;
    padding: 16px;
    border-radius: 16px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
    pointer-events: auto !important;
    /* Force interactivity */
    z-index: 10;
    /* Ensure above container */
    backdrop-filter: blur(5px);
}

.modern-input:focus {
    border-color: var(--primary);
    background: rgba(255, 215, 0, 0.08);
    /* Subtle gold tint */
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.1);
}

.modern-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

.btn-pick-map {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Solid refined border */
    color: var(--text-light);
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-pick-map span {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
    /* Glowing icon */
}

.btn-pick-map:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 215, 0, 0.2);
}

.btn-pick-map:active {
    transform: scale(0.98);
}

.search-header:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.15);
}


.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 5px;
}

.route-info {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.price-tag {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.2rem;
    min-width: 80px;
    text-align: center;
}

.price-selector {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 5px;
    gap: 10px;
}

.price-btn {
    background: rgba(255, 215, 0, 0.2);
    color: var(--primary);
    border: 1px solid rgba(255, 215, 0, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.price-btn:hover {
    background: var(--primary);
    color: black;
}

.price-btn:active {
    transform: scale(0.9);
}

.action-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
}

#btn-request {
    width: 100%;
    justify-content: center;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.location-marker {
    font-size: 1.2rem;
    margin-right: 12px;
}

.search-container input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
}

.price-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 5px;
}

.btn-cancel-ride-active {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff4d4d, #c0392b);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 800;
    margin-top: 15px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
}

.btn-cancel-ride-active:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.5);
    filter: brightness(1.1);
}

.btn-cancel-ride-active:active {
    transform: scale(0.98);
}

.driver-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: var(--bg-dark);
}

/* Driver Active Panel Styles - OPTIMIZED COMPACT */
.driver-active-panel {
    position: fixed;
    top: 85px;
    /* Más aire arriba */
    left: 10px;
    right: 10px;
    width: auto;
    max-width: 190px;
    /* Reducción lateral adicional % */
    margin: 0 auto;
    height: auto;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    touch-action: none;
}

/* Tarjeta compacta flotante */
.driver-active-panel.glass-dark {
    pointer-events: auto;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 12px 5px;
    /* Más vertical, menos lateral */
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    width: 100%;
}

.active-ride-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    /* Reducido de 20px */
    width: 100%;
}


.status-row-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 5px;
}

.status-text-bold {
    font-size: 0.8rem;
    /* Reducido de 0.9rem */
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}

.pulsing-container-mini {
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-mini-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.client-name-active {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating-badge-active {
    font-size: 0.8rem;
    font-weight: 800;
}

.client-info-minimal {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.destination-info-panel {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    /* Reducido de 12px 15px */
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    /* Reducido */
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.destination-info-panel span:first-child {
    font-size: 1.2rem;
}

.destination-info-panel span:last-child {
    font-size: 1.1rem;
    /* Más grande */
    color: var(--primary);
    /* En dorado para resaltar */
    font-weight: 700;
    text-align: center;
}



/* Definición simplificada de driver-interface movida al final del bloque de navegación */


.header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

#active-client-name-driver {
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    /* Evitar saltos de línea raros */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.btn-complete-premium {
    padding: 12px;
    /* Botón menos alto */
    font-size: 0.9rem;
    width: 100%;
}

.pulsing-container {
    padding: 10px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 50%;
}

.status-dot {
    display: block;
    width: 12px;
    height: 12px;
    background: #2ecc71;
    border-radius: 50%;
}

.pulsing {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

.status-text {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#active-client-name-driver {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.active-ride-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    /* Asegurar que los botones llenen el ancho reducido */
}

.btn-complete-premium {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 12px;
    /* Reducido de 16px */
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.9rem;
    /* Reducido de 1rem */
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
    cursor: pointer;
}


.btn-cancel-simple {
    background: linear-gradient(135deg, #ff4d4d, #d32f2f);
    color: white;
    border: none;
    padding: 10px;
    /* Reducido de 14px */
    border-radius: 12px;
    font-size: 0.8rem;
    /* Reducido de 0.9rem */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(211, 47, 47, 0.15);
}


.btn-cancel-simple:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.btn-request {
    background: linear-gradient(135deg, var(--primary), #FFA500);
    color: black;
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-request.searching {
    background: #333;
    color: var(--primary);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.btn-map-selection {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-msg-small {
    font-size: 0.7rem;
    font-weight: 400;
    margin-top: 2px;
    display: block;
    width: 100%;
}

.btn-request {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Footer Ad Bar (Lateral Inferior Estilizada) */
.fixed-ad-bar {
    position: fixed;
    bottom: 15px;
    left: 12px;
    right: 12px;
    height: 100px;
    /* Aumentado a 100px para máxima visibilidad */
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.4);
    /* Borde más visible */
    z-index: 900;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.1);
}

.ad-scroller {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.ad-item {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 75%;
}

.ad-badge {
    background: #FFD700;
    color: black;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.ad-item p {
    font-size: 1.2rem;
    /* Tamaño aumentado para legibilidad máxima */
    color: #fff;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-premium-mini {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: black;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 900;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.driver-info-panel {
    position: fixed;
    bottom: 130px;
    /* Reposicionado abajo para evitar solapamiento */
    right: 15px;
    width: auto;
    max-width: 280px;
    z-index: 900;
    pointer-events: none;
    touch-action: none;
    /* Crucial for dragging on mobile */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.driver-info-panel.glass {
    pointer-events: auto;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--primary);
    /* Borde dorado para resaltar */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    width: 100%;
}

/* Cabecera de Estado del Viaje */
.ride-status-header {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

#ride-status-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.ride-status-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

#ride-status-title {
    font-size: 1rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#ride-status-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.driver-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
    width: 100%;
}

.driver-meta {
    flex: 1;
    overflow: hidden;
}

.driver-meta h3 {
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.glass-dark {
    background: rgba(10, 10, 10, 0.95) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 32px !important;
}

.ad-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.premium-pill {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: black;
    border: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    white-space: nowrap;
    transition: 0.3s;
}

.premium-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.ads-slider {
    overflow: hidden;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

.ad-item {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.5s ease-out;
}

.ad-label {
    background: var(--primary);
    color: black;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ad-item strong {
    color: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass {
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
}

.sidebar.hidden {
    display: none !important;
}

/* Marcador de cliente pulsante para el conductor */
.client-location-pulsing {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pulse-marker-inner {
    width: 20px;
    height: 20px;
    background: #ff4d4d;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

.pulse-marker-inner::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: rgba(255, 77, 77, 0.4);
    animation: marker-pulse 1.5s ease-out infinite;
}

@keyframes marker-pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Marcadores Premium en Mapa */
.driver-moto-marker {
    font-size: 2rem;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.8));
    transition: all 0.5s ease-out;
    cursor: pointer;
}

.client-pickup-marker {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(255, 77, 77, 0.8));
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Driver Interface Styles */
/* --- Interfaz del Conductor (Incoming Request) --- */
.driver-interface {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    /* Ajuste de caja seguro */
    box-sizing: border-box !important;

    background: rgba(0, 0, 0, 0.05) !important;
    /* Casi transparente para que se vea el mapa */
    backdrop-filter: blur(10px) !important;
    /* Desenfoque más suave, no tan agresivo */
    -webkit-backdrop-filter: blur(10px) !important;
    /* Soporte Apple */

    z-index: 2147483647 !important;
    /* Máximo entero posible en CSS */

    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* Padding interior seguro gracias a box-sizing */

    transition: opacity 0.3s ease;
    /* Transición suave */
    opacity: 1;
    /* Por defecto visible si no tiene .hidden */
}

.driver-interface.hidden {
    display: none !important;
}

.incoming-request-card {
    width: 100%;
    max-width: 420px;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid var(--primary);
    /* Borde dorado característico */
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 215, 0, 0.1);
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}


.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.live-tag {
    background: #ff4d4d;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    animation: blink 1s infinite;
}

#req-timer {
    font-weight: 700;
    color: var(--primary);
}

.request-body {
    text-align: center;
    margin-bottom: 25px;
}

.request-body h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.price-bubble {
    background: var(--primary);
    color: black;
    display: inline-block;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 15px;
}

.btn-accept-premium {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: 0.3s;
}

.btn-accept-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
    filter: brightness(1.1);
}

.btn-cancel {
    background: transparent;
    color: var(--text-dim);
    border: none;
    padding: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.7;
}

.btn-cancel:hover {
    opacity: 1;
    color: #ff4d4d;
}

/* Role Selector Premium */
.role-selector-premium {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 6px;
    gap: 6px;
    margin-top: 8px;
}

.role-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.role-option.active {
    background: rgba(255, 215, 0, 0.15);
    /* Sutil dorado en el fondo */
    border: 1px solid rgba(255, 215, 0, 0.3);
    opacity: 1;
    transform: scale(1.02);
}

.role-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.role-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-option.active .role-label {
    color: var(--primary);
}

.checkbox-group.warning .checkbox-container {
    color: #ff4d4d;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes blink {
    50% {
        opacity: 0.4;
    }
}

/* Sidebar Wrapper - The actual fixed container */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147480000 !important;
    /* MÁXIMA PRIORIDAD ABSOLUTA NUCLEAR - Supera a todo */
    /* MÁXIMA PRIORIDAD ABSOLUTA */
    pointer-events: none;
    /* Dejar pasar clics si está oculto (aunque hidden ya lo hace) */
}

.sidebar.hidden {
    pointer-events: none;
}

.sidebar:not(.hidden) {
    pointer-events: auto;
}

.sidebar-content {
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: var(--bg-dark) !important;
    border-radius: 0 24px 24px 0 !important;
    display: flex;
    flex-direction: column;
    padding: 30px 20px !important;
    position: absolute;
    /* Absolute dentro del fixed sidebar */
    top: 0;
    left: 0;
    z-index: 11001;
    /* Content más arriba */
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

#sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10999;
    /* Entre content y wrapper */
    display: flex;
}

.sidebar-overlay {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 40px;
}

.profile-large {
    font-size: 3.5rem;
    background: var(--surface);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 3px solid var(--primary);
    overflow: hidden;
    /* Asegurar recorte circular perfecto */
}

.profile-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-list li {
    padding: 15px;
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.2s;
}

.menu-list li:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar-footer {
    margin-top: auto;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.ride-info h2 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.ride-info p {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.destination-picker {
    position: relative;
    margin-bottom: 12px;
}

.input-with-icon {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2px 15px;
}

.input-with-icon .icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

.input-with-icon input {
    background: transparent;
    border: none;
    color: white;
    padding: 12px 0;
    width: 100%;
    font-size: 1rem;
    outline: none;
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e1e1e;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 2000;
}

.suggestion-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    font-size: 0.9rem;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--surface);
}

.ride-details {
    padding: 10px 5px;
    border-top: 1px solid var(--glass-border);
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

#ride-price {
    font-size: 1.2rem;
    color: var(--primary);
}

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

.btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-auth-premium,
.btn-yellow-premium {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), #FFB800);
    color: #000;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-auth-premium {
    margin-top: 25px;
}

.btn-green-success {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-red-danger {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff4d4d, #d32f2f);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


.btn-auth-premium:hover,
.btn-yellow-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
    filter: brightness(1.1);
}

.btn-green-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(46, 204, 113, 0.4);
    filter: brightness(1.1);
}

.btn-red-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(211, 47, 47, 0.4);
    filter: brightness(1.1);
}

.btn-auth-premium:active,
.btn-yellow-premium:active,
.btn-green-success:active,
.btn-red-danger:active {
    transform: scale(0.97);
}

.btn-red-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(211, 47, 47, 0.4);
    filter: brightness(1.1);
}

.btn-auth-premium:active,
.btn-yellow-premium:active,
.btn-red-danger:active {
    transform: scale(0.97);
}


/* Checkbox Styles */
.checkbox-group {
    margin-top: 15px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-dim);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    transition: 0.2s;
}

.checkbox-container:hover input~.checkmark {
    background-color: rgba(255, 255, 255, 0.1);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid black;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.ads-container {
    margin-bottom: 20px;
}

.ad-card {
    background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
    padding: 15px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.ad-tag {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 5px;
}

/* Estilos de Valoración Inline y Badges */
.name-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Espacio entre nombre y estrella */
    flex-wrap: wrap;
    width: 100%;
}

.rating-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
    margin-top: 2px;
    /* Alineación fina */
}

/* Estilos de Valoración */
.rating-stars {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.stars {
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.rating-num {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

.plate-info {
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.hidden {
    display: none !important;
}

/* Rating Modal Styles */
.rating-input-container {
    margin: 20px 0;
    text-align: center;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.star {
    cursor: pointer;
    color: var(--text-dim);
    transition: 0.2s;
}

.star-driver {
    cursor: pointer;
    color: var(--text-dim);
    transition: 0.2s;
}

.star-client {
    cursor: pointer;
    color: var(--text-dim);
    transition: 0.2s;
}

.star.active,
.star:hover,
.star-driver.active,
.star-driver:hover,
.star-client.active,
.star-client:hover {
    color: #FFD700;
    transform: scale(1.1);
}

.rating-text {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 700;
    min-height: 24px;
}

/* Ocultar panel de instrucciones de Leaflet Routing Machine */
.leaflet-routing-container {
    display: none !important;
}

/* Custom Confirm Modal Styles */
.confirm-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
    width: 100%;
    padding: 0 10px 10px 10px;
    /* Margen para los botones */
}

.confirm-actions button {
    flex: 1;
}

.animate-pop {
    animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* RESPONSIVE AUTH OPTIMIZATION */
@media (max-height: 700px) {
    .auth-overlay {
        padding: 20px 15px;
    }

    .brand-title-auth {
        font-size: 1.8rem;
    }

    .auth-tagline {
        margin-bottom: 20px;
    }

    .input-group {
        margin-bottom: 12px;
    }

    .btn-auth-premium {
        margin-top: 15px;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 0 10px;
    }
}