/* Map Styles */
.map-section {
    padding: 2rem 0;
}

.map-container {
    position: relative;
    height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-top: 1.5rem;
    border: 1px solid var(--border-light);
}

.dark .map-container {
    border-color: var(--border-dark);
}

#webcam-map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

.map-controls {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.map-controls button {
    width: 2.5rem;
    height: 2.5rem;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.dark .map-controls button {
    background-color: var(--card-dark);
    color: var(--text-dark);
}

.map-controls button:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.map-controls #reset-view {
    border-radius: 1.25rem;
    width: auto;
    padding: 0 1rem;
    font-size: 0.875rem;
}

.map-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.dark .map-overlay {
    background-color: rgba(31, 41, 55, 0.9);
}

.map-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted-light);
    margin-top: 0.25rem;
    display: block;
}

.dark .stat-label {
    color: var(--text-muted-dark);
}

/* Leaflet Custom Styles */
.marker-cluster {
    background-color: rgba(37, 99, 235, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.marker-cluster.small {
    width: 30px;
    height: 30px;
    font-size: 11px;
}

.marker-cluster.medium {
    width: 40px;
    height: 40px;
    font-size: 12px;
}

.marker-cluster.large {
    width: 50px;
    height: 50px;
    font-size: 14px;
}

.custom-marker {
    background-color: var(--primary);
    border-radius: 50%;
    border: 2px solid white;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-marker:hover {
    transform: scale(1.1);
    background-color: var(--secondary);
}

.custom-marker.cityscape {
    background-color: #3498db;
}

.custom-marker.beach {
    background-color: #f1c40f;
}

.custom-marker.nature {
    background-color: #2ecc71;
}

.custom-marker.traffic {
    background-color: #e74c3c;
}

.custom-marker.landmark {
    background-color: #9b59b6;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.popup-content {
    font-family: inherit;
}

.popup-header {
    background-color: var(--primary);
    color: white;
    padding: 12px 15px;
}

.popup-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.popup-body {
    padding: 15px;
}

.popup-webcams {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.popup-webcam-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark .popup-webcam-item {
    border-color: var(--border-dark);
}

.popup-webcam-item:last-child {
    border-bottom: none;
}

.popup-webcam-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark .popup-webcam-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.popup-webcam-thumb {
    width: 70px;
    height: 40px;
    background-color: #eee;
    margin-right: 10px;
    border-radius: 4px;
    overflow: hidden;
}

.popup-webcam-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-webcam-info h4 {
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 500;
}

.popup-webcam-category {
    font-size: 12px;
    color: var(--primary);
}

.popup-footer {
    background-color: #f5f5f5;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
}

.dark .popup-footer {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
}

.popup-webcam-count {
    font-size: 13px;
    color: var(--text-muted-light);
}

.dark .popup-webcam-count {
    color: var(--text-muted-dark);
}

.view-all-button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-all-button:hover {
    background-color: var(--primary-dark);
}

.leaflet-control-attribution {
    font-size: 10px;
}

/* Map loading state */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dark .map-loading {
    background-color: rgba(17, 24, 39, 0.7);
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--primary);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .map-container {
        height: 400px;
    }
    
    .map-controls button {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    .map-controls #reset-view {
        font-size: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .map-overlay {
        max-width: calc(100% - 2rem);
    }
    
    .map-stats {
        gap: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .map-container {
        height: 350px;
    }
    
    .map-controls {
        right: 0.5rem;
        bottom: 0.5rem;
    }
    
    .map-controls button {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
    }
    
    .map-overlay {
        left: 0.5rem;
        padding: 0.75rem;
    }
    
    .map-stats {
        gap: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.125rem;
    }
}
