:root {
    /* Light mode colors */
    --color-background: #f9f9f9;
    --color-container-bg: #fff;
    --color-text: #000;
    --color-heading: #2c3e50;
    --color-highlight-light: #f0fdf4;
    --color-highlight: #1abc9c;
    --color-highlight-dark: #16a085;
    --color-location-bg: #ecf0f1;
    --color-location-text: #34495e;
    --color-border: #ccc;
    --color-border-focus: var(--color-highlight);
    --color-suggestion-hover-bg: var(--color-highlight);
    --color-suggestion-hover-text: #fff;
    --color-shadow-light: rgba(0, 0, 0, 0.1);
    --color-shadow-medium: rgba(0, 0, 0, 0.12);
    --color-shadow-suggestions: rgba(0, 0, 0, 0.2);

    /* Spacing */
    --space-small: 0.4rem;
    --space-medium: 0.5rem;
    --space-large: 1rem;
    --space-xlarge: 1.5rem;

    /* Typography */
    --font-family-base: "Inter", sans-serif;
    --font-size-base: 1rem;
    --font-size-large: 1.2rem;
    --font-size-small: 0.9rem;
    --border-radius: 8px;
    --border-radius-pill: 20px;
}

/* Dark mode overrides */
.dark-mode {
    --color-background: #121212;
    --color-container-bg: #1e1e1e;
    --color-text: #e0e0e0;
    --color-heading: #a3d9ca;
    --color-highlight-light: #264653;
    --color-highlight: #2a9d8f;
    --color-highlight-dark: #21867a;
    --color-location-bg: #2c2c2c;
    --color-location-text: #a0a0a0;
    --color-border: #444;
    --color-border-focus: var(--color-highlight);
    --color-suggestion-hover-bg: var(--color-highlight);
    --color-suggestion-hover-text: #121212;
    --color-shadow-light: rgba(255, 255, 255, 0.1);
    --color-shadow-medium: rgba(255, 255, 255, 0.12);
    --color-shadow-suggestions: rgba(255, 255, 255, 0.2);
}

/* Reset & Box-sizing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    color: var(--color-text);
    padding: var(--space-large);
    min-height: 100vh;
    display: grid;
    place-content: center;
    background-color: var(--color-background);
    background-image: radial-gradient(circle, var(--color-border) 1px, transparent 1px);
    background-size: 20px 20px;
}

.container {
    background: var(--color-container-bg);
    border: 1px solid var(--color-border);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.05), 0 8px 20px var(--color-shadow-medium);
    border-radius: 8px;
    padding: var(--space-large);
    max-width: 700px;
    margin: 0 auto;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#darkModeToggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 28px;
    background: #00b5ff;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px;
    box-shadow: 0 2px 6px var(--color-shadow-medium);
    transition: background-color 0.3s ease;
    user-select: none;
    z-index: 10000;
}

/* The circle inside the toggle that moves */
#darkModeIcon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #87ceeb;
    border-radius: 50%;
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

#darkModeIcon svg path {
    fill: #ffff00;
}

/* When dark mode is enabled, move the circle to right */
.dark-mode #darkModeToggle {
    background: black;
    justify-content: flex-end;
}

.dark-mode #darkModeIcon {
    background-color: #444;
    transform: translateX(0);
}

/* Section headers */
.section h2 {
    font-size: 1.3rem;
    margin-bottom: var(--space-large);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.3rem;
    color: var(--color-heading);
}

/* Intro/help text */
.intro {
    font-size: 1.1rem;
    color: var(--color-location-text);
    margin-bottom: var(--space-large);
}

/* Headings */
h1,
h2 {
    color: var(--color-heading);
    margin-bottom: var(--space-small);
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: var(--space-large);
    text-align: center;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* Labels */
label {
    font-weight: 600;
    display: block;
    margin-bottom: var(--space-small);
}

/* Inputs and Selects */
#locationSearch,
select {
    width: 100%;
    padding: var(--space-medium);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xlarge);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    background-color: var(--color-background);
    color: var(--color-text);
}

select:focus,
#locationSearch:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 10px rgba(26, 188, 156, 0.2);
}

/* Info Container */
#info {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#info:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

#info p {
    font-size: var(--font-size-large);
    margin-bottom: var(--space-xlarge);
    color: var(--color-highlight);
    font-weight: 400;
    animation: pulseColor 3s ease-in-out infinite;
}

@keyframes pulseColor {
    0%,
    100% {
        color: var(--color-highlight);
    }
    50% {
        color: var(--color-highlight-dark);
    }
}

/* Location list as pills */
#locationList {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-small);
    list-style: none;
    margin-top: var(--space-large);
    padding-left: 0;
}

#locationList li {
    background-color: var(--color-location-bg);
    padding: var(--space-small) var(--space-medium);
    border-radius: var(--border-radius-pill);
    font-size: var(--font-size-small);
    color: var(--color-location-text);
    white-space: wrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

#locationList li:hover {
    background-color: var(--color-highlight);
    color: var(--color-suggestion-hover-text);
    box-shadow: 0 2px 8px rgba(26, 188, 156, 0.4);
    transform: translateY(-2px);
}

/* Hidden class */
.hidden {
    display: none;
}

/* Suggestions dropdown */
.suggestions {
    position: absolute;
    width: 100%;
    max-width: 300px;
    max-height: 150px;
    overflow-y: auto;
    background: var(--color-container-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 6px var(--color-shadow-suggestions);
    z-index: 1000;
    display: none;
}

.suggestions div {
    padding: var(--space-medium);
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.suggestions div:hover {
    background-color: var(--color-highlight);
    color: var(--color-suggestion-hover-text);
}

/* Bin collection type styling */
.bin-black {
    color: var(--color-text);
    font-weight: bold;
}

.bin-recycle {
    color: var(--color-highlight-dark);
    font-weight: bold;
}

.bin-date {
    font-style: italic;
    color: var(--color-location-text);
}

/* Collection notice container */
#collectionDay,
.collection-notice {
    background-color: var(--color-notice-bg);
    border-left: 6px solid var(--color-highlight);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    margin-top: 1rem;
    box-shadow: 0 2px 10px var(--color-shadow-light);
    animation: fadeInSlideUp 0.4s ease;
}

.collection-notice strong {
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--color-heading);
}

/* Adjusted bin-specific notices */
.collection-notice.bin-black {
    background-color: var(--color-bin-black-bg);
    border-left-color: var(--color-bin-black-border);
}

.collection-notice.bin-recycle {
    background-color: var(--color-highlight-light);
    border-left-color: var(--color-highlight);
}

/* Animation */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
