/* Map Page Specific Styles */

/* Map Container */
.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Map SVG Styles */
#mapSvg {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

/* Municipio Path Styles */
.map-path {
    transition: all 0.3s ease;
    cursor: pointer;
    transform-origin: center;
}

.map-path:hover {
    filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.8)) brightness(1.2);
    stroke: #ffffff;
    stroke-width: 2px;
    fill-opacity: 0.8 !important;
}

/* Municipio Label Styles */
.map-label {
    display: none; /* Ocultar etiquetas quemadas obsoletas */
}

/* Search Input */
#municipioSearch::placeholder {
    color: rgba(156, 163, 175, 0.8);
}

#municipioSearch:focus {
    outline: none;
}

/* Zoom Controls */
.zoom-btn {
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* Filter Button */
#filterBtn {
    transition: all 0.2s ease;
}

#filterBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Municipio Info Modal */
.municipio-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    max-width: 600px;
    width: 90%;
}

.municipio-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.municipio-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

.municipio-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    pointer-events: none;
    z-index: 1000;
    min-width: 200px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-title {
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    font-size: 14px;
}

.tooltip-content {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Filter Panel */
.filter-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%) translateX(120%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 90;
    width: 300px;
}

.filter-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Loading Spinner */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Municipio List */
.municipio-list {
    max-height: 400px;
    overflow-y: auto;
}

.municipio-list::-webkit-scrollbar {
    width: 6px;
}

.municipio-list::-webkit-scrollbar-track {
    background: transparent;
}

.municipio-list::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.5);
    border-radius: 3px;
}

.municipio-list::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.8);
}

/* Municipio List Item */
.municipio-list-item {
    transition: all 0.2s ease;
}

.municipio-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Stats Cards in Modal */
.stat-card-mini {
    transition: all 0.2s ease;
}

.stat-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Priority Indicators */
.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.priority-dot.alta {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.priority-dot.media {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.priority-dot.baja {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .filter-panel {
        width: 90%;
        right: 5%;
    }
    
    .zoom-btn {
        width: 40px;
        height: 40px;
    }
    
    .zoom-btn .material-symbols-outlined {
        font-size: 20px;
    }
}

/* Animation for Map Loading */
@keyframes mapFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.map-svg {
    animation: mapFadeIn 0.5s ease-out;
}

/* Selected Municipio */
.map-path.selected {
    fill: #38bdf8 !important;
    fill-opacity: 0.9 !important;
    filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.8));
    stroke: #fff;
    stroke-width: 2px;
}

/* Dimmed Municipio (when searching) */
.map-path.dimmed {
    opacity: 0.3;
    filter: none;
}
