/* Google Font */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Poppins',sans-serif;
}

body{
    min-height:100vh;
    background:linear-gradient(-45deg,#4facfe,#00f2fe,#4f46e5,#38bdf8);
    background-size:400% 400%;
    animation:gradientBG 12s ease infinite;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:30px;
    color:#fff;
}

@keyframes gradientBG{
    0%{background-position:0% 50%;}
    50%{background-position:100% 50%;}
    100%{background-position:0% 50%;}
}

.container{
    width:100%;
    max-width:1200px;
    background:rgba(255,255,255,.15);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    border:1px solid rgba(255,255,255,.2);
    border-radius:25px;
    padding:30px;
    box-shadow:0 20px 45px rgba(0,0,0,.25);
}

/* Header */

header{
    text-align:center;
    margin-bottom:30px;
}

header h1{
    font-size:2.3rem;
    margin-bottom:8px;
}

header p{
    opacity:.9;
}

/* Search */

.search-section{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
    flex-wrap:wrap;
    margin-bottom:35px;
}

.search-box{
    display:flex;
    flex:1;
    max-width:500px;
}

.search-box input{
    width:100%;
    padding:15px 18px;
    border:none;
    outline:none;
    border-radius:50px 0 0 50px;
    font-size:16px;
}

.search-box button{
    width:65px;
    border:none;
    background:#2563eb;
    color:white;
    font-size:18px;
    border-radius:0 50px 50px 0;
    cursor:pointer;
    transition:.3s;
}

.search-box button:hover{
    background:#1d4ed8;
}

.location-btn{
    border:none;
    padding:15px 22px;
    border-radius:50px;
    background:#10b981;
    color:white;
    cursor:pointer;
    font-size:15px;
    transition:.3s;
}

.location-btn:hover{
    transform:translateY(-3px);
    background:#059669;
}

/* Loading */

.loading{
    text-align:center;
    margin:40px 0;
}

.spinner{
    width:55px;
    height:55px;
    border:5px solid rgba(255,255,255,.3);
    border-top:5px solid white;
    border-radius:50%;
    margin:auto;
    animation:spin .8s linear infinite;
}

@keyframes spin{
    100%{
        transform:rotate(360deg);
    }
}

/* States */

.error,
.empty{
    text-align:center;
    margin:35px 0;
}

.empty i{
    font-size:65px;
    margin-bottom:15px;
}

.hidden{
    display:none;
}

/* Current Weather */

.current-weather{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:30px;
    margin-bottom:40px;
}

.left,
.right{
    background:rgba(255,255,255,.15);
    backdrop-filter:blur(12px);
    border-radius:20px;
    padding:30px;
}

.left{
    text-align:center;
}

.left img{
    width:120px;
    animation:float 3s ease-in-out infinite;
}

@keyframes float{
    0%,100%{
        transform:translateY(0);
    }
    50%{
        transform:translateY(-10px);
    }
}

.left h1{
    font-size:70px;
    margin:10px 0;
}

.left p{
    font-size:18px;
}

.right{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;
}

.detail-card{
    background:rgba(255,255,255,.18);
    border-radius:18px;
    padding:20px;
    text-align:center;
    transition:.3s;
}

.detail-card:hover{
    transform:translateY(-6px);
    background:rgba(255,255,255,.25);
}

.detail-card i{
    font-size:28px;
    margin-bottom:12px;
}

.detail-card h4{
    margin-bottom:10px;
}

.detail-card p{
    font-size:22px;
    font-weight:600;
}

/* Section Titles */

.hourly-section h2,
.forecast-section h2{
    margin-bottom:20px;
}

/* Hourly */

.hourly-grid{
    display:flex;
    gap:18px;
    overflow-x:auto;
    padding-bottom:15px;
    margin-bottom:40px;
}

.hourly-grid::-webkit-scrollbar{
    height:8px;
}

.hourly-grid::-webkit-scrollbar-thumb{
    background:white;
    border-radius:20px;
}

.hour-card{
    min-width:130px;
    background:rgba(255,255,255,.15);
    border-radius:18px;
    padding:18px;
    text-align:center;
    transition:.3s;
}

.hour-card:hover{
    transform:translateY(-6px);
}

.hour-card img{
    width:60px;
}

/* Forecast */

.forecast-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:20px;
}

.forecast-card{
    background:rgba(255,255,255,.15);
    border-radius:20px;
    padding:22px;
    text-align:center;
    transition:.3s;
}

.forecast-card:hover{
    transform:translateY(-8px);
    background:rgba(255,255,255,.25);
}

.forecast-card img{
    width:80px;
}

.forecast-card h3{
    margin-bottom:12px;
}

.forecast-card h2{
    margin:10px 0;
}

/* Footer */

footer{
    margin-top:35px;
    text-align:center;
    opacity:.8;
}

/* Tablet */

@media(max-width:992px){

.current-weather{
grid-template-columns:1fr;
}

.right{
grid-template-columns:repeat(2,1fr);
}

}

/* Mobile */

@media(max-width:768px){

body{
padding:15px;
}

.container{
padding:20px;
}

header h1{
font-size:1.8rem;
}

.search-section{
flex-direction:column;
}

.search-box{
width:100%;
max-width:100%;
}

.location-btn{
width:100%;
}

.left h1{
font-size:50px;
}

.right{
grid-template-columns:1fr;
}

.forecast-grid{
grid-template-columns:repeat(2,1fr);
}

}

/* Small Mobile */

@media(max-width:500px){

.forecast-grid{
grid-template-columns:1fr;
}

.left img{
width:90px;
}

.left h1{
font-size:42px;
}

.hour-card{
min-width:115px;
}

}