:root{
    --bg-color1:#212529;
    --bg-color2:#2a2b2d;
    --aqi-1: #d4e157;
    --aqi-2: #ffee58;
    --aqi-3: #ffca28;
    --aqi-4: #ff7043;
    --aqi-5: #ef5350;
}
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;

}
body{
    min-height: 100vh;
    background-color: var(--bg-color1);
    color: #fff;
    font-family:sans-serif;
    padding: 0 15px;
}
hr{
    margin-bottom: 10px;
}
.header{
    position: sticky;
    top: 0;
    background-color: var(--bg-color1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 15px 0;

    & #city_input {
        background:  var(--bg-color2);
        border: none;
        padding: 12px;
        font-size: 16px;
        border-radius: 25px;
        color: #fff;
        &:focus{
            outline: none;  
        }
    }
    & #searchBtn{
        border: none;
        font-size: 16px;
        padding: 12px;
        border-radius: 25px;
        background-color: #fff;
        cursor: pointer;
    }

    & #locatinBtn{
        border: none;
        font-size: 16px;
        padding: 12px;
        border-radius: 25px;
        background-color: #ea6e4b;
        cursor: pointer;
         
    }

}

.card{
    background-color: var(--bg-color2);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    & p{
        font-size: 14px;
        color: #999;
    }
    & h2{
        font-size: 32px;
        font-weight: 500;

    }
}
 

 
.weather-data{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    & .weather-left{
        grid-column: span 1;
        & .currrent-weather{
            display: flex;
            justify-content: space-between;
            align-items: center;
            & h2{
                margin: 7px 0;
            }
            & p{
                color: #fff;
            }
        }
        & .card-footer p{
            font-size: 14px;
            margin-bottom: 12px;
        }
        & .forecast-item{
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            place-items: center;
            margin-bottom: 15px;
            & .icon-wrapper{
                display: flex;
                align-items: center;
            }
        }
    }
    & .weather-right{
        grid-column: span 3;
        & h2{
            margin-bottom: 10px;
        }
        & .highlight{
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            column-gap: 15px;
            & .card:nth-of-type(1),
            & .card:nth-of-type(2){
                grid-column: span 2;
            }
            
            & .card-head{
                display: flex;
                justify-content: space-between;
                margin-bottom: 10px;
                & .air-inex{
                    color: #000;
                    padding: 5px 10px;
                    border-radius: 15px;
                    
                    
                }
            }
            & .air-indices{
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                place-items: center;
                & p{
                    text-align: center;
                }
            }
            & .sunrise-suset{
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                & .item{
                    display: flex;
                    align-items: center;
                    gap: 20px;
                    & h2{
                        margin-top: 15px;
                    }
                }
            }
            & .card-item{
                display: flex;
                justify-content: space-between;
            }
        }
        & .hourly-forecast{
            display: grid;
            grid-template-columns:repeat(8, 1fr) ;
            column-gap:10px;
            & .card{
                text-align: center;
            }
        }
    }
} 

#aqi-1{
    background-color: var(--aqi-1);
}
#aqi-2{
    background-color: var(--aqi-2);
}
#aqi-3{
    background-color: var(--aqi-3);
}
#aqi-4{
    background-color: var(--aqi-4);
}
#aqi-5{
    background-color: var(--aqi-5);
}
 
@media(max-width: 1100px){
    .weather-data{
        grid-template-columns: repeat(3, 1fr);
        & .weather-right{
            grid-column: span 2;
            &.highlight{
                grid-template-columns: repeat(3, 1fr);
                & .card:nth-of-type(1){
                    grid-column: span 3;
                }
            }
            &.hourly-forecast{
                grid-template-columns: repeat(6, 1fr);
            }
        }
    }
}

 @media(max-width: 1040px){
    .weather-data{
        grid-template-columns: repeat(2, 1fr);
        & .weather-right{
            grid-column: span 1;
            & .highlight{
                grid-template-columns: repeat(2, 1fr);
                & .card:nth-of-type(1){
                    grid-column: span 2;
                }
            }
            & .hourly-forecast{
                grid-template-columns: repeat(4, 1fr);
            }
        }
    }
 }
 /* @media(max-width: 992px){
    .weather-data, .weather-right, .highlight{
        & .card{
            grid-column: sapn 3;
        }
        & .air-indices{
            grid-template-columns: repeat(4, 1fr);
        }
    }
 } */

 

 @media(max-width: 850px){
    .weather-data{
        grid-template-columns: 1fr;
        &.weather-right .highlight{
            & .card:nth-of-type(3),
            & .card:nth-of-type(4),
            & .card:nth-of-type(5),
            & .card:nth-of-type(6),
            & .card:nth-of-type(7){
                grid-column: span 1;
            }
            & .air-indices{
                grid-template-columns: repeat(5, 1fr);
            }
        }
    }
 }

 @media(max-width: 660px){

    .header{
           
        
        flex-direction: column;
        & h2{
            margin-bottom: 8px;
        }
        & #city_input, #searchBtn, #locatinBtn{
            justify-content: center;
            height: 30px;
             width:100%;
            margin-bottom: 5px;
        }
    }
 }

@media(max-width: 580px){
    .weather-data .weather-right .highlight .air-indices{
        grid-template-columns: repeat(4, 1fr);
    }
}

@media(max-width: 520px){
    .weather-data .weather-right .highlight{
        & .card:nth-of-type(3),
            & .card:nth-of-type(4),
            & .card:nth-of-type(5),
            & .card:nth-of-type(6),
            & .card:nth-of-type(7){
                grid-column: span 2;
            }
            & .air-indices{
                grid-template-columns: repeat(3, 1fr);
            }
    }

}

@media(max-width: 480px){
    .weather-data .weather-right .highlight .sunrise-suset{
        grid-template-columns: 1fr;
    }
}
@media(max-width: 450px){
    .weather-data .weather-right .hourly-forecast{
        grid-template-columns: repeat(3, 1fr);
    }
}
@media(max-width: 380px){
    .weather-data .weather-right .highlight .air-indices{
        grid-template-columns: repeat(2, 1fr);
    }
}