/* 1400px */
@media (max-width:1400px) {

    .forecast-list {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .forecast-card {
        min-width: 155px;
    }

}

/* 1200px */
@media (max-width:1200px) {

    /* Sidebar */

    .sidebar {
        width: 280px;
    }

    .head h2 {
        font-size: 26px;
    }

    /* Dashboard */

    .middle {
        flex-direction: column;
    }

    .middle-left,
    .middle-right {
        width: 100%;
    }

    .aqi {
        width: 100%;
    }

}

/* 992px */
@media (max-width:992px) {

    /* Sidebar */

    .sidebar {
        width: 90px;
        padding: 24px 15px;
    }

    .head {
        justify-content: center;
    }

    .head h2 {
        display: none;
    }

    .head img {
        width: 48px;
    }

    .item {
        justify-content: center;
        padding: 0;
    }

    .item p {
        display: none;
    }

    .item i {
        margin: 0;
        font-size: 22px;
    }

    .location-card,
    .recent {
        display: none;
    }

    /* Hero */

    .hero-body {
        flex-direction: column;
        gap: 35px;
        text-align: center;
    }

    .hero-body img {
        width: 190px;
    }

    .weather h1 {
        font-size: 90px;
    }

    .weather h3 {
        font-size: 28px;
    }

    .weather p {
        font-size: 20px;
    }

    .weather-details {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 22px;
        height: auto;
        padding: 25px;
    }

    .detail {
        width: calc(50% - 12px);
    }

    .divider {
        display: none;
    }

    /* Forecast */

    .forecast-list {
        gap: 18px;
    }

    .forecast-card {
        min-width: 170px;
    }

    /* AQI */

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

    .aqi-circle::before {
        width: 140px;
        height: 140px;
    }

    .aqi-value h2 {
        font-size: 46px;
    }

}

/* 768px */
@media (max-width:768px) {

    body {
        overflow: auto;
    }

    /* mainlayout */

    .main {
        width: 100%;
        padding: 20px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        padding: 25px 20px;
        z-index: 9999;
        transition: left .35s ease;
        border-right: 1px solid rgb(26, 42, 72);
        border-radius: 0 24px 24px 0;
    }

    .sidebar.open {
        left: 0;
    }

    .head {
        justify-content: flex-start;
    }

    .head h2 {
        display: block;
    }

    .item {
        justify-content: flex-start;
        padding: 0 18px;
    }

    .item p {
        display: block;
    }

    .location-card,
    .recent {
        display: block;
    }

    .topbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px;
        margin-bottom: 22px;
    }

    .search-box {
        flex: 1;
        width: calc(100% - 60px);
        height: 58px;
    }

    .top-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .hero {
        min-height: auto;
    }

    .hero-overlay {
        min-height: auto;
        padding: 24px;
    }

    .hero-header {
        flex-direction: column;
        gap: 18px;
        align-items: flex-start;
    }

    .location h2 {
        font-size: 28px;
    }

    .location p {
        font-size: 15px;
    }

    .time {
        padding: 10px 18px;
    }

    .hero-body {
        margin: 35px 0;
    }

    .weather h1 {
        font-size: 72px;
    }

    .weather h3 {
        font-size: 24px;
    }

    .weather p {
        font-size: 18px;
    }

    .hero-body img {
        width: 170px;
    }

    .weather-details {
        gap: 20px;
        padding: 22px;
    }

    .detail {
        width: 100%;
    }

    .forecast {
        padding: 22px;
    }

    .forecast-list {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        gap: 16px;
        scroll-behavior: smooth;
        padding-bottom: 10px;
        scrollbar-width: none;
    }

    .forecast-list::-webkit-scrollbar {
        display: none;
    }

    .forecast-card {
        flex: none;
        min-width: 160px;
    }

    .aqi {
        padding: 24px;
    }

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

    .aqi-circle::before {
        width: 135px;
        height: 135px;
    }

    .aqi-value h2 {
        font-size: 42px;
    }

    .card {
        padding: 24px;
    }

    .info-grid {
        gap: 16px;
    }

}

