*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:'Poppins',sans-serif;
}

body{
min-height:100vh;
display:flex;
justify-content:center;
align-items:center;
background:linear-gradient(135deg,#4facfe,#00f2fe);
padding:20px;
transition:all .5s ease;
overflow-x:hidden;
position:relative;
}

/* Floating Background */

body::before{
content:"";
position:fixed;
width:300px;
height:300px;
background:rgba(255,255,255,.15);
border-radius:50%;
top:10%;
left:10%;
animation:float 8s infinite ease-in-out;
z-index:-1;
}

body::after{
content:"";
position:fixed;
width:250px;
height:250px;
background:rgba(255,255,255,.08);
border-radius:50%;
bottom:10%;
right:10%;
animation:float 10s infinite ease-in-out;
z-index:-1;
}

@keyframes float{

0%{
transform:translateY(0);
}

50%{
transform:translateY(30px);
}

100%{
transform:translateY(0);
}

}

/* Dark Mode */

body.dark{
background:linear-gradient(135deg,#0f172a,#1e293b);
}

body.dark .container{
background:rgba(15,23,42,0.8);
color:white;
}

body.dark .search-box input{
background:#1e293b;
color:white;
}

body.dark .details div,
body.dark .forecast-card{
background:rgba(255,255,255,.08);
}

body.dark button{
background:#334155;
color:white;
}

/* Main Container */

.container{
width:100%;
max-width:950px;
background:rgba(255,255,255,.15);
backdrop-filter:blur(20px);
-webkit-backdrop-filter:blur(20px);
padding:25px;
border-radius:25px;
color:white;
box-shadow:0 8px 32px rgba(0,0,0,.2);
border:1px solid rgba(255,255,255,.2);
}

/* Top Bar */

.top-bar{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:20px;
}

.top-bar h1{
font-size:2rem;
}

#clock{
font-size:14px;
opacity:.9;
margin-top:5px;
}

/* Theme Button */

#themeBtn{
padding:12px;
border:none;
border-radius:50%;
cursor:pointer;
font-size:18px;
transition:.3s;
}

#themeBtn:hover{
transform:scale(1.1);
}

/* Search */

.search-box{
display:flex;
gap:10px;
margin-bottom:25px;
flex-wrap:wrap;
}

.search-box input{
flex:1;
padding:15px;
border:none;
border-radius:12px;
font-size:16px;
outline:none;
}

.search-box button{
padding:15px;
border:none;
border-radius:12px;
cursor:pointer;
font-size:16px;
transition:.3s;
}

.search-box button:hover{
transform:translateY(-2px);
}

#voiceBtn{
background:#ff6b6b;
color:white;
}

/* Location Info */

.location-info{
display:flex;
justify-content:center;
align-items:center;
gap:12px;
margin-bottom:10px;
}

#flag{
width:45px;
height:30px;
border-radius:4px;
object-fit:cover;
box-shadow:0 0 10px rgba(255,255,255,.4);
}

/* Weather Card */

.weather-card{
text-align:center;
}

.weather-card img{
width:120px;
}

.weather-card h1{
font-size:4rem;
margin-top:10px;
}

#condition{
text-transform:capitalize;
font-size:18px;
margin-top:5px;
}

/* Details */

.details{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:15px;
margin-top:25px;
}

.details div{
background:rgba(255,255,255,.15);
padding:15px;
border-radius:15px;
transition:.3s;
}

.details div:hover{
transform:translateY(-5px);
}

.details p{
font-size:18px;
font-weight:600;
margin-top:5px;
}

/* Extra Info */

.extra{
margin-top:20px;
line-height:2;
font-size:16px;
}

/* Forecast */

.forecast-title{
margin-top:35px;
text-align:center;
margin-bottom:20px;
}

.forecast{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
gap:15px;
}

.forecast-card{
background:rgba(255,255,255,.15);
padding:15px;
text-align:center;
border-radius:15px;
transition:.3s;
}

.forecast-card:hover{
transform:translateY(-5px);
}

.forecast-card img{
width:60px;
}

.forecast-card h3{
margin-bottom:8px;
}

/* Loader */

.loader{
width:50px;
height:50px;
border:5px solid white;
border-top:5px solid transparent;
border-radius:50%;
animation:spin 1s linear infinite;
margin:20px auto;
}

.hidden{
display:none;
}

@keyframes spin{
100%{
transform:rotate(360deg);
}
}

/* Mobile */

@media(max-width:768px){

.container{
padding:20px;
}

.top-bar{
flex-direction:column;
gap:15px;
}

.top-bar h1{
font-size:1.6rem;
text-align:center;
}

.weather-card h1{
font-size:3rem;
}

.details{
grid-template-columns:1fr;
}

.search-box{
flex-direction:column;
}

.search-box button{
width:100%;
}

#flag{
width:40px;
height:28px;
}

}