body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: Arial, sans-serif;
}

#controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px; /* Increased gap for better spacing */
    padding: 10px;
    background: #f8f8f800;
}

/* Common Button Styling for All Buttons */
button {
    padding: 10px 15px;
    background-color: #007BFF; /* Blue background */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px 0;
    width: 100%; /* Full width for buttons within containers */
    text-align: center;
    transition: background-color 0.3s ease; /* Smooth hover transition */
}

/* Hover effect for all buttons */
button:hover {
    background-color: #0056b3; /* Darker blue when hovering */
}

select {
    padding: 10px 15px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px 0;
    width: 100%;
    text-align: center;
    appearance: none; /* Removes default browser styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
}

select:hover {
    background-color: #0056b3;
}

select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Style for the dropdown options */
select option {
    background-color: #ffffff;
    color: #333333;
    padding: 10px;
}

/* Style download links to look like buttons */
a.download-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px 0;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s ease;
    text-decoration: none; /* Remove underline */
    box-sizing: border-box; /* fixes width */
}

a.download-button:hover {
    background-color: #0056b3;
}

/* Specific Style for #add-color-range Button */
#add-color-range {
    background-color: #007BFF; /* Blue background */
}

#add-color-range:hover {
    background-color: #0056b3; /* Darker blue when hovering */
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
}

th, td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

th {
    background: #007BFF;
    color: white;
}

.remove-row {
    background: none;
    border: none;
    color: red;
    font-size: 16px;
    cursor: pointer;
}

#color-table input[type="number"] {
    width: 60px; /* Reduced width */
    text-align: center;
    padding: 2px;
    box-sizing: border-box;
}

#color-table input[type="color"] {
    width: 40px; /* Reduced width */
    padding: 2px;
    box-sizing: border-box;
}

#color-table th, 
#color-table td {
    padding: 5px;
    text-align: center;
    width: auto;
    white-space: nowrap;
}

#color-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Forces table to respect column widths */
}


/* General button styling */
.upload-button {
    position: relative; /* Needed for tooltip positioning */
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
}

/* Tooltip hidden by default */
.tooltip {
    display: none;
    position: absolute;
    top: 120%; /* Position above the button */
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    background-color: rgb(0, 0, 0);
    color: white;
    text-align: left;
    padding: 8px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 10;
}

/* Show tooltip when hovering over the button */
.upload-button:hover .tooltip {
    display: block;
}

/* Optional: Add a small arrow to the tooltip */
.tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}



/* Tooltip for the datawrapper code input */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-wrapper:hover .tooltip,
.tooltip-wrapper:focus-within .tooltip {
    display: block;
}

/* Input and button styles (same as before) */
.code-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.code-input {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 200px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.code-input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.submit-code {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-code:hover {
    background-color: #0056b3;
}

/* Style for the Play/Pause Button */
#playPauseButton {
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745, #218838);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: fit-content; /* Only take up necessary width */
    white-space: nowrap; /* Prevent text wrapping */
}

/* Hover state for the button */
#playPauseButton:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
}

/* Active state (when button is pressed) */
#playPauseButton:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Style for the year slider to ensure it takes up appropriate space */
#yearSlider {
    flex: 1; /* Allow slider to take up remaining space */
    max-width: 300px; /* Limit maximum width */
}

/* Style for the year display */
#currentYear {
    min-width: 50px; /* Ensure consistent width */
    text-align: center;
}

.flash-message {
    padding: 15px;
    margin: 10px 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Optional: Add animation */
.flash-message {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden-settings summary {
    cursor: pointer;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.hidden-settings summary h3 {
    display: inline;
    margin: 0;
    font-size: 1em;
}

.hidden-settings summary::-webkit-details-marker,
.hidden-settings summary::marker {
    color: #666;
}

.hidden-settings-content {
    padding: 10px;
    overflow-x: auto; /* Adds horizontal scroll if needed */
}

.hidden-settings {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 4px;
    max-width: 100%;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.settings-table th, 
.settings-table td {
    padding: 5px;
    text-align: center;
    width: auto;
    white-space: nowrap;
}

.settings-table input[type="number"] {
    width: 60px;
    text-align: center;
    padding: 2px;
    box-sizing: border-box;
}

.settings-table input[type="color"] {
    width: 40px;
    padding: 2px;
    box-sizing: border-box;
}

/* Ensure text boxes fit inside the table */
.legend-label-input {
    width: 100%; /* Ensures it stays inside the cell */
    box-sizing: border-box; /* Prevents overflow */
    padding: 5px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.main-heading {
    margin: 0;
    font-size: 1.6em;
    font-weight: bold;
}

.sub-heading {
    font-size: 0.9em;
    color: #555;
    margin-top: 4px;
    font-weight: 400;
}

#appContainer {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    width: 300px;
    padding: 20px;
    background: #f4f4f4;
    min-height: 100vh;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.right-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    background: #f9f9f9;
}

#mapChartContainer {
    aspect-ratio: 2 / 1;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    position: relative;
}



