﻿html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--bg-deep);
    font-family: system-ui, -apple-system, sans-serif;
    height: 100dvh; /* Força o limite total à área útil do browser */
}

.mobility-container {
    position: relative;
    height: 100dvh; /* Recalcula dinamicamente mitigando barras de endereço */
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-deep);
    transition: background-color 0.3s ease;
}

#mobilityMap {
    width: 100%;
    height: 100%;
    background-color: var(--bg-deep);
    transition: background-color 0.3s ease;
}

/* Agrupamento de Controlos Superiores Direitos */
.top-controls-group {
    position: absolute;
    top: 84px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Indicador Totalizador de Vagas (Suporta Temas) */
.live-counter {
    position: absolute;
    top: 84px;
    left: 16px;
    width: 76px;
    height: 76px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 20px;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.15), 0 12px 40px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
}




.live-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 26px;
    color: #22c55e;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.live-label {
    margin-top: 4px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

/* Cápsulas de Filtro Rápido Adaptativas (Todos vs Livres) */
.map-quick-filters {
    display: flex;
    gap: 6px;
}

.filter-pill {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
    opacity: 0.85;
}

    .filter-pill:hover {
        opacity: 1;
        border-color: #22c55e;
    }

    .filter-pill.active {
        background: #22c55e !important;
        color: #ffffff !important;
        border-color: #22c55e !important;
        font-weight: 700;
        opacity: 1;
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
    }

/* Menu Inferior Deslizante (Bottom Sheet Adaptativa) */
#bottomSheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2100;
    height: 56px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--border-glass);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.3);
    transition: 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

    #bottomSheet.expanded {
        height: 180px; /* Altura ideal compacta para mobile e desktop */
    }

#bottomHandle {
    text-align: center;
    padding: 12px 14px 6px 14px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

.sheet-indicator {
    width: 32px;
    height: 4px;
    margin: 0 auto 6px auto;
    background: var(--text-muted);
    border-radius: 999px;
    opacity: 0.4;
    transition: background-color 0.3s ease;
}


/* ETIQUETAS E BADGES INTERNOS DO MAPA LEAFLET */
.map-badge-container {
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.map-pnp-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-deep);
    padding: 3px 12px 3px 3px;
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-glass);
    width: max-content;
    height: 30px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.map-badge-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    color: #ffffff;
    flex-shrink: 0;
    margin-right: 8px;
}

.map-badge-icon-inline {
    margin-right: 4px;
    font-size: 11px;
    opacity: 0.8;
}

.map-badge-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    transition: color 0.3s ease;
}

/* Cores Dinâmicas e Brilhos Néon Translucidos */
.badge-available {
    background-color: rgba(34, 197, 94, 0.2);
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-warning {
    background-color: rgba(234, 179, 8, 0.2);
    color: #eab308 !important;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.badge-occupied {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.pulse-update {
    animation: huduPulse 0.6s ease-out;
}

@keyframes huduPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.04);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* MEDIA QUERIES RESPONSIVAS */
@media (min-width: 769px) {
    .live-counter, .top-controls-group {
        top: 16px !important;
    }
}

@media (max-width: 768px) {
    .map-badge-text {
        display: none !important;
    }

    .map-pnp-badge {
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    .map-badge-circle {
        margin-right: 0 !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
}

.zone-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 16px 20px 16px;
}

    .zone-slider::-webkit-scrollbar {
        display: none;
    }

/* Cartões Individuais dos Parques */
.zone-card {
    position: relative;
    min-width: 175px;
    max-width: 175px;
    border-radius: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.25s ease;
}

body[data-vago-theme="day"] .zone-card {
    background: rgba(0, 0, 0, 0.02);
}

.zone-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #22c55e;
    transform: translateY(-2px);
}

body[data-vago-theme="day"] .zone-card:hover {
    background: rgba(0, 0, 0, 0.04);
}

.zone-context-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.zone-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.zone-card-free {
    color: #22c55e;
    margin-top: 4px;
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.02em;
}

.vagas-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

/* Ponto Azul Estilo iOS para a Posição do Utilizador */
.user-position-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.blue-dot {
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border: 2px solid #ffffff;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

.pulse-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    top: -2px;
    left: -2px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    animation: ringPulse 2.5s infinite ease-out;
    opacity: 0;
}


/* Declaração da animação da onda de pulsação para o ponto GPS do utilizador */
@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}
