#map-container {
    position: relative;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.controls-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(255,255,255,0.85);
    padding: 10px 8px 6px 8px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin: 0;
}

.play-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.year-display {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
}

#year-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--secondary-color);
    border-radius: 3px;
    outline: none;
}

#year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

#year-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.visualization-area {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    margin: 10px 0 0 0;
    max-width: 100vw;
    min-height: 320px;
    overflow: hidden;
}

#world-map {
    width: 100%;
    height: 60vh;
    min-height: 320px;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: auto;
    margin: 0 auto;
    display: block;
}

/* Country Labels */
.country-labels {
    pointer-events: none;
}

.label-country {
    font-size: 12px;
    font-weight: 600;
    fill: #333;
    font-family: 'Montserrat', sans-serif;
    opacity: 0.9;
}

.label-count {
    font-size: 11px;
    fill: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    opacity: 0.85;
}

/* Map Styles */
.country {
    fill: #e0e0e0;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 0.5;
    transition: all 0.3s ease;
}

.country:hover {
    stroke-width: 1;
    stroke: var(--primary-color);
    cursor: pointer;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    pointer-events: none;
    font-family: 'Montserrat', sans-serif;
    z-index: 1000;
}

.tooltip .country-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.tooltip .stat-item {
    margin: 3px 0;
    font-size: 0.9em;
}

.tooltip .stat-label {
    color: #666;
}

.tooltip .stat-value {
    font-weight: 500;
    margin-left: 5px;
}

/* Trends Chart */
.trends-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    margin-top: 20px;
}

.trends-panel h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.trends-panel .chart-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.layer {
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.layer:hover {
    opacity: 1;
}

.axis-label {
    font-size: 12px;
    fill: #555;
    font-family: 'Montserrat', sans-serif;
}

/* Legend and Controls */
#legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Chart explanation box for map and trends chart */
.chart-explanation {
    margin-bottom: 30px;
    background-color: rgba(30, 86, 49, 0.05);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color, #1e5631);
}

.chart-explanation h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color, #1e5631);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.chart-explanation p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #444;
}

.chart-explanation p:last-child {
    margin-bottom: 0;
}

/* Add left margin and padding for lists in chart-explanation */
.chart-explanation ul {
    margin-left: 1.5em;
    padding-left: 1.5em;
}

/* Global Timeline Chart Styles */
/* Removed #global-timeline-chart container styles for consistency. Use .chart-container from tennis_analytics.css instead. */

.global-timeline-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.global-timeline-legend-item {
    display: flex;
    align-items: center;
    font-size: 1rem;
    color: #333;
}

.global-timeline-legend-color {
    width: 18px;
    height: 4px;
    border-radius: 2px;
    margin-right: 8px;
    display: inline-block;
}

/* Make Plotly slider and updatemenu containers transparent */
.plotly .slider-container,
.plotly .slider,
.plotly .updatemenu-container {
    background: transparent !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .label-country {
        font-size: 10px;
    }
    
    .label-count {
        font-size: 9px;
    }
    
    .trends-panel {
        padding: 15px;
    }
    
    .chart-explanation {
        padding: 15px;
    }
    .chart-explanation h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 900px) {
    #world-map {
        height: 40vh;
        min-height: 200px;
    }
    .visualization-area {
        min-height: 200px;
    }
    .controls-panel {
        flex-direction: column;
        gap: 8px;
        padding: 8px 4px 4px 4px;
    }
}

@media (max-width: 600px) {
    #world-map {
        height: 32vh;
        min-height: 120px;
    }
    .visualization-area {
        min-height: 120px;
    }
    .controls-panel {
        font-size: 0.95rem;
        padding: 6px 2px 2px 2px;
    }
}