body {
    font-family: Arial, sans-serif;
    background: #0b1221;
    margin: 0;
    padding: 0;
    color: #e5e7eb;
}

.container {
    max-width: 960px;
    margin: 24px auto;
    padding: 20px;
    background: rgba(11, 17, 29, 0.92);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.subtitle {
    font-size: 1.1em;
    color: #94a3b8;
    margin-top: -10px;
}

h1, h2, h3, h4 {
    text-align: center;
    color: #f3f4f6;
}

.about-section {
    margin-top: 50px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    line-height: 1.6;
}

.about-section h2 {
    text-align: left;
    margin-top: 0;
    color: #93c5fd;
}

.about-section h3 {
    text-align: left;
    margin-top: 25px;
    color: #f3f4f6;
}

.about-section p {
    margin-bottom: 15px;
    color: #cbd5e1;
}

.about-section ul {
    list-style-type: disc;
    margin-left: 20px;
    color: #cbd5e1;
}

.about-section li {
    margin-bottom: 8px;
}

a {
    color: #93c5fd;
}

a:hover {
    color: #bfdbfe;
}

.controls {
    text-align: center;
    margin-bottom: 20px;
}

.controls form {
    display: inline-block;
}

.controls label {
    margin-right: 5px;
    color: #e5e7eb;
}

.controls input[type="date"] {
    padding: 5px 34px 5px 8px;
    margin-right: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e5e7eb;
    border-radius: 6px;
    position: relative;
}

/* High-contrast calendar icon for dark background */
.controls input[type="date"]::-webkit-calendar-picker-indicator {
    background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2' ry='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E") no-repeat center;
    background-size: 16px 16px;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    opacity: 1;
}

.controls input[type="date"]::-moz-focus-inner {
    border: 0;
}

.controls button, #downloadCSV {
    padding: 5px 12px;
    background-color: #2563eb;
    border: none;
    color: #f8fafc;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.controls button:hover, #downloadCSV:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.output {
    margin-top: 20px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

table th, table td {
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 8px;
    text-align: right;
    color: #e2e8f0;
}

table th {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f3f4f6;
}

.chart-container {
    margin-bottom: 20px;
}

.settings-panel {
    background: rgba(255, 255, 255, 0.04);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.checkbox-grid label {
    min-width: 80px;
    color: #e5e7eb;
}

.chart-legend {
    text-align: center;
    margin-bottom: 10px;
}

.custom-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 0;
    gap: 10px; /* spacing between items */
}

.custom-legend span {
    padding: 5px 10px;
    color: white;
    font-weight: bold;
    border-radius: 6px; /* rounded corners */
    font-size: 0.9em;
}

#settingsToggle {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e5e7eb;
    font-size: 1.15em;
    cursor: pointer;
    margin-left: 10px;
    border-radius: 8px;
    padding: 4px 8px;
}

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

.area-toggle-buttons button {
    padding: 5px 10px;
    background-color: #16a34a;
    border: none;
    color: #f8fafc;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.area-toggle-buttons button:hover {
    background-color: #15803d;
    transform: translateY(-1px);
}

.area-toggle-buttons button#hideAllAreas {
    background-color: #9a3412;
}

.area-toggle-buttons button#hideAllAreas:hover {
    background-color: #7c2d12;
}

.output h2, .output p {
    color: #e5e7eb;
}

.chart-container {
    margin-bottom: 20px;
    background: #0f172a;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.custom-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 0;
    gap: 10px; /* spacing between items */
}

@media (max-width: 600px) {
    .container {
        margin: 10px;
        padding: 15px;
    }

    .controls input[type="date"] {
        width: calc(100% - 20px);
        margin: 5px 0;
    }

    .controls button {
        width: 100%;
        margin-top: 10px;
    }

    #settingsToggle {
        margin: 10px 0 0 0;
        width: 100%;
    }

    .area-toggle-buttons {
        flex-direction: column;
    }

    .area-toggle-buttons button {
        width: 100%;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
