/**
 * Leaflet Custom Styles - GeoIBRAM
 * 
 * Customizações e overrides para mapas Leaflet
 * 
 * @package GeoIBRAM_Theme
 * @version 1.0.0
 */

/* ============================================
   TOOLBAR MODOS – PLANO DE VOO PRODUTOR (5 COLUNAS: 4 MODOS + OBTER LOCALIZAÇÃO)
   ============================================ */
.producer-fp-map-toolbar .producer-fp-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
}
@media (min-width: 640px) {
    .producer-fp-map-toolbar .producer-fp-mode-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
.producer-fp-map-toolbar .map-mode-btn {
    min-height: 44px;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .producer-fp-map-toolbar .map-mode-btn span:last-child {
        font-size: 0.8125rem;
    }
}

/* ============================================
   OCULTAR CONTROLES DE CAMADAS
   ============================================ */

/* Ocultar controle de camadas (Mapa/Satélite) em todos os tamanhos de tela */
.leaflet-control-layers,
.leaflet-control-layers-toggle,
.leaflet-control-layers-expanded {
    display: none !important;
}

/* Garantir que o controle de camadas nunca apareça */
.leaflet-top.leaflet-right .leaflet-control-layers,
.leaflet-bottom.leaflet-right .leaflet-control-layers,
.leaflet-top.leaflet-left .leaflet-control-layers,
.leaflet-bottom.leaflet-left .leaflet-control-layers {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   AJUSTES DE CONTROLES VISÍVEIS
   ============================================ */

/* Manter controles de zoom visíveis */
.leaflet-control-zoom {
    display: block !important;
}

/* Manter escala visível se existir */
.leaflet-control-scale {
    display: block !important;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Mobile */
@media (max-width: 768px) {
    /* Garantir que controles de camadas permaneçam ocultos em mobile */
    .leaflet-control-layers {
        display: none !important;
    }
    
    /* Ajustar tamanho dos controles de zoom para mobile */
    .leaflet-control-zoom a {
        width: 26px;
        height: 26px;
        line-height: 26px;
        font-size: 18px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Garantir que controles de camadas permaneçam ocultos em tablet */
    .leaflet-control-layers {
        display: none !important;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    /* Garantir que controles de camadas permaneçam ocultos em desktop */
    .leaflet-control-layers {
        display: none !important;
    }
}

/* ============================================
   MELHORIAS VISUAIS DO MAPA
   ============================================ */

/* Adicionar borda suave ao container do mapa */
.leaflet-container {
    border-radius: 8px;
    overflow: hidden;
}

/* Melhorar aparência dos popups */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-tip {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Melhorar aparência dos tooltips */
.leaflet-tooltip {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 12px;
    font-weight: 500;
}

/* ============================================
   CONTROLES DE ZOOM ESTILIZADOS
   ============================================ */

/* Estilizar botões de zoom */
.leaflet-control-zoom a {
    background-color: #ffffff;
    color: #374151;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.leaflet-control-zoom a:active {
    background-color: #e5e7eb;
}

/* Separar botões de zoom */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    border-bottom: 1px solid #e5e7eb;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none;
}

/* ============================================
   MARCADORES PERSONALIZADOS
   ============================================ */

/* Melhorar sombra dos marcadores */
.leaflet-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ============================================
   ATRIBUTOS E CRÉDITOS
   ============================================ */

/* Estilizar atribuição do mapa */
.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 4px 0 0 0;
    padding: 2px 6px;
    font-size: 10px;
}

.leaflet-control-attribution a {
    color: #6b7280;
    text-decoration: none;
}

.leaflet-control-attribution a:hover {
    color: #374151;
    text-decoration: underline;
}

/* ============================================
   CÍRCULOS E FORMAS
   ============================================ */

/* Melhorar aparência de círculos no mapa */
.leaflet-interactive {
    transition: all 0.2s ease;
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

/* Garantir que controles sejam acessíveis via teclado */
.leaflet-control-zoom a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Ocultar controles ao imprimir */
    .leaflet-control-zoom,
    .leaflet-control-layers,
    .leaflet-control-attribution {
        display: none !important;
    }
    
    /* Manter apenas o mapa visível */
    .leaflet-container {
        border: 1px solid #000;
    }
}

