*,*::after,*::before{
    box-sizing: border-box;
}

/* moblile first approach */

body{
    font-family: Arial, Helvetica, sans-serif;
    max-width: calc(100% - (2 * var(--spacing-regular)));
    margin: var(--spacing-regular) auto;
    color: var(--text-color);
    background-color: var(--background-color);   
}

.light-theme{
    --text-color: hsl(240deg, 80% , 5%);
    --background-color: hsl(240deg, 95% , 100%);
}

:root{
    --spacing-more: 32px;
    --spacing-less: 8px;
    --spacing-regular: 16px;

    --semi-bold: 600;
    --bold: 700;
    --extra-bold: 800;

    --font-small: 0.5rem;
    --font-regular: 1rem;
    --font-medium: 1.5rem;
    --font-large: 2rem;
    --font-xl: 4rem;

    --background-color: hsl(240deg, 80% , 5%);
    --text-color: hsl(240deg, 95% , 100%);

}

.container{
    display: grid;
    grid-template-columns: repeat(2 , 1fr);
    grid-template-areas: 
    "search search"
    "current current"
    "hourly hourly"
    "fiveday fiveday"
    "feelslike humidity";
    gap: var(--spacing-regular);
    align-items: center;
}

.container , .container > article {
    border: 1px solid;
    border-radius: var(--spacing-regular);
    padding: var(--spacing-regular);
}

/* search city */
#search-city{
    grid-area: search;
    padding: 0;
    border: 0;
}

#search-city #cities > datalist{
    transition: 0.6 ease;
    -webkit-transition: 0.6 ease;
}

#search-city input{
    font-size: var(--font-medium);
    width: 100%;
    border-radius: var(--spacing-less);
}

/* current forecast related styles */

#current-forecast{
    grid-area: current;
    text-align: center;
}

#current-forecast .temprature{
    font-size: var(--font-xl);
    margin: 0;
}

#current-forecast .description,
#current-forecast .max-temp,
#current-forecast .min-temp{
    font-weight: var(--semi-bold);
}

#current-forecast .description{
    text-transform: capitalize;
}

/* hourly forecast related styles */

#hourly-forecast{
    grid-area: hourly;
    text-align: center;
    height: 100%;
}


#hourly-forecast .hourly-container{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-auto-flow: column;
    grid-auto-columns: minmax(100px , 1fr);
    overflow-x: auto;
    scroll-behavior: smooth;
}

#hourly-forecast .hourly-container .time{
    margin:0;
}

#hourly-forecast .hourly-container .icon{
    /* height: min-content;   
width: min-content; */
    object-fit: contain;
}
#hourly-forecast .hourly-container .hourly-temp{
    font-weight: var(--bold);
}

/* five day forecast related styles */

#five-day-forecast{
    grid-area: fiveday;
    text-align: center;
    height: 100%;
}

#five-day-forecast .per-day-forecast-container{
    display: grid;
    grid-auto-flow: row;
    grid-template: auto / repeat(4 , 1fr);
    gap: var(--spacing-regular);
    place-items: center;
}

.per-day-forecast-container .min-temp{
    font-weight: var(--semi-bold) ;
    opacity: 75%;
    justify-self: end;
}
.per-day-forecast-container .max-temp{
    font-weight: var(--semi-bold) ;
    justify-self: end;
}

.per-day-forecast-container .day-of-forecast{
    justify-self: start;
}

.per-day-forecast-container .icon{
    /* max-width: fit-content;
    max-height: fit-content; */
    object-fit: contain;
}


/* feels like related styles */

#feels-like{
    grid-area: feelslike;
    text-align: center;
    height: 100%;
}

/* humidity related styles */

#humidity{
    grid-area: humidity;
    text-align: center;
    height: 100%;
}

.main{
    position: relative;
    display: flex;
    flex-direction: column;
}

#theme{
    position: sticky;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    bottom: calc(4 * var(--spacing-regular) + 1px);
    padding: 0;
}

.theme-change-button{
    position: relative;
    border: 1px solid;
    border-color: black;
    /* border-radius: 25%; */
    cursor: pointer;
    right: calc( 2px + var(--spacing-regular));
    border-radius: 60px;
    opacity: 75%;
}

@media(width >= 800px){
    .container{
        grid-template-columns: repeat(4 , 1fr);
        grid-template-areas: 
        "search search search search"
        "current current current current"
        "hourly hourly fiveday fiveday"
        "feelslike humidity fiveday fiveday";
    }

    body{
        max-width: calc(800px - (2 * var(--spacing-regular))); /* for margin in both sides */
    }
}