@import url('https://fonts.googleapis.com/css2?family=Freeman&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root{
    --glass-bg: rgba(255, 255, 255, 0.15);
    --border-color: rgba(255, 255, 255, 0.2);
    --background-color: #ffffff;
    --background-color-2: rgba(255, 255, 255, 0.8);
    --backkground-color-3: rgba(255, 255, 255, 0.25);
    --color: #333;
    --text-color: #ffffff;
    --font-family: "Montserrat", sans-serif;
    --fontoptical-sizing: auto;
    --font-style: normal;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-optical-sizing: var(--fontoptical-sizing);
    font-style: var(--font-style);
}

html{
    scroll-behavior: smooth;
}

body{
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    transition: background 1.2s ease;    
}
/* Background Variations */

.bg-default { background: linear-gradient(135deg, #1e3c72, #2a5298); }
.bg-clear   { background: linear-gradient(135deg, #fceabb, #f8b500); }
.bg-rain    { background: linear-gradient(135deg, #616161, #9bc5c3); }
.bg-clouds  { background: linear-gradient(135deg, #bdc3c7, #2c3e50); }
.bg-snow    { background: linear-gradient(135deg, #83a4d4, #b6fbff); }

.box{
    width: 100%;
    max-width: 420px;
}

.box h1{
    text-align: center;
    margin-bottom: 7px;
    color: var(--text-color)
}

.search-box{
    display: flex;
    gap: 10px;
    margin-bottom: 13px;
}

.search-box input{
    flex: 1;
    padding: 15px 20px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    outline: none;
    font-size: 1rem;
}

.search-box button{
    width: 55px;
    border-radius: 40px;
    border: none;
    background-color: var(--background-color);
    color: var(--color);
    cursor: pointer;
    transition: 0.3;
}

.search-box button:hover{
    background-color: var(--background-color-2);
}

.weather-card{
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 40px;
    text-align: center;
    color: var(--text-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.weatherIcon{
    width: 140px;
    animation: float 4s ease-in-out infinite;
}

@keyframes float{
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.temp{
    font-size: 4.5rem; 
    font-weight: 800; 
    margin: 10px 0;
}

.countryName{
    font-size: 2rem;
    font-weight: 600;
    margin-top: 5px;
}

.cityName{
    font-size: 1.4rem;
    font-weight: 400;
    margin-top: 5px;
}

.stats-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stat-item{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.stat-item i{
    font-size: 1.4rem;
}

.val{
    font-size: 1.4rem;
    font-weight: 700;   
}

.label{
    font-size: 0.8rem;
    opacity: 0.7;
}

.forecast-box{
    margin-top: 25px;
    text-align: left;
}

.forecast-box h3{
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 15px;
    opacity: 0.8;
}

.forecast-list{
    display: flex;
    gap: 15px;
    overflow-x: auto; 
    padding: 15px 5px;
    scroll-behavior: smooth;
}

.forecast-list::-webkit-scrollbar{
    display: none;
}

.forecast-item{
    flex-shrink: 0;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    min-width: 80px;
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    transition: 0.3s ease;
}

.forecast-item p{
    font-size: 0.8rem;
}

.forecast-item img{
    width: 35px;
}

.forecast-item:hover {
    transform: translateY(-8px);
    background-color: var(--backkground-color-3);
}

/* Start of Media Query responsive website for 768px screens */



    /* Changes reflects on screen with a width of 768px and below */

   @media screen and (max-width: 768px) {

    .box{
        padding: 1.5rem;
        margin: 2rem auto;
    }

    .temp{
        font-size: 4rem;
    }

    .weatherIcon{
        width: 120px;
    }

    .forecast-list{
        gap: 12px;
    }

    .forecast-item{
        min-width: 75px;
        padding: 12px;
    }
  } 
 

 /* Start of Media Query responsive website for 480px screens */

    @media screen and (max-width: 480px) {

    .box{
        padding: 1.2rem;
        margin: 1rem;
    }

    .box h1{
        font-size: 1.6rem;
    }

    .search-box input{
        padding: 13px 16px;
        font-size: 0.95rem;
    }

    .search-box button{
        width: 50px;
    }

    .temp{
        font-size: 3.5rem;
    }

    .weatherIcon{
        width: 110px;
    }

    .countryName{
        font-size: 1.6rem;
    }

    .cityName{
        font-size: 1.2rem;
    }
}
  
/* Start of Media Query responsive website for 390px screens */

@media screen and (max-width: 390px) {

    .box{
        padding: 1rem;
        margin: 0.5rem;
    }

    .box h1{
        font-size: 1.4rem;
    }

    .search-box{
        gap: 8px;
    }

    .search-box input{
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .search-box button{
        width: 45px;
    }

    .temp{
        font-size: 3.2rem;
    }

    .weatherIcon{
        width: 100px;
    }

    .countryName{
        font-size: 1.4rem;
    }

    .cityName{
        font-size: 1rem;
    }
}

/* Start of Media Query responsive website for 360px screens */

@media screen and (max-width: 390px) {

    .box{
        padding: 1rem;
        margin: 0.5rem;
    }

    .box h1{
        font-size: 1.4rem;
    }

    .search-box{
        gap: 8px;
    }

    .search-box input{
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .search-box button{
        width: 45px;
    }

    .temp{
        font-size: 3.2rem;
    }

    .weatherIcon{
        width: 100px;
    }

    .countryName{
        font-size: 1.4rem;
    }

    .cityName{
        font-size: 1rem;
    }
}

