:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #38bdf8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* AQI Colors */
    --aqi-good: #00e400;
    --aqi-moderate: #ffff00;
    --aqi-sensitive: #ff7e00;
    --aqi-unhealthy: #ff0000;
    --aqi-very-unhealthy: #8f3f97;
    --aqi-hazardous: #7e0023;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.glass-header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    text-align: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.glass-header p {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 300px;
    margin: 0 auto;
}

#search-input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 12px;
    flex: 1;
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#search-btn {
    background: var(--accent-color);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

#search-btn:hover {
    background: #0ea5e9;
}

#map-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.glass-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

.dot.good {
    background-color: var(--aqi-good);
}

.dot.moderate {
    background-color: var(--aqi-moderate);
}

.dot.unhealthy-sensitive {
    background-color: var(--aqi-sensitive);
}

.dot.unhealthy {
    background-color: var(--aqi-unhealthy);
}

.dot.very-unhealthy {
    background-color: var(--aqi-very-unhealthy);
}

.dot.hazardous {
    background-color: var(--aqi-hazardous);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Map Popup Styles */
.leaflet-popup-content-wrapper {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(5px);
    color: #fff;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaflet-popup-tip {
    background: rgba(30, 41, 59, 0.9);
}

.popup-content h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.popup-content .aqi-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 5px 0;
}

.popup-content .aqi-status {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}