/* UniApp - Estilos Globais Mobile-First e Componentes */

:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: auto;
    -webkit-user-select: auto;
}

/* Scrollbar invisível ou suave */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 4px;
}

/* Pulsar do radar no mapa do motorista e na busca do passageiro */
@keyframes radar-pulse {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.3;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.radar-ping {
    animation: radar-pulse 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Marcadores customizados no Leaflet */
.leaflet-car-marker {
    transition: transform 0.3s ease-out;
}

/* Leaflet Dark Mode Tiles Filter */
.dark-tiles .leaflet-tile {
    filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

/* Bottom Sheet Suave */
.bottom-sheet {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.15);
}

/* Ícone Flutuante / Modo Miniaturizado */
.floating-overlay {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: bounce-in 0.4s ease-out;
}

/* Ponto Localizador do Usuário Estilo Oficial 99 (Bolinha branca com núcleo azul e setinha direcional) */
.user-locator-puck-99 {
    position: relative;
    width: 48px;
    height: 48px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.puck-99-rotator {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.puck-99-pulse-circle {
    transform-origin: 24px 24px;
    animation: user-puck-ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Marcadores de Origem, Destino e Parada */
.custom-map-pin-container {
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    height: auto;
    will-change: transform;
}

.pin-bubble-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(0);
}

.pin-tag-bubble {
    font-size: 11px;
    font-weight: 800;
    padding: 3.5px 10px;
    border-radius: 9999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    margin-bottom: 2px;
    border: 2px solid #ffffff;
    display: inline-flex;
    align-items: center;
    max-width: max-content;
    overflow: visible;
    pointer-events: none;
    line-height: 1.3;
}

.pin-svg-drop {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    display: flex;
    justify-content: center;
    margin-top: -2px;
}

/* Notificação Push In-App Flutuante (Estilo Top Banner 99/Uber) */
.in-app-push-toast {
    position: fixed;
    top: 14px;
    left: 14px;
    right: 14px;
    max-width: 420px;
    margin: 0 auto;
    z-index: 99999;
    background: #ffffff;
    color: #0f172a;
    border-radius: 20px;
    padding: 12px 16px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    cursor: pointer;
}

.in-app-push-toast.show {
    transform: translateY(0);
    opacity: 1;
}

@keyframes user-puck-ping {
    0% { transform: scale(0.5); opacity: 0.9; }
    100% { transform: scale(2.4); opacity: 0; }
}

@keyframes bounce-in {
    0% { transform: scale(0.3); opacity: 0; }
    80% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); }
}

/* Stacking Order: Garante que os marcadores do mapa NUNCA sobreponham modais, gavetas e painéis */
.mapboxgl-marker, .car-marker-container {
    z-index: 10 !important;
}
#uberRideModalContainer,
#modalPreFinishRide,
#ratePassengerModal,
#driverChatModal,
#modalAddStop,
#driverMenuDrawer,
#driverDrawerOverlay,
#customAppConfirmModal {
    z-index: 99999 !important;
}
