/* ==================== LAYOUT DA PÁGINA DE MAPA ==================== */
.mapa-page-section {
    padding: 0;
    background-color: var(--section-bg-color);
}

.mapa-page-header {
    padding: 30px 0 20px;
    background: var(--section-bg-color);
}

.mapa-page-header h2 {
    font-size: var(--h3-font-size);
    font-weight: var(--font-weight-bold);
    color: var(--dark-color);
    margin-bottom: 4px;
}

/* ==================== LAYOUT DIVIDIDO (LISTA + MAPA) ==================== */
.mapa-split-container {
    display: flex;
    height: calc(100vh - 190px);
    min-height: 500px;
    border-top: 1px solid #e9ecef;
}

/* Painel lateral da lista */
.mapa-lista-painel {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e9ecef;
    background: #fff;
    overflow: hidden;
}

.mapa-lista-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.mapa-lista-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Painel do mapa */
.mapa-container {
    flex: 1;
    position: relative;
    background: #e8e8e8;
}

#googleMap {
    width: 100%;
    height: 100%;
}

/* ==================== MAPA DA LANDING (UC014) ==================== */
#landingMapa {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mapa-indisponivel {
    position: absolute;
    inset: 0;
    z-index: 650;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: #842029;
    background: rgba(248, 215, 218, 0.96);
}

.mapa-indisponivel i {
    font-size: 2rem;
}

.mapa-indisponivel p {
    margin: 0;
    font-weight: var(--font-weight-bold);
}

.mapa-marcador-wrapper {
    background: transparent;
    border: 0;
}

.mapa-marcador {
    display: block;
    width: 26px;
    height: 26px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    transform: rotate(-45deg);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mapa-marcador.evento {
    background: #dc3545;
}

.mapa-marcador.ponto {
    background: #198754;
}

.mapa-marcador-wrapper:hover .mapa-marcador,
.mapa-marcador-wrapper.ativo .mapa-marcador {
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45);
    transform: rotate(-45deg) scale(1.25);
}

.boa-visita-popup .leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden;
    background: transparent;
    border-radius: var(--border-radius-small);
}

.boa-visita-popup .leaflet-popup-content {
    width: 260px !important;
    margin: 0;
}

.boa-visita-popup .leaflet-popup-tip {
    background: #fff;
}

.mapa-tooltip-card {
    width: 260px;
    border: 0;
    box-shadow: none;
}

/* UC17: o leaflet.css (carregado depois) pinta os links do popup de azul (#0078A8).
   Mantém o link no padrão de cores do projeto. */
.boa-visita-popup .bv-tooltip-footer a {
    color: var(--accent-color);
}

.boa-visita-popup .bv-tooltip-footer a:hover {
    color: var(--primary-color);
}

.card-lista.destaque {
    border-color: var(--accent-color);
    background: #fff5f7;
    box-shadow: 0 4px 14px rgba(255, 0, 77, 0.16);
}

.btn-filtro-favoritos {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 12px;
    color: #6c757d;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-filtro-favoritos:hover,
.btn-filtro-favoritos.active {
    color: #dc3545;
    border-color: #dc3545;
    background: #fff5f7;
}

/* Placeholder do mapa (enquanto sem API key) */
.mapa-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e8f0 0%, #c8d8e8 50%, #d0dce8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.mapa-placeholder-content {
    text-align: center;
    color: #666;
    z-index: 1;
    background: rgba(255,255,255,0.85);
    padding: 30px 40px;
    border-radius: var(--border-radius-medium);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.mapa-placeholder-content i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 12px;
    display: block;
}

.mapa-placeholder-content h5 {
    font-weight: var(--font-weight-bold);
    color: var(--dark-color);
    margin-bottom: 6px;
}

.mapa-placeholder-content p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* Marcadores simulados no placeholder */
.marcadores-simulados {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.marcador-sim {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s;
}

.marcador-sim:hover {
    transform: scale(1.15);
    z-index: 10;
}

.marcador-sim-pin {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.marcador-sim-pin.evento {
    background: #dc3545;
}

.marcador-sim-pin.ponto {
    background: #198754;
}

.marcador-sim-label {
    font-size: 10px;
    background: white;
    border-radius: 4px;
    padding: 2px 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
    margin-top: 2px;
    color: #333;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== CARDS NA LISTA DO MAPA ==================== */
.card-mapa-lista {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-mapa-lista:hover,
.card-mapa-lista.ativo {
    border-color: var(--accent-color);
    background: #fff5f7;
    box-shadow: 0 2px 8px rgba(255, 0, 77, 0.1);
}

.card-mapa-pin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.card-mapa-pin.evento {
    background: #dc3545;
}

.card-mapa-pin.ponto {
    background: #198754;
}

.card-mapa-info {
    flex: 1;
    min-width: 0;
}

.card-mapa-nome {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.card-mapa-sub {
    font-size: 11px;
    color: #888;
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ==================== LEGENDA DO MAPA ==================== */
.mapa-legenda {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 500;
    display: flex;
    gap: 14px;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #444;
}

.legenda-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legenda-dot.evento {
    background: #dc3545;
}

.legenda-dot.ponto {
    background: #198754;
}

/* ==================== BOTÃO VER ROTA NO MAPA ==================== */
.btn-ver-rota {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-ver-rota:hover {
    background: var(--primary-color);
}

/* ==================== RESPONSIVO ==================== */
@media (max-width: 768px) {
    .mapa-split-container {
        flex-direction: column;
        height: auto;
    }

    .mapa-lista-painel {
        width: 100%;
        height: 280px;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .mapa-container {
        height: 400px;
    }
}
