/* ================================
   VARIABLES & ROOT STYLES
   ================================ */

:root {
    --primary-green: #10b981;
    --primary-dark: #059669;
    --secondary-green: #34d399;
    --light-green: #d1fae5;
    --off-white: #f8fafc;
    --dark-bg: #1e293b;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 10px 30px rgba(16, 185, 129, 0.15);
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.08);
    
    /* AQI Colors */
    --aqi-good: #22c55e;
    --aqi-moderate: #eab308;
    --aqi-sensitive: #f97316;
    --aqi-unhealthy: #ef4444;
    --aqi-very-unhealthy: #a855f7;
    --aqi-hazardous: #7c2d12;
    
    /* Font */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 16px;
    --line-height: 1.6;
}

body.dark-mode {
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --off-white: #0f172a;
}

/* ================================
   GLOBAL STYLES
   ================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    background-color: var(--off-white);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(14px, 2.5vw, 20px);
}

img,
canvas,
svg,
video {
    max-width: 100%;
}

input,
button,
select,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

/* ================================
   LOADING OVERLAY
   ================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

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

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-green);
    border-top: 5px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ================================
   NAVIGATION BAR
   ================================ */

.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--light-green);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-green);
}

.logo i {
    font-size: 2rem;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-green);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.dark-mode-btn {
    background: var(--light-green);
    color: var(--primary-green);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-btn:hover {
    transform: scale(1.1);
    background: var(--primary-green);
    color: white;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-green);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* ================================
   HERO SECTION
   ================================ */

.hero {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 120px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,50 Q300,0 600,50 T1200,50 L1200,120 L0,120 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-repeat: repeat-x;
    background-size: 600px 120px;
    animation: wave 15s linear infinite;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(600px); }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    animation: slideUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: slideUp 0.8s ease-out 0.2s both;
}

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

.hero-search {
    margin-top: 3rem;
}

.location-detecting-hint {
    margin-top: 10px;
    min-height: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.location-detecting-hint.visible {
    opacity: 1;
}

.search-box {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.8s ease-out 0.4s both;
    flex-wrap: wrap;
    justify-content: center;
}

.location-input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 50px;
    outline: none;
}

.location-input::placeholder {
    color: var(--text-secondary);
}

.search-btn,
.geo-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.geo-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
    justify-content: center;
}

/* ================================
   DASHBOARD SECTION
   ================================ */

.dashboard-section {
    padding: 60px 20px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.location-info {
    text-align: center;
    margin-bottom: 2rem;
}

.location-name {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-green);
}

.location-time {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* AQI Main Card */
.aqi-main-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 40px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.aqi-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    position: relative;
    flex-shrink: 0;
}

