/* ============================================
   Estilos para Mapas (ciclovias.php e pedonal.php)
   ============================================ */

/* Container e Layout */
.map-container {
    padding: 15px;
}

.map-header {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-layout {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.map-column {
    flex: 0 0 70%;
}

.sidebar-column {
    flex: 0 0 calc(30% - 15px);
}

#map {
    height: calc((100vh - 120px) * 0.75);
    min-height: 500px;
    width: 100%;
    border-radius: 8px;
    z-index: 1;
}

/* Sidebar */
.sidebar-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    height: calc((100vh - 120px) * 0.75);
    overflow-y: scroll;
}

.sidebar-card h5 {
    color: #004785;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

/* Filtros */
.filter-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section h6 {
    font-size: 13px;
    font-weight: bold;
    color: #004785;
    margin-bottom: 10px;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.filter-option label {
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-color-indicator {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

/* Legenda */
.legend {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 30px;
    height: 4px;
    margin-right: 10px;
    border-radius: 2px;
}

.legend-label {
    font-size: 12px;
    color: #333;
}

/* Botão de geolocalização */
.leaflet-control-locate {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 1000;
}

.locate-btn {
    width: 34px;
    height: 34px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.locate-btn:hover {
    background: #f4f4f4;
}

.locate-btn:active {
    background: #e0e0e0;
}

.locate-btn svg {
    width: 20px;
    height: 20px;
    fill: #333;
}

/* Marker de localização do utilizador */
.user-location-marker {
    background-color: #4285f4;
    border: 3px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.6);
    animation: pulse-user 2s infinite;
}

@keyframes pulse-user {
    0% {
        box-shadow: 0 2px 8px rgba(66, 133, 244, 0.6);
    }

    50% {
        box-shadow: 0 2px 16px rgba(66, 133, 244, 0.9);
    }

    100% {
        box-shadow: 0 2px 8px rgba(66, 133, 244, 0.6);
    }
}

/* Círculo de precisão */
.user-location-accuracy {
    fill: rgba(66, 133, 244, 0.2);
    stroke: rgba(66, 133, 244, 0.5);
    stroke-width: 2;
}

/* Listagem de percursos - Cores azuis por padrão */
.route-item {
    padding: 2px 4px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.route-item:hover {
    background: #e7f3ff;
}

.route-item.active {
    background: #cfe2ff;
}

.route-item-name {
    font-weight: 600;
    color: #004785;
    margin-bottom: 2px;
}

.route-item-info {
    font-size: 11px;
    color: #666;
}

/* Media Queries para Mapas */
@media (max-width: 768px) {
    .map-layout {
        flex-direction: row;
        gap: 10px;
    }

    .map-column {
        flex: 0 0 65%;
    }

    .sidebar-column {
        flex: 0 0 calc(35% - 10px);
    }

    #map {
        height: calc((100vh - 120px) * 0.75);
    }

    .sidebar-card {
        height: calc((100vh - 120px) * 0.75);
        padding: 10px;
    }

    .sidebar-card h5 {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .filter-option label {
        font-size: 11px;
    }

    .route-item {
        padding: 6px 8px;
        font-size: 11px;
    }

    .route-item-info {
        font-size: 10px;
    }
}