/* ==================== MAPAS MODULE CSS ==================== */

/* Controles do Mapa */
.map-controls {
    background: white;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.control-section {
    margin-bottom: 16px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
    font-size: 14px;
}

.map-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light-blue);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(44, 95, 124, 0.1);
}

.upload-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-upload {
    padding: 12px 16px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-upload:active {
    transform: scale(0.98);
}

.btn-upload:first-child {
    background: var(--primary-green);
}

.btn-upload:last-child {
    background: var(--primary-brown);
}

/* Lista de Camadas */
.layers-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--light-blue);
}

.layers-list {
    max-height: 200px;
    overflow-y: auto;
}

.empty-layers {
    text-align: center;
    padding: 24px;
    color: var(--text-light);
}

.empty-layers i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.empty-layers p {
    font-size: 14px;
    margin: 0;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--light-blue);
    border-radius: 12px;
    margin-bottom: 8px;
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.layer-info i {
    color: var(--primary-blue);
    font-size: 16px;
}

.layer-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-type {
    font-size: 11px;
    padding: 4px 8px;
    background: var(--primary-blue);
    color: white;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 600;
}

.layer-actions {
    display: flex;
    gap: 4px;
}

.layer-actions button {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.layer-actions button:hover {
    background: var(--primary-blue);
    color: white;
}

.layer-actions button:last-child:hover {
    background: #e74c3c;
}

/* Container do Mapa */
.map-container {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 16px;
}

.leaflet-map {
    width: 100%;
    height: 500px;
    z-index: 1;
}

/* Info do Mapa */
.map-info {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
}

.coordinates-display {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: var(--text-dark);
}

.coordinates-display i {
    color: var(--primary-blue);
}

/* Loading */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-blue);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.map-loading p {
    margin-top: 16px;
    color: var(--text-dark);
    font-weight: 600;
}

/* Ajuda */
.map-help {
    background: white;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.help-item {
    margin-bottom: 16px;
}

.help-item:last-child {
    margin-bottom: 0;
}

.help-item i {
    color: var(--primary-blue);
    margin-right: 8px;
}

.help-item strong {
    color: var(--text-dark);
    font-size: 14px;
}

.help-item p {
    margin: 4px 0 0 28px;
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
}

/* Controles do Leaflet - Customização */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    background: white !important;
    color: var(--primary-blue) !important;
    border: none !important;
    font-size: 18px !important;
}

.leaflet-control-zoom a:hover {
    background: var(--primary-blue) !important;
    color: white !important;
}

/* Popup do Leaflet */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 16px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .leaflet-map {
        height: 400px;
    }
    
    .map-info {
        top: 8px;
        left: 8px;
    }
    
    .coordinates-display {
        font-size: 11px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .leaflet-map {
        height: 350px;
    }
    
    .upload-buttons {
        grid-template-columns: 1fr;
    }
}