.aqi-circle.good {
    background: linear-gradient(135deg, var(--aqi-good), #16a34a);
    box-shadow: 0 15px 40px rgba(34, 197, 94, 0.3);
}

.aqi-circle.moderate {
    background: linear-gradient(135deg, var(--aqi-moderate), #ca8a04);
    box-shadow: 0 15px 40px rgba(234, 179, 8, 0.3);
}

.aqi-circle.sensitive {
    background: linear-gradient(135deg, var(--aqi-sensitive), #ea580c);
    box-shadow: 0 15px 40px rgba(249, 115, 22, 0.3);
}

.aqi-circle.unhealthy {
    background: linear-gradient(135deg, var(--aqi-unhealthy), #dc2626);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.3);
}

.aqi-circle.very-unhealthy {
    background: linear-gradient(135deg, var(--aqi-very-unhealthy), #9333ea);
    box-shadow: 0 15px 40px rgba(168, 85, 247, 0.3);
}

.aqi-circle.hazardous {
    background: linear-gradient(135deg, var(--aqi-hazardous), #92400e);
    box-shadow: 0 15px 40px rgba(124, 45, 18, 0.3);
}

.aqi-value {
    font-size: 3.5rem;
    line-height: 1;
}

.aqi-label {
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-top: 10px;
}

.aqi-info {
    flex: 1;
    min-width: 300px;
}

.aqi-category {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.aqi-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.aqi-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.scale-item {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.scale-item.good {
    background: var(--aqi-good);
}

.scale-item.moderate {
    background: var(--aqi-moderate);
    color: var(--text-primary);
}

.scale-item.unhealthy-sg {
    background: var(--aqi-sensitive);
}

.scale-item.unhealthy {
    background: var(--aqi-unhealthy);
}

.scale-item.very-unhealthy {
    background: var(--aqi-very-unhealthy);
}

.scale-item.hazardous {
    background: var(--aqi-hazardous);
}

/* Pollutants Grid */
.pollutants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.pollutant-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pollutant-card:hover {
    border-color: var(--primary-green);
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}

.pollutant-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 10px;
}

.pollutant-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.pollutant-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.chart-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-light);
    max-height: 450px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-container canvas {
    max-height: 100%;
    max-width: 100%;
}

.chart-header {
    margin-bottom: 20px;
    flex-shrink: 0;
}

.chart-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0;
}

.chart-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ================================
   MAP SECTION
   ================================ */

.map-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 50%, #f0fdf4 100%);
}

.aqi-map {
    height: 600px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.map-info {
    background: var(--light-green);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-info p {
    margin: 0;
}

.data-info {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.data-info h4 {
    color: var(--primary-green);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-info p {
    color: var(--text-secondary);
    margin: 10px 0;
}

.data-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.data-info li {
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ================================
   FORECAST SECTION
   ================================ */

.forecast-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(51, 65, 85, 0.02) 100%);
}

.forecast-section .section-title {
    color: #000000 !important;
}

.forecast-section .chart-container {
    height: 420px;
    max-height: 420px;
    overflow: hidden;
}

.forecast-section .chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

.forecast-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.forecast-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: #000000 !important;
    padding: 12px 28px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.forecast-btn:hover,
.forecast-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.forecast-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 35px;
}

.info-box {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    border-left: 4px solid var(--primary-green);
    transition: all 0.3s ease;
}

.info-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.info-box h4 {
    color: #000000 !important;
    margin-bottom: 12px;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
}

.info-box p {
    color: #4b5563 !important;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-box ul {
    margin: 0;
    padding-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
    color: #4b5563 !important;
}

.warning-box {
    border-left-color: var(--aqi-unhealthy);
}

/* Danger Day Cards */
#warningDays {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.danger-day-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 14px 18px;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.danger-day-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.danger-day-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.danger-day-date {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.danger-day-aqi {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 4px 0;
}

.danger-day-category {
    font-size: 0.75rem;
    color: #475569;
    text-align: center;
    font-weight: 600;
    line-height: 1.3;
}

.no-danger-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #10b981;
    font-weight: 600;
    font-size: 1rem;
}

.no-danger-message i {
    font-size: 1.2rem;
}

/* ================================
PLANTS SECTION
   ================================ */

.plants-section {
    padding: 60px 20px;
    background-color: var(--card-bg);
}

.plant-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.plant-filter-btn {
    background: var(--off-white);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.plant-filter-btn:hover,
.plant-filter-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.plants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    max-height: 750px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.6) rgba(16, 185, 129, 0.12);
}

.plants-grid::-webkit-scrollbar {
    width: 8px;
}

.plants-grid::-webkit-scrollbar-track {
    background: rgba(16, 185, 129, 0.12);
    border-radius: 10px;
}

.plants-grid::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.6);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.plants-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

.plant-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.plant-score-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--primary-green), var(--light-green));
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.plant-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    border-color: var(--primary-green);
}

.plant-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--light-green), var(--primary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3.5rem;
}

.plant-content {
    padding: 25px;
}

.plant-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.plant-info {
    margin-bottom: 15px;
}

.plant-info-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 5px;
}

.plant-info-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.plant-efficiency {
    background: var(--light-green);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-dark);
}

.difficulty-easy {
    color: #10b981 !important;
    font-weight: 600;
}

.difficulty-moderate {
    color: #f59e0b !important;
    font-weight: 600;
}

.difficulty-hard {
    color: #ef4444 !important;
    font-weight: 600;
}

/* ================================
   TIPS SECTION
   ================================ */

.tips-section {
    padding: 60px 20px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.tip-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.tip-icon {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 15px;
}

.tip-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.tip-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ================================
   AWARENESS SECTION
   ================================ */

.awareness-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--light-green), #dbeafe);
}

.awareness-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.awareness-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
}

.awareness-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-green);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.awareness-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ================================
   POLLUTION ADVISOR SECTION
   ================================ */

.advisor-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #f0f9ff 50%, #ecfdf5 100%);
}

.advisor-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
}

.advisor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    gap: 35px;
    margin-top: 50px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Health Advisory spans both rows in the left column */
#healthAdvisory {
    grid-row: span 2;
}

.advisor-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.advisor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #059669);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.advisor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.advisor-card:hover::before {
    transform: scaleX(1);
}

.advisory-header,
.source-card-header,
.risk-card-header,
.trend-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
    position: relative;
    flex-shrink: 0;
}

.advisory-header i,
.source-card-header i,
.risk-card-header i,
.trend-card-header i {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4, #c7f0d8);
    border-radius: 12px;
    color: #059669;
}

