/* ==========================================
   Map Styles - Estilos para Leaflet
   ========================================== */

/* Map Modal */
.map-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 95, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    backdrop-filter: blur(4px);
}

.map-modal-content {
    background: white;
    border-radius: 1rem;
    width: 90%;
    height: 85vh;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.map-modal-content.fullscreen {
    width: 100%;
    height: 100vh;
    max-width: none;
    border-radius: 0;
}

.map-modal-header {
    background: linear-gradient(135deg, #4a90e2 0%, #667eea 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.map-modal-content.fullscreen .map-modal-header {
    border-radius: 0;
}

.map-modal-header h3 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.map-modal-header > div {
    display: flex;
    gap: 0.75rem;
}

.map-modal-info {
    background: #eff6ff;
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    color: #4a90e2;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.map-container {
    flex: 1;
    width: 100%;
    position: relative;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 0.75rem;
    padding: 0;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content {
    margin: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.popup-content {
    min-width: 220px;
}

.popup-content strong {
    color: #4a90e2;
    font-weight: 700;
}

.popup-content p {
    margin: 0.5rem 0;
    color: #475569;
}

.popup-content p:first-child {
    margin-top: 0;
}

.popup-content p:last-child {
    margin-bottom: 0;
}

/* Leaflet Controls Customization */
.leaflet-control-layers {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.leaflet-control-layers-expanded {
    padding: 1rem;
    min-width: 240px;
}

.leaflet-control-layers-toggle {
    width: 44px;
    height: 44px;
    background-size: 60%;
}

.leaflet-control-layers label {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 500;
    transition: all 0.15s ease;
    border-radius: 0.375rem;
}

.leaflet-control-layers label:hover {
    background: #f8fafc;
}

.leaflet-control-layers-base label input,
.leaflet-control-layers-overlays label input {
    margin-right: 0.625rem;
}

/* Zoom Controls */
.leaflet-control-zoom {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.leaflet-control-zoom a {
    background: white;
    color: #1e293b;
    border: none;
    width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 1.25rem;
    font-weight: 700;
    transition: all 0.15s ease;
}

.leaflet-control-zoom a:hover {
    background: #4a90e2;
    color: white;
}

.leaflet-control-zoom-in {
    border-bottom: 1px solid #e2e8f0;
}

/* Map Button Styles */
.btn-map {
    background: #22c55e;
    color: white;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-map:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Custom Marker Styles */
.custom-marker {
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .map-modal {
        padding: 0;
    }

    .map-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .map-modal-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 1rem;
    }

    .map-modal-header h3 {
        font-size: 1.125rem;
        width: 100%;
    }

    .map-modal-header > div {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }

    .map-modal-info {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    .leaflet-control-layers {
        max-width: 220px;
        font-size: 0.8125rem;
    }

    .leaflet-control-layers-expanded {
        padding: 0.875rem;
        min-width: 200px;
    }

    .leaflet-control-layers label {
        font-size: 0.8125rem;
        padding: 0.625rem 0.25rem;
    }

    .leaflet-control-zoom a {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.375rem;
    }

    .leaflet-popup-content-wrapper {
        max-width: 260px;
    }

    .leaflet-popup-content {
        margin: 0.75rem;
        font-size: 0.8125rem;
    }

    .popup-content {
        min-width: 200px;
    }

    .popup-content p {
        margin: 0.375rem 0;
        font-size: 0.8125rem;
    }
}

/* Small Mobile Optimizations */
@media (max-width: 480px) {
    .map-modal-header h3 {
        font-size: 1rem;
    }

    .map-modal-info {
        font-size: 0.75rem;
        padding: 0.625rem 0.875rem;
    }

    .leaflet-control-layers-toggle {
        width: 38px;
        height: 38px;
    }

    .leaflet-control-layers-expanded {
        min-width: 180px;
        padding: 0.75rem;
    }

    .leaflet-control-layers label {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    .popup-content p {
        font-size: 0.75rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .leaflet-control-zoom a {
        width: 44px;
        height: 44px;
        line-height: 44px;
    }

    .leaflet-control-layers label {
        padding: 0.75rem 0.25rem;
        min-height: 44px;
    }

    .custom-marker {
        font-size: 1.75rem;
    }
}
