/* ========================================
   AQI CALENDAR COMPONENT STYLES
   Clean, semantic implementation of AQI Calendar
   ======================================== */

/* Container */
.aqi-calendar-wrapper {
    width: 100%;
    /* max-width: 1178px; */
    /* margin: 0 auto 60px auto; */
    padding: 0;
    font-family: Arial, sans-serif;
}

.aqi-calendar-container {
    position: relative;
    width: 100%;
    background: transparent;
    /* padding: 0 20px; */
}

/* Header Section */
.aqi-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.aqi-calendar-title-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.aqi-calendar-subtitle {
    font-family: 'Arial', sans-serif;
    font-size: 13.144px;
    line-height: 19.666px;
    color: #1882ff;
    margin: 0;
    font-weight: 400;
}

.aqi-calendar-main-title {
    font-family: 'Segoe UI', sans-serif;
    font-size: 25.116px;
    font-weight: 400;
    color: #31343d;
    margin: 0;
    line-height: 28.406px;
}

.aqi-calendar-main-title .district-name {
    font-size: inherit;
    font-weight: 600;
    color: #1882ff;
}

/* Controls Section (Dropdown + Navigation) */
.aqi-calendar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.aqi-calendar-district-select {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 400;
    color: #31343d;
    background: #ffffff;
    border: 1px solid rgba(163, 163, 200, 0.6);
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 150px;
}

.aqi-calendar-district-select:hover {
    border-color: #1882ff;
}

.aqi-calendar-district-select:focus {
    border-color: #1882ff;
    box-shadow: 0 0 0 3px rgba(24, 130, 255, 0.1);
}

.aqi-calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aqi-calendar-nav-btn {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid rgba(163, 163, 200, 0.6);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #31343d;
}

.aqi-calendar-nav-btn:hover {
    background: #1882ff;
    border-color: #1882ff;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(24, 130, 255, 0.2);
}

.aqi-calendar-nav-btn:active {
    transform: translateY(0);
}

.aqi-calendar-nav-btn svg {
    width: 24px;
    height: 24px;
}

/* Calendar Grid Layout */
.aqi-calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Month Card */
.aqi-calendar-month-card {
    background: #ffffff;
    border: 0.78px solid rgba(163, 163, 200, 0.6);
    border-radius: 15.6px;
    padding: 20px 16px;
    box-sizing: border-box;
}

/* Month Header */
.aqi-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.aqi-month-title {
    font-size: 21.37px;
    font-weight: 400;
    color: #31343d;
    margin: 0;
    line-height: 20.36px;
}

.aqi-month-year {
    font-size: 21.37px;
    font-weight: 400;
    color: #31343d;
    line-height: 20.36px;
}

.aqi-month-icon {
    width: 31.14px;
    height: 31.2px;
    object-fit: contain;
}

/* Month Statistics - New Grid Layout */
.aqi-month-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 15px 0;
    margin-bottom: 15px;
}

.aqi-stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aqi-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aqi-stat-label {
    font-size: 10.92px;
    font-weight: 400;
    color: rgba(49, 52, 61, 0.65);
    margin: 0;
    line-height: 1.2;
}

.aqi-stat-value {
    font-size: 21.06px;
    font-weight: 700;
    color: #31343d;
    margin: 0;
    line-height: 1.2;
}

.aqi-stat-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.aqi-stat-date {
    font-size: 8.58px;
    font-weight: 400;
    color: rgba(49, 52, 61, 0.4);
    margin: 0;
    line-height: 1.2;
    text-align: center;
}

/* Calendar Grid */
.aqi-calendar-table {
    width: 100%;
}

/* Day Headers */
.aqi-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.aqi-day-header {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 10.84px;
    font-weight: 700;
    color: #677580;
    text-align: center;
    opacity: 0.75;
    padding: 5px 2px;
}

/* Weeks Container */
.aqi-weeks-container {
    display: flex;
    flex-direction: column;
    gap: 6.75px;
}

/* Week Row */
.aqi-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* Date Cell */
.aqi-date-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 4.07px;
    border: 0.78px solid rgba(103, 117, 128, 0.5);
    box-sizing: border-box;
}

.aqi-date-header {
    flex: 0 0 12.1px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8.11px;
    font-weight: 400;
    color: #31343d;
    line-height: 8.14px;
    padding: 2px;
    box-sizing: border-box;
}

.aqi-date-value {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.22px;
    font-weight: 400;
    color: #ffffff;
    line-height: 10.18px;
}

/* AQI Level Colors now applied dynamically via inline styles from database */

/* No Data */
.aqi-date-value.aqi-no-data {
    background: #f9f9f9;
    color: #677580;
}

/* Empty Cell */
.aqi-date-cell.empty {
    visibility: hidden;
}

/* Responsive Design */
@media (max-width: 1400px) {
    /* .aqi-calendar-wrapper {
        padding: 0 60px;
    } */
}

@media (max-width: 1200px) {
    /* .aqi-calendar-wrapper {
        padding: 0 40px;
    } */
    
    .aqi-calendar-grid {
        gap: 12px;
    }
    
    .aqi-calendar-main-title {
        font-size: 24px;
    }
    
    /* .aqi-calendar-main-title .district-name {
        font-size: 28px;
    } */
}

@media (max-width: 992px) {
    /* .aqi-calendar-wrapper {
        padding: 0 20px;
    } */
    
    .aqi-calendar-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .aqi-month-header {
        margin-bottom: 20px;
    }
    
    .aqi-month-stats-grid {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .aqi-calendar-main-title {
        font-size: 20px;
    }
    
    /* .aqi-calendar-main-title .district-name {
        font-size: 24px;
    } */
    
    .aqi-month-title {
        font-size: 18px;
    }
    
    .aqi-month-year {
        font-size: 18px;
    }
    
    .aqi-stat-label {
        font-size: 12px;
    }
    
    .aqi-stat-value {
        font-size: 18px;
    }
    
    .aqi-day-header {
        font-size: 9px;
    }
    
    .aqi-date-header {
        font-size: 7px;
    }
    
    .aqi-date-value {
        font-size: 9px;
    }
}

@media (max-width: 768px) {
    .aqi-calendar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }
    
    .aqi-calendar-district-select {
        width: 100%;
    }
    
    .aqi-calendar-nav {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* .aqi-calendar-wrapper {
        padding: 0 16px;
    } */
    
    .aqi-calendar-container {
        padding: 20px 0;
    }
    
    .aqi-calendar-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .aqi-calendar-main-title {
        font-size: 18px;
    }
    
    /* .aqi-calendar-main-title .district-name {
        font-size: 22px;
        display: block;
    } */
    
    .aqi-calendar-controls {
        width: 100%;
    }
    
    .aqi-month-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aqi-calendar-month-card {
    animation: fadeIn 0.5s ease forwards;
}

.aqi-calendar-month-card:nth-child(1) {
    animation-delay: 0.1s;
}

.aqi-calendar-month-card:nth-child(2) {
    animation-delay: 0.2s;
}

.aqi-calendar-month-card:nth-child(3) {
    animation-delay: 0.3s;
}