.advisory-header h3,
.source-card-header h3,
.risk-card-header h3,
.trend-card-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.advisory-content h4,
.source-content h4,
.risk-content h4,
.trend-content h4 {
    color: #059669;
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.advisory-content,
.source-content,
.risk-content,
.trend-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.advisory-recommendations ul,
.solutions-list ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.advisory-recommendations li,
.solutions-list li {
    padding: 12px 0 12px 32px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.advisory-recommendations li:before {
    content: '→';
    position: absolute;
    left: 0;
    color: #10b981;
    font-size: 1.2rem;
    font-weight: bold;
}

.solutions-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Activity Grid - Improved */
.activity-grid,
.activity-status {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.activity {
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    background: var(--bg-light);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.activity.safe {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.activity.unsafe {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.activity i {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: block;
}

.activity.safe i {
    color: #10b981;
}

.activity.unsafe i {
    color: #ef4444;
}

.activity span {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 8px 0;
    color: var(--text-primary);
}

.activity .fa-check-circle {
    color: #10b981;
    margin-top: 8px;
}

.activity .fa-times-circle {
    color: #ef4444;
    margin-top: 8px;
}

.activity:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.source-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    margin: 12px 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
    border-radius: 12px;
    border-left: 4px solid #10b981;
    transition: all 0.3s ease;
}

.source-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.source-item i {
    font-size: 1.3rem;
    color: #10b981;
    min-width: 30px;
    text-align: center;
}

.source-info h4 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.source-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.impact-text {
    margin: 20px 0;
    padding: 18px;
    background: linear-gradient(135deg, #fef3c7, #fef08a);
    border-left: 5px solid #f59e0b;
    border-radius: 12px;
    color: #92400e;
    line-height: 1.7;
    font-size: 0.95rem;
}

.solutions-list {
    margin-top: 20px;
}

.solutions-list h4 {
    color: #059669;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.solutions-list ul {
    list-style: none;
    padding: 0;
}

.solutions-list li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.risk-meter {
    margin: 25px 0;
}

.risk-level-display {
    text-align: center;
    padding: 30px 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
    border: 2px solid rgba(16, 185, 129, 0.15);
}

.risk-percentage {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 15px 0 5px 0;
    background: linear-gradient(135deg, #059669, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.risk-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-bar-container {
    width: 100%;
    height: 24px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0 15px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.risk-bar {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    background: linear-gradient(90deg, #10b981, #059669);
    position: relative;
}

.risk-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: rgba(255, 255, 255, 0.4);
}

.risk-details {
    margin-top: 25px;
}

.risk-detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin: 12px 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
    border-radius: 12px;
    border-left: 4px solid #10b981;
    transition: all 0.3s ease;
}

.risk-detail-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.risk-detail-item i {
    font-size: 1.4rem;
    color: #10b981;
    min-width: 35px;
    text-align: center;
}

.risk-detail-item strong {
    color: var(--text-primary);
}

.trend-alert {
    padding: 20px;
    border-radius: 14px;
    margin: 20px 0;
    transition: all 0.3s ease;
    border-left: 5px solid;
}

.trend-alert.increasing {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left-color: #dc2626;
}

.trend-alert.decreasing {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-left-color: #059669;
}

.trend-alert.stable {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-left-color: #2563eb;
}

.trend-alert:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.trend-alert.no-data {
    background: linear-gradient(135deg, #f0fdf4, #e5f9f0);
    border-left-color: #10b981;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    gap: 16px;
}

.trend-no-data-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trend-no-data-icon i {
    font-size: 1.6rem;
    color: #059669;
}

.trend-alert.no-data .trend-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.trend-alert.no-data .trend-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 280px;
    margin: 0 auto;
}

.trend-no-data-steps {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

.trend-no-data-steps span {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8rem;
    color: #059669;
    font-weight: 500;
}

.trend-no-data-steps span i {
    font-size: 0.75rem;
}

.trend-alert h4 {
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.trend-alert p {
    margin: 8px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ================================
   EXPOSURE RISK SECTION
   ================================ */

.exposure-risk-section {
    padding: 80px 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
}

.exposure-selector {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

.exposure-selector h3 {
    margin: 0 0 25px 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.time-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.exposure-time-btn {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border: 2px solid transparent;
    padding: 20px 30px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.exposure-time-btn i {
    font-size: 1.5rem;
    color: #6b7280;
}

.exposure-time-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-green);
}

.exposure-time-btn.active {
    background: linear-gradient(135deg, var(--primary-green), #059669);
    color: white;
    border-color: var(--primary-green);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.exposure-time-btn.active i {
    color: white;
}

.refresh-btn {
    background: linear-gradient(135deg, var(--primary-green), #059669);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.refresh-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.refresh-btn i {
    font-size: 1.1rem;
}

.exposure-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.exposure-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow-wrap: anywhere;
}

.exposure-card h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.risk-header {
    padding: 25px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    margin-bottom: 25px;
}

.risk-score {
    display: flex;
    align-items: center;
    gap: 20px;
}

.risk-icon {
    font-size: 3rem;
}

.risk-details h3 {
    font-size: 1.8rem;
    margin: 0;
}

.risk-content {
    padding: 0 10px;
}

.risk-section {
    margin-bottom: 25px;
}

.risk-section h4 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.outdoor-time {
    font-size: 1.2rem;
    margin: 10px 0;
}

.recommendations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommendations-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid var(--primary-green);
    border-radius: 5px;
    color: var(--text-primary);
}

.risk-warnings {
    margin-bottom: 20px;
}

.warning-item {
    padding: 15px;
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #991b1b;
    font-weight: 500;
}

.risk-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #6b7280;
}

.weather-impact-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    margin-bottom: 20px;
}

.weather-impact-header span {
    font-size: 2.5rem;
}

.weather-impact-header h4 {
    margin: 0;
    font-size: 1.3rem;
}

.weather-impact-header p {
    margin: 5px 0 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.weather-details {
    padding: 10px;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.weather-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
}

.weather-icon {
    font-size: 2rem;
}

.weather-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.weather-item small {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.weather-insights {
    padding: 20px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 10px;
}

.weather-insights h5 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.weather-insights ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.weather-insights li {
    padding: 10px 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.exposure-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.exposure-charts-grid .chart-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: 350px;
}

.exposure-charts-grid .chart-container canvas {
    max-height: 100%;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #ef4444;
}

.error-message span {
    font-size: 4rem;
}

.error-message p {
    margin: 20px 0;
    font-size: 1.1rem;
}

/* ================================
   GLOBAL RANKINGS SECTION
   ================================ */

.rankings-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #ecfdf5 50%, #f0fdf4 100%);
}

.rankings-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 50px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.comparison-card,
.ranking-card {
    background: white;
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.comparison-header,
.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(90deg, #10b981 0%, transparent 100%) bottom / 100% 3px no-repeat;
}

.comparison-card h3 {
    margin: 0 0 18px 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rank-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.rank-stat {
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rank-stat .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    font-weight: 600;
}

.rank-stat .value {
    font-size: 1.85rem;
    line-height: 1;
    font-weight: 800;
    color: #059669;
}

.rank-stat .sublabel {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.alert-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    line-height: 1.4;
    margin-top: 10px;
}

.alert-message i {
    margin-top: 1px;
}

.alert-message.warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.alert-message.caution {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #93c5fd;
}

.alert-message.success {
    background: #dcfce7;
    color: #14532d;
    border-color: #86efac;
}

.comparison-header h2,
.ranking-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.comparison-header h2 i,
.ranking-header h2 i {
    color: #10b981;
    font-size: 1.8rem;
}

.update-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.ranking-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 25px;
    border-top: 2px dashed rgba(16, 185, 129, 0.2);
}

.refresh-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.refresh-btn i {
    transition: transform 0.3s ease;
}

.refresh-btn:hover i {
    transform: rotate(180deg);
}

.user-rank-display {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--light-green), #dbeafe);
    border-radius: 12px;
    margin: 20px 0;
}

.user-rank-display h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

.percentile {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-green);
    margin: 10px 0;
}

.user-rank-display p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 15px;
    max-height: 620px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.6) rgba(16, 185, 129, 0.12);
}

.ranking-list::-webkit-scrollbar {
    width: 8px;
}

.ranking-list::-webkit-scrollbar-track {
    background: rgba(16, 185, 129, 0.12);
    border-radius: 8px;
}

.ranking-list::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.6);
    border-radius: 8px;
}

.ranking-list::-webkit-scrollbar-thumb:hover {
    background: rgba(5, 150, 105, 0.8);
}

.ranking-item {
    display: grid;
    grid-template-columns: 50px 1fr auto auto;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
    margin: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 253, 244, 0.3));
    border-radius: 16px;
    border: 2px solid rgba(16, 185, 129, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ranking-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #10b981;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.ranking-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.ranking-item:hover::before {
    transform: scaleY(1);
}

.rank-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 50px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-number .rank {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.medal {
    font-size: 1.8rem;
}

.city-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.city-info h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.city-info .country {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.city-info .country::before {
    content: '📍';
    font-size: 0.85rem;
}

.aqi-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: bold;
    color: white;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.aqi-badge .aqi-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.aqi-badge .aqi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.pollutant-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
    white-space: nowrap;
}

.pollutant-tag i {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ================================
   CHATBOT
   ================================ */

.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    transition: all 0.3s ease;
}

.chatbot-container.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-green), #059669);
    color: white;
    padding: 18px 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-title i {
    font-size: 1.4rem;
}

.chatbot-title h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.chatbot-status {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-clear-btn,
.chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.chatbot-clear-btn:hover,
.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(to bottom, #f9fafb, #ffffff);
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bot-message,
.user-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeInUp 0.3s ease;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-green), #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bot-message .message-content {
    background: white;
    color: var(--text-primary);
    border: 1px solid #e5e7eb;
    border-radius: 12px 12px 12px 4px;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-green), #059669);
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 5px 0;
}

.message-content strong {
    font-weight: 600;
}

.typing-dots {
    display: flex;
    gap: 5px;
    padding: 8px 12px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.chat-message {
    margin: 15px 0;
    display: flex;
    gap: 10px;
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.bot .message-content {
    background: white;
    color: var(--text-primary);
    border: 1px solid #e5e7eb;
}

.chat-message.user .message-content {
    background: var(--primary-green);
    color: white;
}

.quick-questions {
    padding: 10px 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.quick-questions p {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.chatbot-quick-questions {
    padding: 10px 15px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chatbot-quick-questions::-webkit-scrollbar {
    display: none;
}

.quick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--light-green);
    border-radius: 999px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.3;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.quick-btn i {
    color: var(--primary-green);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.quick-btn:hover {
    background: var(--light-green);
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
}

.quick-question-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin: 5px 0;
    background: var(--bg-light);
    border: 1px solid var(--light-green);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.quick-question-btn:hover {
    background: var(--light-green);
    transform: translateX(5px);
}

.chatbot-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 15px 15px;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    border-color: var(--primary-green);
}

.chatbot-send,
.chatbot-send-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    border-radius: 50%;
    position: relative;
}

.chatbot-send i {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.95rem;
    line-height: 1;
}

.chatbot-send:hover,
.chatbot-send-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.chatbot-send:disabled,
.chatbot-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.chatbot-fab {
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-green), #059669);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.3s ease;
    visibility: visible;
    opacity: 1;
}

.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    letter-spacing: 0.5px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ================================
   HEATMAP CONTROLS
   ================================ */

.map-controls {
    margin-bottom: 15px;
    text-align: center;
}

.heatmap-toggle-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.heatmap-toggle-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.heatmap-toggle-btn i {
    font-size: 1.1rem;
}

/* ================================
   FOOTER
   ================================ */

.footer {
    background: var(--text-primary);
    color: white;
    padding: 40px 20px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--secondary-green);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.footer-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--secondary-green);
}

.data-source-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.data-source-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.data-source-details {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 3px solid var(--secondary-green);
    animation: slideDown 0.3s ease;
}

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

.data-source-details ul li {
    margin-bottom: 8px;
}

.data-source-toggle i {
    transition: transform 0.3s ease;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

/* ================================
   TABLET RESPONSIVE (1024px - 1440px)
   ================================ */
@media (max-width: 1024px) {
    .advisor-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    #healthAdvisory {
        grid-row: span 1;
    }
    

}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {
    .nav-container {
        position: relative;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        background: var(--card-bg);
        flex-direction: column;
        gap: 0;
        padding: 12px 0;
        box-shadow: var(--shadow-light);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        padding: 14px 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .hamburger {
        display: flex;
    }

    .hero {
        padding: 90px 14px;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
    }

    .search-box {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        padding: 8px;
        border-radius: 999px;
    }

    .location-input {
        flex: 1;
        min-width: 0;
        width: auto;
        padding: 10px 14px;
        font-size: 0.92rem;
        border-radius: 999px;
    }

    .search-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        gap: 0;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .search-btn i {
        margin: 0;
        font-size: 0.85rem;
    }

    .geo-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0;
        border-radius: 50%;
        flex-shrink: 0;
        justify-content: center;
    }

    .aqi-main-card {
        flex-direction: column;
        text-align: center;
        padding: 26px;
        gap: 24px;
    }

    .aqi-info {
        min-width: auto;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        padding: 18px;
    }

    .pollutants-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-title {
        font-size: 2rem;
    }

    .advisor-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    #healthAdvisory {
        grid-row: span 1;
    }

    .advisor-card {
        padding: 24px;
    }

    .rankings-content {
        grid-template-columns: 1fr;
    }

    .rank-info {
        grid-template-columns: 1fr;
    }

    .ranking-list {
        max-height: 500px;
    }

    .plants-grid {
        max-height: 600px;
    }

    .ranking-item {
        grid-template-columns: 40px 1fr;
        gap: 12px;
        padding: 14px;
    }

    .aqi-badge {
        grid-column: 2;
        justify-self: start;
        min-width: 70px;
        padding: 10px 14px;
    }

    .pollutant-tag {
        grid-column: 2;
        justify-self: start;
        font-size: 0.78rem;
        white-space: normal;
    }

    .city-info h3 {
        font-size: 1.05rem;
    }

    .chatbot-container {
        width: min(92vw, 400px);
        right: 4vw;
        bottom: 80px;
        max-height: 70vh;
    }

    .chatbot-fab {
        width: 55px;
        height: 55px;
        right: 15px;
        bottom: 15px;
    }

    .chatbot-fab i {
        font-size: 1.3rem;
    }

    .chatbot-badge {
        right: -2px;
        top: -2px;
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    .chatbot-header {
        padding: 12px 15px;
    }

    .chatbot-title h3 {
        font-size: 1rem;
    }

    .chatbot-messages {
        padding: 12px;
        max-height: calc(70vh - 200px);
    }

    .bot-message,
    .user-message {
        font-size: 0.88rem;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
    }

    .message-avatar i {
        font-size: 0.85rem;
    }

    .chatbot-quick-questions {
        padding: 8px 10px;
        gap: 6px;
    }

    .quick-btn {
        font-size: 0.72rem;
        padding: 5px 10px;
        gap: 4px;
    }

    .quick-btn i {
        font-size: 0.75rem;
    }

    .chatbot-input-area {
        padding: 10px 12px;
    }

    .chatbot-input {
        font-size: 0.88rem;
        padding: 10px 12px;
    }

    .chatbot-send {
        width: 38px;
        height: 38px;
    }

    .time-buttons {
        gap: 10px;
    }

    .exposure-time-btn {
        min-width: 100px;
        padding: 15px 20px;
    }

    .weather-grid {
        grid-template-columns: 1fr;
    }

    .aqi-map {
        height: 300px;
    }

    .danger-day-card {
        min-width: 120px;
        padding: 12px 14px;
    }

    .danger-day-aqi {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.9rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .pollutants-grid {
        grid-template-columns: 1fr;
    }

    .tips-grid,
    .awareness-content {
        grid-template-columns: 1fr;
    }

    .aqi-main-card {
        padding: 20px;
    }

    .aqi-circle {
        width: 150px;
        height: 150px;
    }

    .aqi-value {
        font-size: 2.5rem;
    }

    .aqi-scale {
        justify-content: center;
    }

    .nav-menu {
        gap: 0;
    }

    .activity-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ranking-list {
        max-height: 400px;
    }

    .plants-grid {
        max-height: 500px;
    }

    .chatbot-container {
        width: 95%;
        right: 2.5%;
        bottom: 80px;
        max-height: 450px;
    }

    .message-content {
        max-width: 85%;
    }

    .exposure-selector,
    .exposure-card {
        padding: 18px;
    }

    .exposure-time-btn {
        min-width: 90px;
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .exposure-selector h3 {
        font-size: 1.1rem;
    }

    .chart-container {
        height: 300px;
    }

    .time-buttons {
        gap: 8px;
    }

    .forecast-controls {
        gap: 10px;
    }

    .forecast-btn {
        width: 100%;
        max-width: 320px;
    }

    .refresh-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    #warningDays {
        gap: 8px;
        justify-content: center;
    }

    .danger-day-card {
        min-width: 100px;
        padding: 10px 12px;
    }

    .danger-day-name {
        font-size: 0.85rem;
    }

    .danger-day-date {
        font-size: 0.8rem;
    }

    .danger-day-aqi {
        font-size: 1.3rem;
    }

    .danger-day-category {
        font-size: 0.7rem;
    }
}

/* ================================
   DARK MODE ADJUSTMENTS
   ================================ */

body.dark-mode .hero {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
}

body.dark-mode .hero-search {
    animation-delay: 0.4s;
}

body.dark-mode .search-box {
    background: rgba(30, 41, 59, 0.95);
}

body.dark-mode .location-input {
    background: var(--card-bg);
    color: var(--text-primary);
}

body.dark-mode .aqi-main-card {
    background: linear-gradient(135deg, var(--dark-bg), #0f172a);
}

body.dark-mode .map-info {
    background: rgba(16, 185, 129, 0.2);
}

/* Pollution Advisor Dark Mode */
body.dark-mode .advisor-section {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

body.dark-mode .advisor-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .advisory-card-header,
body.dark-mode .source-card-header,
body.dark-mode .risk-card-header,
body.dark-mode .trend-card-header {
    border-bottom-color: rgba(16, 185, 129, 0.3);
}

body.dark-mode .advisory-card-header h3,
body.dark-mode .source-card-header h3,
body.dark-mode .risk-card-header h3,
body.dark-mode .trend-card-header h3 {
    color: var(--text-primary);
}

body.dark-mode .advisory-recommendations li,
body.dark-mode .source-info p,
body.dark-mode .risk-detail-item,
body.dark-mode .trend-alert p {
    color: var(--text-secondary);
}

body.dark-mode .activity-status {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .source-item {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-green);
}

body.dark-mode .source-info h4 {
    color: var(--text-primary);
}

body.dark-mode .impact-text {
    background: rgba(245, 158, 11, 0.2);
    border-left-color: #f59e0b;
    color: var(--text-primary);
}

body.dark-mode .solutions-list li {
    color: var(--text-secondary);
}

body.dark-mode .risk-level-display {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .risk-bar-container {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .risk-detail-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .trend-alert.increasing {
    background: rgba(239, 68, 68, 0.2);
    border-left-color: #ef4444;
}

body.dark-mode .trend-alert.decreasing {
    background: rgba(16, 185, 129, 0.2);
    border-left-color: #10b981;
}

body.dark-mode .trend-alert.stable {
    background: rgba(59, 130, 246, 0.2);
    border-left-color: #3b82f6;
}

/* Global Rankings Dark Mode */
body.dark-mode .rankings-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body.dark-mode .comparison-card,
body.dark-mode .ranking-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.dark-mode .comparison-header,
body.dark-mode .ranking-header {
    background: linear-gradient(90deg, #10b981 0%, transparent 100%) bottom / 100% 3px no-repeat;
}

body.dark-mode .rank-stat {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.15));
    border-color: rgba(52, 211, 153, 0.35);
}

body.dark-mode .rank-stat .value {
    color: #34d399;
}

body.dark-mode .alert-message.warning {
    background: rgba(245, 158, 11, 0.22);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.45);
}

body.dark-mode .alert-message.caution {
    background: rgba(59, 130, 246, 0.22);
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.45);
}

body.dark-mode .alert-message.success {
    background: rgba(16, 185, 129, 0.22);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.45);
}

body.dark-mode .ranking-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.4));
    border-color: rgba(16, 185, 129, 0.15);
}

body.dark-mode .ranking-item:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

body.dark-mode .pollutant-tag {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

body.dark-mode .comparison-header h2,
body.dark-mode .ranking-header h2 {
    color: var(--text-primary);
}

body.dark-mode .user-rank-display {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .user-rank-display h4 {
    color: var(--text-primary);
}

body.dark-mode .user-rank-display p {
    color: var(--text-secondary);
}

body.dark-mode .ranking-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .ranking-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .city-info h4 {
    color: var(--text-primary);
}

body.dark-mode .city-country {
    color: var(--text-secondary);
}

body.dark-mode .pollutant-tag {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary-green);
}

/* Exposure Risk Dark Mode */
body.dark-mode .exposure-risk-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(59, 130, 246, 0.05));
}

body.dark-mode .exposure-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .exposure-selector h3 {
    color: var(--text-primary);
}

body.dark-mode .exposure-time-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.dark-mode .exposure-time-btn i {
    color: var(--text-secondary);
}

body.dark-mode .exposure-time-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-green);
}

