/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin: 20px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Styles */
.dashboard-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section i {
    font-size: 2rem;
    color: #2ecc71;
}

.logo-section h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 300;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.refresh-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.last-updated {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Navigation Styles */
.dashboard-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0 30px;
}

.nav-list {
    display: flex;
    list-style: none;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
}

.nav-item {
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.nav-item.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.nav-item i {
    font-size: 1.1rem;
}

/* Main Content Styles */
.dashboard-main {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.section-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.overview-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid #3498db;
}

.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.air-quality-card { border-left-color: #e74c3c; }
.traffic-card { border-left-color: #f39c12; }
.population-card { border-left-color: #9b59b6; }
.parks-card { border-left-color: #2ecc71; }
.services-card { border-left-color: #3498db; }
.safety-card { border-left-color: #e67e22; }

.overview-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.air-quality-card .card-icon { color: #e74c3c; }
.traffic-card .card-icon { color: #f39c12; }
.population-card .card-icon { color: #9b59b6; }
.parks-card .card-icon { color: #2ecc71; }
.services-card .card-icon { color: #3498db; }
.safety-card .card-icon { color: #e67e22; }

.card-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.metric-status {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    min-height: 300px;
    position: relative;
}

.chart-container h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.chart-container canvas {
    max-height: 300px !important;
    width: 100% !important;
}

/* Air Quality Specific Styles */
.air-quality-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.air-quality-summary {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.aqi-display {
    text-align: center;
    margin-bottom: 30px;
}

.aqi-value {
    font-size: 4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.aqi-label {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.aqi-status {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

.pollutant-levels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.pollutant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.pollutant-name {
    font-weight: 600;
    color: #2c3e50;
}

.pollutant-value {
    font-weight: 700;
    color: #3498db;
}

/* Traffic Styles */
.traffic-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.traffic-incidents {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.incidents-list {
    max-height: 400px;
    overflow-y: auto;
}

.incident-item {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.incident-item:last-child {
    border-bottom: none;
}

/* Demographics Styles */
.demographics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.demographic-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-item h4 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Environment & Health Styles */
.environment-grid,
.health-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Safety Styles */
.safety-stats,
.services-stats,
.education-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.incidents-timeline,
.services-list {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.timeline-list,
.requests-list {
    max-height: 400px;
    overflow-y: auto;
}

.timeline-item,
.request-item {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.timeline-item:last-child,
.request-item:last-child {
    border-bottom: none;
}

.incident-info,
.request-info {
    flex: 1;
}

.incident-type,
.request-type {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.incident-description,
.request-description {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.incident-location,
.request-location {
    color: #95a5a6;
    font-size: 0.8rem;
}

.incident-time,
.request-time {
    font-size: 0.8rem;
    color: #95a5a6;
    white-space: nowrap;
}

/* Maps Section */
.map-controls {
    margin-bottom: 20px;
}

.map-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 15px;
    border: 2px solid #ecf0f1;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.map-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.interactive-map {
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.map-info-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
}

.map-info-panel h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.location-details {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.location-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.location-card h4 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.location-card .metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.location-card .metric-label {
    font-size: 0.8rem;
    color: #95a5a6;
}

/* Transit Section */
.transit-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.transit-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border-left: 5px solid #3498db;
}

.transit-card:hover {
    transform: translateY(-5px);
}

.transit-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #3498db;
}

.weather-card {
    border-left-color: #f39c12;
}

.weather-card .card-icon {
    color: #f39c12;
}

.transit-alerts {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.alerts-list {
    max-height: 400px;
    overflow-y: auto;
}

.alert-item {
    padding: 15px;
    border-left: 4px solid #e74c3c;
    background: #fdf2f2;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-item.warning {
    border-left-color: #f39c12;
    background: #fdf6e3;
}

.alert-item.info {
    border-left-color: #3498db;
    background: #ebf3fd;
}

.alert-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.alert-description {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.weather-details {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.weather-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.weather-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 600;
}

.weather-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
}

.parks-summary,
.health-summary {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.parks-stats,
.health-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.park-stat,
.health-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-label {
    font-weight: 600;
    color: #2c3e50;
}

.stat-value {
    font-weight: 700;
    color: #3498db;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #3498db;
}

.loading-spinner p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* AQI Status Colors */
.aqi-good { background: #2ecc71; color: white; }
.aqi-moderate { background: #f39c12; color: white; }
.aqi-unhealthy-sensitive { background: #e67e22; color: white; }
.aqi-unhealthy { background: #e74c3c; color: white; }
.aqi-very-unhealthy { background: #8e44ad; color: white; }
.aqi-hazardous { background: #2c3e50; color: white; }

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .dashboard-main {
        padding: 20px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        margin: 0;
        border-radius: 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-main {
        padding: 15px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .air-quality-grid,
    .demographics-grid,
    .environment-grid,
    .health-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-container {
        padding: 20px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .nav-list {
        padding: 0 10px;
    }
    
    .nav-item {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: 10px;
    }
    
    .overview-card,
    .chart-container,
    .air-quality-summary {
        padding: 20px;
    }
    
    .metric-value {
        font-size: 1.8rem;
    }
    
    .aqi-value {
        font-size: 3rem;
    }
    
    .traffic-stats,
    .demographic-stats {
        grid-template-columns: 1fr;
    }
}