/* Custom CSS for AQI Monitor Delhi-NCR */

:root {
    /* AQI Color Scheme */
    --aqi-good: #00e400;
    --aqi-satisfactory: #ffff00;
    --aqi-moderate: #ff7e00;
    --aqi-poor: #ff0000;
    --aqi-very-poor: #8f3f97;
    --aqi-severe: #7e0023;
    
    /* Custom gradients */
    --gradient-primary: linear-gradient(135deg, #007bff, #0056b3);
    --gradient-success: linear-gradient(135deg, #28a745, #20c997);
    --gradient-warning: linear-gradient(135deg, #ffc107, #fd7e14);
    --gradient-danger: linear-gradient(135deg, #dc3545, #c82333);
}

/* Hero Section - FIXED */
.hero-section {
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    min-height: 60vh;
    position: relative;
    overflow: hidden;
    color: black;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section h4,
.hero-section h5,
.hero-section h6,
.hero-section p,
.hero-section .text-muted {
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-section .text-muted {
    opacity: 0.9;
}

/* ===== CHART RESPONSIVE FIXES ===== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Make Chart.js canvases responsive */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* Specific chart adjustments */
#sourceChart, #fireChart, #regionalChart {
    width: 100% !important;
    height: 250px !important;
}

/* Card body padding adjustments for charts */
.card-body {
    padding: 1.25rem;
    overflow: hidden;
}

/* Feature Icons */
.feature-icon {
    width: 80px;
    height: 80px;
}

/* AQI Category Colors */
.aqi-good { color: var(--aqi-good) !important; }
.aqi-satisfactory { color: var(--aqi-satisfactory) !important; }
.aqi-moderate { color: var(--aqi-moderate) !important; }
.aqi-poor { color: var(--aqi-poor) !important; }
.aqi-very-poor { color: var(--aqi-very-poor) !important; }
.aqi-severe { color: var(--aqi-severe) !important; }

.bg-aqi-good { background-color: var(--aqi-good) !important; }
.bg-aqi-satisfactory { background-color: var(--aqi-satisfactory) !important; }
.bg-aqi-moderate { background-color: var(--aqi-moderate) !important; }
.bg-aqi-poor { background-color: var(--aqi-poor) !important; }
.bg-aqi-very-poor { background-color: var(--aqi-very-poor) !important; }
.bg-aqi-severe { background-color: var(--aqi-severe) !important; }

/* Station Cards */
.station-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.station-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

.station-card.good { border-left-color: var(--aqi-good); }
.station-card.satisfactory { border-left-color: var(--aqi-satisfactory); }
.station-card.moderate { border-left-color: var(--aqi-moderate); }
.station-card.poor { border-left-color: var(--aqi-poor); }
.station-card.very-poor { border-left-color: var(--aqi-very-poor); }
.station-card.severe { border-left-color: var(--aqi-severe); }

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Badges */
.badge-aqi {
    font-size: 0.9em;
    padding: 0.5em 1em;
}

/* Cards */
.card {
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.1);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .display-1 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .hero-section {
        min-height: 50vh;
    }
    
    /* Chart adjustments for tablets */
    .chart-container {
        height: 250px;
    }
    
    #sourceChart, #fireChart, #regionalChart {
        height: 200px !important;
    }
    
    /* Card body padding reduction */
    .card-body {
        padding: 1rem;
    }
    
    /* Metric cards stack vertically */
    .row.mb-5 .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Header text adjustments */
    h1.display-5 {
        font-size: 1.8rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .display-1 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Chart adjustments for mobile */
    .chart-container {
        height: 200px;
    }
    
    #sourceChart, #fireChart, #regionalChart {
        height: 150px !important;
    }
    
    /* Smaller text for mobile */
    .card-header h4 {
        font-size: 1.1rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    /* Metric cards full width */
    .row.mb-5 .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Button group adjustments */
    .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Monitoring systems stack vertically */
    .row.g-3 .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 400px) {
    /* Extra small devices */
    .chart-container {
        height: 180px;
    }
    
    #sourceChart, #fireChart, #regionalChart {
        height: 130px !important;
    }
    
    .display-5 {
        font-size: 1.3rem;
    }
    
    .lead {
        font-size: 1rem;
    }
}

/* Custom utility classes */
.bg-white\/10 {
    background-color: rgba(255, 255, 255, 0.1);
}

.bg-success\/10 {
    background-color: rgba(40, 167, 69, 0.1);
}

.bg-primary\/10 {
    background-color: rgba(0, 123, 255, 0.1);
}

.bg-warning\/10 {
    background-color: rgba(255, 193, 7, 0.1);
}

.bg-danger\/10 {
    background-color: rgba(220, 53, 69, 0.1);
}

.bg-info\/10 {
    background-color: rgba(23, 162, 184, 0.1);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Progress bars with AQI colors */
.progress-bar.aqi-good { background-color: var(--aqi-good); }
.progress-bar.aqi-satisfactory { background-color: var(--aqi-satisfactory); }
.progress-bar.aqi-moderate { background-color: var(--aqi-moderate); }
.progress-bar.aqi-poor { background-color: var(--aqi-poor); }
.progress-bar.aqi-very-poor { background-color: var(--aqi-very-poor); }
.progress-bar.aqi-severe { background-color: var(--aqi-severe); }

/* Backdrop blur effect */
.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Alert animations */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Custom button styles */
.btn-gradient-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.btn-gradient-success {
    background: var(--gradient-success);
    border: none;
    color: white;
}

/* Table styles */
.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online { background-color: var(--aqi-good); }
.status-warning { background-color: var(--aqi-moderate); }
.status-offline { background-color: var(--aqi-poor); }

/* Pollutant level indicators */
.pollutant-level {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.8);
    border-left: 4px solid transparent;
}

.pollutant-level.pm25 { border-left-color: #e74c3c; }
.pollutant-level.pm10 { border-left-color: #f39c12; }
.pollutant-level.o3 { border-left-color: #3498db; }
.pollutant-level.no2 { border-left-color: #9b59b6; }
.pollutant-level.so2 { border-left-color: #1abc9c; }
.pollutant-level.co { border-left-color: #34495e; }

/* Recommendation cards */
.recommendation-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Interactive elements */
.interactive-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.2);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Additional mobile-specific fixes */
.mobile-chart-wrapper {
    position: relative;
    overflow-x: auto;
}

.mobile-chart-container {
    min-width: 300px;
}

/* Ensure Chart.js maintains aspect ratio on mobile */
@media (max-width: 768px) {
    .chartjs-render-monitor {
        max-height: 200px;
    }
}
