/* Maps Page Specific Styles */

.maps-page {
    background-color: #f8f9fa;
    min-height: calc(100vh - 200px);
}

.page-header {
    text-align: center;
    padding: 2rem 0;
    background: white;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.map-stats {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Map Controls */
.map-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.map-filters {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.map-filters label {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.map-filters select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    min-width: 180px;
}

.map-filters select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Map Container */
.map-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.birth-map {
    height: 600px;
    width: 100%;
    position: relative;
}

.map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.map-loading p {
    color: #666;
    font-size: 1.1rem;
}

/* Map Legend */
.map-legend {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.map-legend h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.legend-items {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.legend-marker.male {
    background-color: #3498db;
}

.legend-marker.female {
    background-color: #e91e63;
}

.legend-marker.unknown {
    background-color: #95a5a6;
}

/* Custom Leaflet Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 250px;
}

.person-popup {
    padding: 1rem;
}

.person-popup-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.person-popup-photo {
    flex-shrink: 0;
}

.person-popup-photo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.popup-photo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.popup-photo-placeholder.male {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.popup-photo-placeholder.female {
    background: linear-gradient(135deg, #e91e63, #c2185b);
}

.popup-photo-placeholder.u {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.person-popup-info h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.person-popup-info p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    color: #666;
}

.person-popup-details {
    font-size: 0.85rem;
    line-height: 1.4;
}

.person-popup-details p {
    margin: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.person-popup-details .label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 60px;
}

.person-popup-actions {
    margin-top: 1rem;
    text-align: center;
}

.popup-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.popup-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .birth-map {
        height: 400px;
    }
    
    .map-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .map-filters select {
        min-width: auto;
    }
    
    .legend-items {
        justify-content: center;
    }
    
    .person-popup {
        padding: 0.8rem;
    }
    
    .leaflet-popup-content {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .birth-map {
        height: 350px;
    }
    
    .page-header {
        padding: 1rem 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .map-controls {
        padding: 1rem;
    }
    
    .map-legend {
        padding: 1rem;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Animation for spin loader */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}