body.dark-mode .exposure-time-btn.active {
    background: linear-gradient(135deg, var(--primary-green), #059669);
    color: white;
    border-color: var(--primary-green);
}

body.dark-mode .exposure-time-btn.active i {
    color: white;
}

body.dark-mode .exposure-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .exposure-card h3 {
    color: var(--text-primary);
}

body.dark-mode .risk-header {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .risk-details h3 {
    color: inherit;
}

body.dark-mode .risk-section h4 {
    color: var(--text-primary);
}

body.dark-mode .recommendations-list li {
    background: rgba(16, 185, 129, 0.1);
    color: var(--text-primary);
}

body.dark-mode .warning-item {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

body.dark-mode .risk-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

body.dark-mode .weather-impact-header {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .weather-impact-header h4 {
    color: inherit;
}

body.dark-mode .weather-item {
    background: rgba(16, 185, 129, 0.1);
}

body.dark-mode .weather-item strong {
    color: var(--text-primary);
}

body.dark-mode .weather-item small {
    color: var(--text-secondary);
}

body.dark-mode .weather-insights {
    background: rgba(59, 130, 246, 0.1);
}

body.dark-mode .weather-insights h5 {
    color: var(--text-primary);
}

body.dark-mode .weather-insights li {
    color: var(--text-primary);
}

body.dark-mode .chart-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Environmental Awareness Dark Mode */
body.dark-mode .awareness-section {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

body.dark-mode .awareness-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .awareness-card h3 {
    color: var(--primary-green);
}

body.dark-mode .awareness-card p {
    color: var(--text-secondary);
}

/* Chatbot Dark Mode */
body.dark-mode .chatbot-container {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .chatbot-messages {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
}

body.dark-mode .bot-message .message-content {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

body.dark-mode .chat-message.bot .message-content {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.dark-mode .chatbot-quick-questions {
    background: rgba(0, 0, 0, 0.25);
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .quick-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--text-primary);
}

body.dark-mode .quick-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

body.dark-mode .quick-questions {
    background: var(--card-bg);
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .quick-question-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--text-primary);
}

body.dark-mode .quick-question-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

body.dark-mode .chatbot-input-area {
    background: var(--card-bg);
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .chatbot-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.dark-mode .chatbot-input:focus {
    border-color: var(--primary-green);
}

body.dark-mode .chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Map Controls Dark Mode */
body.dark-mode .heatmap-toggle-btn {
    background: var(--primary-green);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

body.dark-mode .heatmap-toggle-btn:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Tips Section Dark Mode */
body.dark-mode .tips-section {
    background: var(--dark-bg);
}

body.dark-mode .tip-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .tip-card h3 {
    color: var(--text-primary);
}

body.dark-mode .tip-card p {
    color: var(--text-secondary);
}

/* Plants Section Dark Mode */
body.dark-mode .plants-section {
    background: var(--dark-bg);
}

body.dark-mode .plant-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .plant-card h3 {
    color: var(--text-primary);
}

body.dark-mode .plant-card p {
    color: var(--text-secondary);
}

/* Forecast Section Dark Mode */
body.dark-mode .forecast-section {
    background: var(--dark-bg);
}

body.dark-mode .forecast-section .section-title {
    color: #ffffff !important;
}

body.dark-mode .forecast-btn {
    color: #ffffff !important;
}

body.dark-mode .info-box {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .info-box h4 {
    color: #ffffff !important;
}

body.dark-mode .info-box p {
    color: #cbd5e1 !important;
}

body.dark-mode .info-box li {
    color: #cbd5e1 !important;
}

body.dark-mode .danger-day-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .danger-day-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

body.dark-mode .danger-day-name {
    color: #f1f5f9;
}

body.dark-mode .danger-day-date {
    color: #94a3b8;
}

body.dark-mode .danger-day-category {
    color: #cbd5e1;
}

body.dark-mode .no-danger-message {
    color: #34d399;
}

body.dark-mode .warning-box {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
}

/* Map Section Dark Mode */
body.dark-mode .map-section {
    background: var(--dark-bg);
}

body.dark-mode .data-info {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .data-info h4 {
    color: var(--text-primary);
}

body.dark-mode .data-info p,
body.dark-mode .data-info li {
    color: var(--text-secondary);
}

/* Forecast Section Dark Mode */
body.dark-mode .forecast-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(51, 65, 85, 0.01) 100%);
}

body.dark-mode .forecast-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

body.dark-mode .forecast-btn:hover,
body.dark-mode .forecast-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

body.dark-mode .info-box {
    border-left-color: var(--primary-green);
    background: rgba(255, 255, 255, 0.03);
}

/* Data Source Toggle Dark Mode */
body.dark-mode .data-source-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .data-source-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
}

body.dark-mode .data-source-details {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--primary-green);
}

/* Dashboard Section Dark Mode */
body.dark-mode .dashboard-section {
    background: var(--dark-bg);
}

body.dark-mode .pollutant-card {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .pollutant-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

body.dark-mode .chart-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Plant Filters Dark Mode */
body.dark-mode .plant-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .plant-filter-btn:hover,
body.dark-mode .plant-filter-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

/* Refresh Button Dark Mode */
body.dark-mode .refresh-btn {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

body.dark-mode .refresh-btn:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Footer Dark Mode */
body.dark-mode .footer {
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navbar Dark Mode */
body.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-link {
    color: var(--text-secondary);
}

body.dark-mode .nav-link:hover {
    color: var(--primary-green);
}

/* Search Buttons Dark Mode */
body.dark-mode .search-btn,
body.dark-mode .geo-btn {
    background: var(--primary-green);
    color: white;
}

body.dark-mode .search-btn:hover,
body.dark-mode .geo-btn:hover {
    background: #059669;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* AQI Scale Dark Mode */
body.dark-mode .aqi-scale {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Location Info Dark Mode */
body.dark-mode .location-name {
    color: var(--text-primary);
}

body.dark-mode .location-time {
    color: var(--text-secondary);
}

/* Forecast Controls Dark Mode */
body.dark-mode .forecast-controls button {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .forecast-controls button:hover {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.5s ease-out;
}
