/* ===================================
   Map Feature Styles
   Interactive map for PIN code locations
   =================================== */

/* Map Container - Modal Overlay */
.map-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.map-container.active {
    display: flex;
}

/* Map Wrapper */
.map-wrapper {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

/* Map Header */
.map-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Map Canvas */
#map {
    height: 500px;
    width: 100%;
    background: #f0f0f0;
}

/* Map Info Footer */
.map-info {
    padding: 1rem 1.5rem;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-top: 1px solid #e0e0e0;
}

.map-legend {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading State */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Custom Marker Styles */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 30px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.marker-pin.blue {
    color: #3b82f6;
}

.marker-pin.purple {
    color: #8b5cf6;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 0.75rem;
    font-family: 'Inter', sans-serif;
}

.leaflet-popup-content h4 {
    margin: 0 0 0.5rem 0;
    color: #667eea;
    font-size: 1rem;
}

.leaflet-popup-content p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: #666;
}

/* View on Map Button */
.view-map-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.view-map-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.view-map-btn:active {
    transform: translateY(0);
}

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

    .map-wrapper {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    #map {
        height: calc(100vh - 140px);
    }

    .map-header {
        padding: 1rem;
    }

    .map-header h3 {
        font-size: 1.1rem;
    }

    .map-info {
        padding: 1rem;
    }

    .map-legend {
        font-size: 0.8rem;
        gap: 0.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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