/* Divyadrishti - Air Quality Monitoring System */
/* Dark Blue Futuristic Theme - Responsive CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a202c, #2d3748);
    color: #f7fafc;
    min-height: 100vh;
    line-height: 1.6;
    background-color: #1e2a38;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af, #1a202c);
    border-bottom: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo-container {
    padding: 0.5rem;
    background: rgba(34, 211, 238, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    backdrop-filter: blur(10px);
}

.logo-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.5));
}

.app-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    background: linear-gradient(135deg, #22d3ee, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
}

.app-subtitle {
    color: rgba(34, 211, 238, 0.8);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    margin-top: 0.25rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-info {
    background: rgba(30, 58, 138, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
    min-width: 120px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    margin-bottom: 0.25rem;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-label {
    color: rgba(34, 211, 238, 0.8);
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #22d3ee, #0ea5e9);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3);
    font-size: clamp(0.875rem, 2vw, 1rem);
    min-height: 44px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 211, 238, 0.4);
}

.btn-secondary {
    background: rgba(34, 211, 238, 0.2);
    color: rgba(34, 211, 238, 0.9);
    border: 1px solid rgba(34, 211, 238, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: clamp(0.875rem, 2vw, 1rem);
    min-height: 44px;
}

.btn-secondary:hover {
    background: rgba(34, 211, 238, 0.3);
    border-color: rgba(34, 211, 238, 0.6);
}

.refresh-icon {
    font-size: 1.2rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-secondary:hover .refresh-icon {
    transform: rotate(180deg);
}

/* Main Content */
.main-content {
    padding: 1rem 0;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    max-width: 100%;
    margin: 0 auto;
    flex-wrap: wrap;
}

.location-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.8);
    color: #f1f5f9;
    font-size: clamp(0.875rem, 2vw, 1rem);
    backdrop-filter: blur(10px);
}

.location-input:focus {
    outline: none;
    border-color: #22d3ee;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.location-input::placeholder {
    color: rgba(241, 245, 249, 0.5);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* AQI Main Card */
.aqi-main-card {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.6);
    transition: transform 0.3s ease;
}

.aqi-main-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.8), 0 0 30px rgba(34, 211, 238, 0.3);
}

.aqi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.aqi-header h2 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 600;
    color: #f1f5f9;
}

.aqi-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    white-space: nowrap;
}

.aqi-value {
    text-align: center;
    margin-bottom: 1.5rem;
}

.aqi-number {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, #22d3ee, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(34, 211, 238, 0.6);
}

.aqi-unit {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: rgba(34, 211, 238, 0.8);
    margin-left: 0.5rem;
}

.aqi-description {
    text-align: center;
    color: rgba(241, 245, 249, 0.8);
    margin-bottom: 2rem;
    line-height: 1.5;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.pollutant-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.pollutant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 8px;
}

.pollutant-name {
    font-weight: 600;
    color: #22d3ee;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.pollutant-value {
    color: #f1f5f9;
    font-weight: 500;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

/* Health Card */
.health-card {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.6);
}

.health-card h3 {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.recommendation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(34, 211, 238, 0.1);
}

.recommendation-item:last-child {
    border-bottom: none;
}

.rec-icon {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    flex-shrink: 0;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.6);
}