/* 576px */
@media (max-width:576px) {

    .main {
        padding: 15px;
    }

    /* Topbar */

    .topbar {
        gap: 10px;
        align-items: center;
    }

    .search-box {
        height: 54px;
        padding: 0 16px;
    }

    .search-box input {
        margin: 0 12px;
        font-size: 15px;
    }

    .search-box button {
        width: 42px;
        height: 42px;
    }

    .unit-toggle {
        padding: 4px;
    }

    .unit-toggle button {
        width: 42px;
        height: 38px;
        font-size: 15px;
    }

    /* Hero */

    .hero {
        border-radius: 24px;
    }

    .hero-overlay {
        padding: 18px;
    }

    .location h2 {
        font-size: 24px;
    }

    .location p {
        font-size: 14px;
    }

    .time {
        font-size: 14px;
        padding: 9px 16px;
    }

    .weather h1 {
        font-size: 58px;
    }

    .weather h3 {
        font-size: 20px;
    }

    .weather p {
        font-size: 16px;
    }

    .hero-body img {
        width: 150px;
    }

    .weather-details {
        padding: 18px;
        gap: 18px;
    }

    .detail {
        width: 100%;
    }

    .detail h4 {
        font-size: 22px;
    }

    /* Forecast */

    .forecast {
        padding: 20px;
    }

    .forecast-card {
        min-width: 145px;
    }

    .forecast-card h3 {
        font-size: 22px;
    }

    /* AQI */

    .aqi {
        padding: 20px;
    }

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

    .aqi-circle::before {
        width: 115px;
        height: 115px;
    }

    .aqi-value h2 {
        font-size: 38px;
    }

    .aqi-value p {
        font-size: 15px;
    }

    /* Additional Info */

    .card {
        padding: 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .info-box {
        padding: 18px;
    }

}

/* 400px */
@media (max-width:400px) {

    /* Sidebar */

    .sidebar {
        width: 240px;
        left: -240px;
        padding: 20px 15px;
    }

    .sidebar.open {
        left: 0;
    }

    .head img {
        width: 40px;
    }

    .head h2 {
        font-size: 22px;
    }

    .item {
        height: 48px;
    }

    .item i {
        font-size: 18px;
    }

    .item p {
        font-size: 14px;
    }

    .location-card {
        padding: 18px;
    }

    .location-card h3 {
        font-size: 16px;
    }

    .location-card p {
        font-size: 13px;
        line-height: 20px;
    }

    .location-card button {
        height: 42px;
        font-size: 14px;
    }

    .recent {
        padding: 16px;
    }

    /* Topbar */

    #menu-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .search-box {
        height: 50px;
        border-radius: 28px;
    }

    .search-box input {
        font-size: 14px;
    }

    /* Hero */

    .location h2 {
        font-size: 20px;
    }

    .weather h1 {
        font-size: 48px;
    }

    .weather h3 {
        font-size: 18px;
    }

    .weather p {
        font-size: 15px;
    }

    .hero-body img {
        width: 130px;
    }

    .detail i {
        font-size: 22px;
    }

    .detail h4 {
        font-size: 20px;
    }

    /* Forecast */

    .forecast-card {
        min-width: 130px;
        padding: 16px 12px;
    }

    .forecast-card h3 {
        font-size: 20px;
    }

    .forecast-card i {
        font-size: 32px;
    }

    /* AQI */

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

    .aqi-circle::before {
        width: 98px;
        height: 98px;
    }

    .aqi-value h2 {
        font-size: 32px;
    }

    .aqi-value p {
        font-size: 14px;
    }

    /* Cards */

    .card h2,
    .forecast h2,
    .aqi h2 {
        font-size: 20px;
    }

    .info-box {
        padding: 16px;
    }

    .info-box h4 {
        font-size: 20px;
    }

    .toast {
        left: 15px;
        right: 15px;
        min-width: auto;
        max-width: none;
    }

}
