/**
 * navigationStyles.css - Estilos do Sistema de Navegação GPS v2.2
 * Compatível com todos os navegadores
 */

/* ============================================
   BARRA DE BUSCA - Dentro do mapa
   ============================================ */

.nav-search-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 1100;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    pointer-events: auto;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Firefox-specific fix */
@-moz-document url-prefix() {
    .nav-search-container {
        display: block !important;
        visibility: visible !important;
    }
}

.nav-search-container.navigating {
    top: auto;
    bottom: 170px;
}

.nav-search-box {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    background: rgba(20, 20, 20, 0.95);
    /* Fallback for browsers without backdrop-filter */
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 0.98));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    padding: 10px 14px;
    -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    -moz-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-search-icon {
    font-size: 16px;
    margin-right: 10px;
    opacity: 0.5;
}

.nav-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.nav-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.nav-search-clear {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-search-clear.hidden {
    display: none;
}

/* ============================================
   RESULTADOS DE BUSCA
   ============================================ */

.nav-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: rgba(25, 25, 25, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-search-results.hidden {
    display: none;
}

.nav-search-history-title {
    padding: 12px 16px 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-search-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-search-item:last-child {
    border-bottom: none;
}

.nav-search-item:hover,
.nav-search-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.nav-search-item-icon {
    font-size: 20px;
    margin-right: 12px;
    opacity: 0.8;
}

.nav-search-item-text {
    flex: 1;
    min-width: 0;
}

.nav-search-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-search-item-address {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.nav-search-empty {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   PAINEL DE NAVEGAÇÃO - Dentro do mapa
   ============================================ */

.nav-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    padding: 16px;
    padding-bottom: 16px;
    z-index: 1000;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.nav-panel.hidden {
    transform: translateY(100%);
    pointer-events: none;
}

.nav-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-instruction-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.nav-instruction-icon {
    width: 50px;
    height: 50px;
    background: #4285F4;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    flex-shrink: 0;
}

.nav-instruction-text {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.nav-instruction-distance {
    font-size: 24px;
    font-weight: 700;
    color: #4285F4;
    text-align: right;
    min-width: 70px;
}

.nav-panel-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 16px;
}

.nav-info-item {
    text-align: center;
}

.nav-info-value {
    display: block;
    font-size: 28px;
    font-weight: 300;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.nav-info-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-panel-actions {
    display: flex;
    gap: 12px;
}

.nav-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn-stop {
    background: rgba(255, 59, 59, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 59, 59, 0.3);
}

.nav-btn-stop:active {
    background: rgba(255, 59, 59, 0.3);
    transform: scale(0.98);
}

/* ============================================
   MARKER DE DESTINO
   ============================================ */

.destination-marker {
    background: transparent !important;
    border: none !important;
}

.dest-marker-pin {
    position: relative;
    width: 40px;
    height: 50px;
}

.dest-marker-icon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: dest-bounce 1s ease-in-out infinite;
}

@keyframes dest-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================
   LOADER
   ============================================ */

.nav-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px 30px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.nav-loader.show {
    opacity: 1;
    visibility: visible;
}

.nav-loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4285F4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.nav-loader span {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   ROTA NO MAPA
   ============================================ */

.leaflet-interactive.route-line {
    stroke: #4285F4;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 380px) {
    .nav-instruction-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .nav-instruction-text {
        font-size: 14px;
    }
    
    .nav-instruction-distance {
        font-size: 20px;
    }
    
    .nav-info-value {
        font-size: 24px;
    }
}

/* ============================================
   MODO NAVEGAÇÃO ATIVA
   ============================================ */

body.navigating .header,
body.navigating .view-tabs,
body.navigating .controls {
    display: none !important;
}

body.navigating #map-view {
    display: flex !important;
}

body.navigating .nav-search-container {
    top: 16px;
}

/* ============================================
   PAINEL DE SELEÇÃO DE ROTAS
   ============================================ */

.route-selection-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0.98) 0%, rgba(10, 10, 10, 1) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    padding: 16px;
    z-index: 1001;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    max-height: 60vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.route-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.route-selection-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.route-selection-title span:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.route-traffic-badge {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.route-selection-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
}

.route-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.route-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.route-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.route-option.selected {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.15);
}

.route-option-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.route-option-time {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.route-option-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.route-option-details {
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.route-distance {
    color: rgba(255, 255, 255, 0.6);
}

.route-delay {
    color: #ff6b6b;
}

.route-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.route-badge {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
}

.route-badge.best {
    background: rgba(66, 133, 244, 0.3);
    color: #4285F4;
}

.route-selection-actions {
    display: flex;
    gap: 12px;
}

.nav-btn-cancel {
    flex: 1;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.nav-btn-go {
    flex: 2;
    background: #4285F4 !important;
    color: #fff !important;
}

.nav-btn-go:active {
    background: #3367d6 !important;
}

/* ============================================
   GPS VIEW - WAZE STYLE - REORGANIZADO
   ============================================ */

/* Waze-style Search Bar - TOPO */
.gps-search-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 100;
}

.gps-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 25px;
    padding: 12px 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.gps-search-icon {
    font-size: 16px;
    margin-right: 10px;
    opacity: 0.5;
}

.gps-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: #333;
    font-size: 15px;
    outline: none;
    font-weight: 500;
}

.gps-search-box input::placeholder {
    color: #999;
}

.gps-search-clear {
    background: #eee;
    border: none;
    color: #666;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gps-search-clear.hidden {
    display: none;
}

/* Search Results */
.gps-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 101;
}

.gps-search-results.hidden {
    display: none;
}

.gps-search-result {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.gps-search-result:last-child {
    border-bottom: none;
}

.gps-search-result:active {
    background: #f5f5f5;
}

.gps-result-icon {
    width: 36px;
    height: 36px;
    background: #e8f0fe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

.gps-result-info {
    flex: 1;
    min-width: 0;
}

.gps-result-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gps-result-address {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Weather Badge - Canto superior direito */
.gps-weather-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.gps-weather-badge #gps-weather-icon {
    font-size: 18px;
}

/* Quick Actions - ABAIXO DA BUSCA */
.gps-quick-actions {
    position: absolute;
    top: 70px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 99;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gps-quick-actions::-webkit-scrollbar {
    display: none;
}

.gps-quick-btn {
    flex: 0 0 auto;
    min-width: 60px;
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.gps-quick-btn:active {
    transform: scale(0.95);
    background: #f5f5f5;
}

.gps-quick-btn span {
    font-size: 18px;
}

.gps-quick-btn small {
    font-size: 9px;
    color: #666;
    font-weight: 600;
    white-space: nowrap;
}

/* Speedometer - Usando velocímetro padrão arrastável igual ao do mapa */

/* GPS Speed Overlay - IDÊNTICO AO DO MAPA */
#gps-speed-overlay {
    position: absolute !important;
    bottom: 20px;
    left: 12px;
    z-index: 2000 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* Estilo idêntico ao do mapa */
    background: rgba(10, 10, 10, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    text-align: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    /* Tamanho fixo compacto */
    width: fit-content !important;
    height: fit-content !important;
    max-width: 130px !important;
    max-height: 120px !important;
    overflow: hidden !important;
}

/* Quando está sendo arrastado */
#gps-speed-overlay.dragging {
    cursor: grabbing !important;
    bottom: auto !important;
    right: auto !important;
    transition: none !important;
}

#gps-speed-overlay .drag-handle {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

#gps-speed-overlay .map-speed-main {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

#gps-speed-overlay .map-speed-value {
    font-size: 48px !important;
    font-weight: 700 !important;
    color: #fff !important;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

#gps-speed-overlay .map-speed-unit {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#gps-speed-overlay .map-speed-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#gps-speed-overlay .map-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#gps-speed-overlay .map-stat-label {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#gps-speed-overlay .map-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #00d4ff;
}

/* GPS Controls - CANTO INFERIOR DIREITO */
.gps-controls {
    position: absolute;
    right: 12px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 500;
}

.gps-ctrl-btn {
    width: 46px;
    height: 46px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.gps-ctrl-btn:active {
    transform: scale(0.92);
    background: #f0f0f0;
}

.gps-ctrl-btn.active {
    background: #4285F4;
}

.gps-ctrl-btn.active span {
    filter: brightness(10);
}

/* ============================================
   NAVIGATION PANEL - PREMIUM DESIGN
   ============================================ */
.gps-nav-panel {
    position: absolute;
    top: 12px;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 12px;
    background: linear-gradient(145deg, rgba(28, 28, 32, 0.98), rgba(18, 18, 22, 0.98));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 0;
    z-index: 102;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gps-nav-panel.hidden {
    display: none;
}

.gps-nav-panel.minimized {
    padding-bottom: 0;
}

.gps-nav-panel.minimized .nav-details {
    max-height: 0;
    opacity: 0;
    padding: 0 16px;
    margin: 0;
    overflow: hidden;
}

.gps-nav-panel.minimized .nav-minimize {
    transform: rotate(180deg);
    background: rgba(16, 185, 129, 0.2);
}

.gps-nav-panel.minimized .nav-header {
    border-bottom: none;
}

/* Header do painel */
.nav-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    cursor: pointer;
}

/* Botão minimizar - mais visível */
.nav-minimize {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.nav-minimize:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-minimize:active {
    background: rgba(16, 185, 129, 0.3);
    transform: scale(0.9) rotate(180deg);
}

/* Instrução de navegação */
.nav-instruction {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.nav-turn-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 
        0 4px 12px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-info {
    flex: 1;
    min-width: 0;
}

.nav-distance {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.nav-street {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Botão fechar */
.nav-close {
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #EF4444;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nav-close:active {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(0.95);
}

/* Detalhes expandidos */
.nav-details {
    max-height: 100px;
    opacity: 1;
    padding: 12px 16px 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.nav-stat-row {
    display: flex;
    gap: 8px;
}

.nav-stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-stat .stat-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #10B981;
    letter-spacing: -0.3px;
}

.nav-stat .stat-label {
    display: block;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ============================================
   SEARCH RESULTS - IMPROVED
   ============================================ */
.gps-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(24, 24, 28, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-height: 300px;
    overflow-y: auto;
    z-index: 101;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gps-search-results.hidden {
    display: none;
}

.gps-search-loading {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.gps-search-empty {
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.gps-search-empty span {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.gps-search-empty p {
    margin: 0 0 4px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.gps-search-empty small {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}

.gps-search-result {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.gps-search-result:last-child {
    border-bottom: none;
}

.gps-search-result:active {
    background: rgba(255, 255, 255, 0.08);
}

.gps-result-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-right: 12px;
}

.gps-result-info {
    flex: 1;
    min-width: 0;
}

.gps-result-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gps-result-address {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.gps-result-city {
    font-size: 10px;
    color: rgba(255, 193, 7, 0.7);
    margin-top: 3px;
    padding: 2px 6px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.gps-result-dist {
    font-size: 12px;
    color: rgba(16, 185, 129, 0.8);
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 12px;
}

/* ============================================
   GPS CONTROLS - PREMIUM
   ============================================ */
.gps-controls {
    position: absolute;
    right: 12px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.gps-ctrl-btn {
    width: 46px;
    height: 46px;
    background: linear-gradient(145deg, rgba(32, 32, 36, 0.95), rgba(22, 22, 26, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gps-ctrl-btn:active {
    transform: scale(0.95);
    background: rgba(50, 50, 54, 0.95);
}

.gps-ctrl-btn.active {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.25), rgba(16, 185, 129, 0.15));
    border-color: rgba(16, 185, 129, 0.3);
}

.gps-ctrl-btn.active span {
    filter: none;
    color: #10B981;
}

/* Route Selection Modal */
.gps-route-modal {
    position: absolute;
    bottom: 60px;
    left: 12px;
    right: 12px;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 103;
    max-height: 45vh;
    overflow-y: auto;
}

.gps-route-modal.hidden {
    display: none;
}

.gps-route-option {
    display: flex;
    align-items: center;
    padding: 14px;
    background: #f8f8f8;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.gps-route-option.selected {
    border-color: #4285F4;
    background: #e8f0fe;
}

.gps-route-time {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-right: 14px;
}

.gps-route-info {
    flex: 1;
}

.gps-route-distance {
    font-size: 13px;
    color: #666;
}

.gps-route-via {
    font-size: 12px;
    color: #999;
}

.gps-route-badge {
    background: #4CAF50;
    color: #fff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.gps-route-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.gps-route-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.gps-route-btn.cancel {
    background: #eee;
    color: #666;
}

.gps-route-btn.start {
    background: #4285F4;
    color: #fff;
}

/* Quando navegando, esconde busca e quick actions */
#gps-view.navigating .gps-search-bar,
#gps-view.navigating .gps-quick-actions {
    display: none;
}

/* ============================================
   GPS USER MARKER - Waze Style
   ============================================ */

.gps-user-marker {
    background: transparent !important;
    border: none !important;
}

.gps-user-dot {
    width: 24px;
    height: 24px;
    background: #4285F4;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.gps-user-arrow {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid #4285F4;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.gps-user-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(66, 133, 244, 0.25);
    border-radius: 50%;
    animation: gpsPulse 2s ease-out infinite;
}

@keyframes gpsPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Destination Marker */
.gps-dest-marker {
    background: transparent !important;
    border: none !important;
}

.gps-dest-pin {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    animation: destBounce 0.5s ease-out;
}

@keyframes destBounce {
    0% { transform: translateY(-20px); opacity: 0; }
    60% { transform: translateY(5px); }
    100% { transform: translateY(0); opacity: 1; }
}

/* ============================================
   POI MARKERS
   ============================================ */
.poi-marker {
    background: transparent !important;
    border: none !important;
}

.poi-icon {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #4285F4;
}

.leaflet-popup-content button {
    background: #4285F4;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    width: 100%;
}

.leaflet-popup-content button:active {
    background: #3367d6;
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 380px) {
    .gps-quick-btn {
        padding: 8px 6px;
        min-width: 55px;
    }
    
    .gps-quick-btn span {
        font-size: 16px;
    }
    
    .gps-quick-btn small {
        font-size: 8px;
    }
    
    .gps-weather-badge {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Safe area para iPhone X+ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .gps-bottom-bar {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