.chart-container h3 {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.chart-placeholder {
    height: clamp(150px, 30vw, 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 211, 238, 0.1);
    border: 1px dashed rgba(34, 211, 238, 0.3);
    border-radius: 8px;
    color: rgba(34, 211, 238, 0.7);
    font-size: clamp(0.875rem, 2vw, 1rem);
    text-align: center;
    padding: 1rem;
}

/* Sources List */
.sources-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.source-name {
    min-width: 120px;
    font-weight: 500;
    color: #f1f5f9;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.source-bar {
    flex: 1;
    min-width: 100px;
    height: 8px;
    background: rgba(34, 211, 238, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.source-progress {
    height: 100%;
    background: linear-gradient(135deg, #22d3ee, #0ea5e9);
    border-radius: 4px;
    transition: width 0.6s ease;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

.source-value {
    min-width: 40px;
    font-weight: 600;
    color: #22d3ee;
    text-align: right;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
}

.info-icon {
    font-size: clamp(1.5rem, 4vw, 2rem);
    padding: 0.5rem;
    background: rgba(34, 211, 238, 0.2);
    border-radius: 8px;
    flex-shrink: 0;
}

.info-label {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: rgba(34, 211, 238, 0.8);
}

.info-value {
    font-weight: 600;
    color: #f1f5f9;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

/* AQI Scale */
.aqi-scale-card {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.6);
    margin-bottom: 2rem;
}

.aqi-scale-card h3 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 1.5rem;
    text-align: center;
}

.aqi-scale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.scale-item {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: transform 0.3s ease;
}

.scale-item:hover {
    transform: translateY(-2px);
}

.scale-item.good {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}

.scale-item.moderate {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
}

.scale-item.unhealthy-sensitive {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: #f97316;
}

.scale-item.unhealthy {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
}

.scale-item.very-unhealthy {
    background: linear-gradient(135deg, #a855f7, #9333ea);
    border-color: #a855f7;
}

.scale-item.hazardous {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border-color: #7f1d1d;
}

.scale-range {
    font-weight: 700;
    font-size: clamp(1rem, 3vw, 1.1rem);
    color: white;
    margin-bottom: 0.5rem;
}

.scale-label {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.satellite-section {
    background-color: #263240;
    padding: clamp(1rem, 4vw, 1.5rem);
    border-radius: 16px;
    margin-top: 2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.satellite-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.satellite-icon {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
}

.layer-btn {
    background-color: #fff;
    color: #000;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0.25rem 0.5rem 0.25rem 0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease-in-out;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    min-height: 40px;
}

.layer-btn.active {
    background-color: #007bff;
    color: #fff;
    font-weight: 700;
}

.map-placeholder {
    background-color: #1f2b39;
    padding: clamp(1rem, 4vw, 1.25rem);
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.globe-icon {
    font-size: clamp(1.25rem, 4vw, 1.375rem);
}

.map-title {
    font-size: clamp(1rem, 3vw, 1.125rem);
    font-weight: 600;
}

.map-subtitle {
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: #cccccc;
}

.data-panel h4,
.data-sources h4 {
    font-size: clamp(1rem, 3vw, 1.125rem);
    margin-bottom: 12px;
    color: #ffffff;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.metric-label {
    font-weight: 500;
    color: #d9d9d9;
}

.metric-value {
    font-weight: bold;
    color: #ffffff;
}

.source-list {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    flex-wrap: wrap;
}

.source-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.source-dot.green { background-color: #00ff87; }
.source-dot.blue { background-color: #00bfff; }
.source-dot.yellow { background-color: #ffc107; }

/* Footer */
.footer {
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid rgba(34, 211, 238, 0.2);
    padding: 2rem 0;
    margin-top: 3rem;
    backdrop-filter: blur(10px);
}

.footer-content {
    text-align: center;
}

.footer-content p {
    color: rgba(34, 211, 238, 0.7);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    margin-bottom: 0.5rem;
}

.footer-brand {
    color: #22d3ee !important;
    font-weight: 600 !important;
    font-size: clamp(0.875rem, 2vw, 1rem) !important;
    margin-top: 1rem !important;
}

/* Chatbot Styles */
#chatbotIcon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #003366;
    color: white;
    padding: 12px 14px;
    border-radius: 50%;
    cursor: pointer;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    min-height: 56px;
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbotBox {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: clamp(280px, 90vw, 320px);
    height: clamp(300px, 60vh, 450px);
    background: #1e293b;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: Arial, sans-serif;
    z-index: 9999;
}

#chatbotHeader {
    background: #003366;
    color: white;
    font-weight: bold;
    padding: 12px;
    font-size: clamp(1rem, 3vw, 1.125rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatMessages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.message {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 85%;
    line-height: 1.4;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.user-message {
    background-color: #2563eb;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.bot-message {
    background-color: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    margin-right: auto;
}

#chatInput {
    border: none;
    padding: 12px;
    font-size: clamp(0.875rem, 2vw, 1rem);
    width: 100%;
    box-sizing: border-box;
    outline: none;
    min-height: 44px;
}

/* Media Queries */
@media (min-width: 640px) {
    .search-container {
        max-width: 500px;
    }

    .charts-section {
        grid-template-columns: 1fr 1fr;
    }

    .info-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (min-width: 768px) {
    .header-content {
        padding: 1.5rem 0;
        gap: 2rem;
    }

    .logo-container {
        padding: 0.75rem;
    }

    .logo-image {
        width: 40px;
        height: 40px;
    }

    .main-content {
        padding: 2rem 0;
    }

    .aqi-main-card {
        padding: 2rem;
    }

    .aqi-scale-card {
        padding: 2rem;
    }

    .satellite-section {
        padding: 1.5rem;
        margin-top: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }

    .pollutant-details {
        grid-template-columns: 1fr 1fr;
    }

    .aqi-scale-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    #chatbotBox {
        right: 20px;
        width: 320px;
        height: 450px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .pollutant-details {
        grid-template-columns: 1fr;
    }

    .search-container {
        flex-direction: column;
    }

    .source-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .source-bar {
        width: 100%;
    }

    #chatbotBox {
        bottom: 80px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    #chatbotIcon {
        bottom: 10px;
        right: 10px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-secondary {
        border-width: 2px;
    }

    .card,
    .aqi-main-card,
    .health-card,
    .chart-container,
    .info-card {
        border-width: 2px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    .layer-btn {
        min-height: 48px;
        min-width: 48px;
    }

    .location-input,
    #chatInput {
        min-height: 48px;
    }
}
