/* Base styles */
:root {
    --primary-color: #4299e1;
    --secondary-color: #48bb78;
    --background-color: #f7fafc;
    --text-color: #2d3748;
    --border-color: #e2e8f0;
    --sidebar-width: 400px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    background-color: var(--background-color);
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #718096;
    font-size: 0.9rem;
}

/* Search Container */
.search-container {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.search-box button,
.location-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-box button:hover,
.location-btn:hover {
    background-color: #3182ce;
}

.location-btn {
    width: 100%;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Icons */
.search-icon,
.location-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* Data Controls */
.data-controls {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.pollutant-select {
    margin-bottom: 1rem;
}

.pollutant-select label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #4a5568;
}

.pollutant-select select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: white;
    font-size: 0.9rem;
}

/* View Controls */
.view-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.switch input {
    display: none;
}

.slider {
    position: relative;
    width: 2.5rem;
    height: 1.25rem;
    background-color: #cbd5e0;
    border-radius: 1rem;
    transition: background-color 0.2s;
}

.slider:before {
    content: '';
    position: absolute;
    height: 1rem;
    width: 1rem;
    left: 0.125rem;
    bottom: 0.125rem;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.switch input:checked + .slider {
    background-color: var(--primary-color);
}

.switch input:checked + .slider:before {
    transform: translateX(1.25rem);
}

/* Tabs */
.tab-container {
    border-bottom: 1px solid var(--border-color);
}

.tabs {
    display: flex;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    padding: 1rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Charts */
.chart-container {
    height: 200px;
    margin-bottom: 1rem;
}

/* Data Displays */
.aqi-value {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.aqi-label {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.aqi-description {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #4a5568;
}

.aqi-time {
    text-align: center;
    font-size: 0.8rem;
    color: #718096;
}

.trends-summary,
.forecast-summary {
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.9rem;
}

.trends-summary div,
.forecast-summary div {
    margin-bottom: 0.5rem;
}

.forecast-note {
    font-size: 0.8rem;
    color: #718096;
    font-style: italic;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
}

.map-overlay {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loader {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Toggle Button */
.toggle-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.toggle-icon {
    display: block;
    width: 1.5rem;
    height: 2px;
    background-color: var(--text-color);
    position: relative;
}

.toggle-icon:before,
.toggle-icon:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.2s;
}

.toggle-icon:before {
    top: -6px;
}

.toggle-icon:after {
    bottom: -6px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toggle-btn {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .map-container {
        margin-left: 0;
    }
} 