* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
}

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

header {
    margin-bottom: 20px;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.map-section {
    flex: 1;
    min-width: 0;
}

#map-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
    position: relative;
}

#map-container svg {
    display: block;
    width: 100%;
    height: auto;
}

.country {
    stroke: #fff;
    stroke-width: 0.5;
    cursor: pointer;
    transition: stroke-width 0.2s;
}

.country:hover {
    stroke-width: 1.5;
    stroke: #333;
}

.country.no-data {
    fill: #e8e8e8;
    stroke: #ccc;
    stroke-width: 0.5;
}

.country.no-data:hover {
    stroke: #999;
}

#legend {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.legend-title {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #666;
}

.legend-items {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.legend-color {
    width: 100%;
    height: 20px;
    border: 1px solid #ddd;
    border-radius: 2px;
}

.legend-label {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

.year-control {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.year-control label {
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
}

#year-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

#year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
}

#year-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: none;
}

#play-pause-btn {
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

#play-pause-btn:hover {
    background: #1d4ed8;
}

.control-panel {
    width: 300px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
}

.control-panel h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.mode-toggle {
    margin-bottom: 25px;
}

.mode-toggle label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.toggle-buttons {
    display: flex;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: #2563eb;
    background: #f0f4ff;
}

.mode-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

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

.color-controls h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.slider-group {
    margin-bottom: 20px;
}

.slider-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: none;
}

.reset-button {
    width: 100%;
    padding: 12px;
    background: #f3f4f6;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 20px;
}

.reset-button:hover {
    background: #e5e7eb;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip strong {
    display: block;
    margin-bottom: 4px;
}

.tooltip span {
    display: block;
    font-size: 11px;
    opacity: 0.9;
}

@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
    }
}

