/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: #333;

    /* Background image with subtle overlay for readability */
    background:
        linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
        url("/static/bg2.jpg") center/cover no-repeat fixed;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Controls Panel */
.controls-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.time-controls {
    margin-bottom: 25px;
}

.time-controls label {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

#current-year {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.3rem;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 10px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e74c3c;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e74c3c;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.year-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* Data Info */
.data-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.info-item .label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.info-item .value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Map Controls */
.map-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #3498db;
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn.active {
    background: #e74c3c;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn.active:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn.both-active {
    background: #27ae60;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn.both-active:hover {
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* Map Container */
.map-container {
    position: relative;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

#map {
    height: 600px;
    width: 100%;
    background-color: #f0f0f0;
    border: 2px solid #333;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading p {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* Legend */
.legend {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.legend h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .controls-panel {
        padding: 20px;
    }
    
    .data-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .map-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    #map {
        height: 400px;
    }
    
    .legend-items {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .controls-panel {
        padding: 15px;
    }
    
    .data-info {
        padding: 15px;
    }
    
    #map {
        height: 300px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    margin-top: 12px;
}
.footer .repo { margin-bottom: 14px; }

.footer .team-label {
    font-weight: 700;
    margin-bottom: 10px;
}

.footer .team-list {
    list-style: none;
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}
.footer .team-list li {
    list-style: none;
    list-style-type: none;
    margin: 3px 0;
}
.footer .team-list li::marker { content: none; } /* ensure no bullets in all engines */

.footer a {
    color: white;
    text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* Highlight styles */
.footer .repo a {
    display: inline-block;
    background: rgba(0,0,0,0.25);
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
}
.footer .team-list a {
    display: inline-block;
    background: rgba(0,0,0,0.18);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}