
:root{
  --bg1: #a1c4fd;
  --bg2: #c2e9fb;
  --card: rgba(255,255,255,0.06);
  --card-2: rgba(255,255,255,0.04);
  --accent: #3b82f6;
  --glass-black: rgba(0,0,0,0.25);
  --white: #ffffff;
  --muted-white: rgba(255,255,255,0.85);
  --card-radius: 20px;
  --shadow: 0 30px 60px rgba(16,24,40,0.18);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}


*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: linear-gradient(180deg,var(--bg1),var(--bg2));
  color:var(--white);
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}


body.dark{ background: linear-gradient(180deg,#071428,#0b1a2b); }


.scene{ position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden; }

/* sun */
.sun{
  position:absolute; right:8%; top:8%;
  width:220px; height:220px; border-radius:50%;
  background: radial-gradient(circle at 40% 30%, rgba(255,255,200,0.9), rgba(255,200,80,0.14) 28%, rgba(255,200,80,0.05) 50%, transparent 60%);
  filter: blur(14px);
  transition: opacity .5s ease;
}


.cloud{
  position:absolute;
  z-index:1;
  filter:blur(1.2px);
  opacity:0.95;
}

.cloud::before, .cloud::after{
  content:''; position:absolute; background:linear-gradient(180deg,#fff,#f5f7fb); border-radius:50%;
  box-shadow: 0 10px 30px rgba(12,25,40,0.08); opacity:0.95;
}

.cloud-a{ left:-220px; top:6%; transform:scale(1.1); width:420px; height:110px;}
.cloud-a::before{ width:220px; height:120px; left:60px; top:-30px; }
.cloud-a::after{ width:160px; height:80px; left:180px; top:-5px; }


.cloud-b{ left:-300px; top:16%; transform:scale(0.9); width:360px; height:95px; }
.cloud-b::before{ width:200px; height:100px; left:40px; top:-20px;}
.cloud-b::after{ width:140px; height:70px; left:160px; top:0px; }


.cloud-c{ right:-260px; top:26%; transform:scale(1.0); width:460px; height:130px; }
.cloud-c::before{ width:240px; height:120px; left:80px; top:-30px;}
.cloud-c::after{ width:200px; height:90px; left:200px; top:-8px; }

/* parallax speeds */
.layer-fast{ animation: cloudMove 38s linear infinite; }
.layer-medium{ animation: cloudMove 62s linear infinite; }
.layer-slow{ animation: cloudMove 100s linear infinite; }
@keyframes cloudMove{
  from{ transform: translateX(-10vw); }
  to{ transform: translateX(120vw); }
}


.rain-layer{ position:absolute; inset:0; opacity:0; transition:opacity .4s ease;
  background-image: linear-gradient(transparent 0 70%, rgba(255,255,255,0.02) 71% 100%), linear-gradient(transparent 0 70%, rgba(255,255,255,0.02) 71% 100%);
  background-size:3px 16px,5px 20px; background-position:0 0,20px 10px; animation: rain 0.6s linear infinite;
}
@keyframes rain{ from{ background-position:0 0,20px 0 } to{ background-position:0 16px,20px 32px } }


.topbar{ position:relative; z-index:4; display:flex; justify-content:space-between; align-items:center; padding:22px 36px; pointer-events:auto; }
.center-title{ font-weight:700; font-size:1.05rem; opacity:0.95; letter-spacing:0.6px; }


.icon-btn{ background: rgba(255,255,255,0.06); border:none; padding:10px; border-radius:10px; color:var(--white); backdrop-filter: blur(6px); cursor:pointer; }
.pill{ background:transparent; border:1px solid rgba(255,255,255,0.12); padding:8px 12px; border-radius:999px; cursor:pointer; }


.main{ position:relative; z-index:3; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:20px; padding:28px; height:calc(100vh - 110px); }


.search{ width:100%; display:flex; justify-content:center; }
.search-inner{ display:flex; align-items:center; gap:12px; background: rgba(255,255,255,0.06); padding:10px 18px; border-radius:999px; box-shadow: 0 8px 20px rgba(16,24,40,0.06); backdrop-filter: blur(6px); }
.search-label{ color:rgba(255,255,255,0.9); margin-right:8px; font-weight:600; }
.search input{ min-width:260px; padding:12px 14px; border-radius:14px; border:none; outline:none; background: rgba(0,0,0,0.24); color:white; font-weight:600; }
.search input::placeholder{ color: rgba(255,255,255,0.6); font-weight:500; }
.cta{ padding:10px 14px; border-radius:12px; border:none; background: linear-gradient(90deg,#60a5fa,#3b82f6); color:white; font-weight:700; cursor:pointer; }


.weather-card{ width:min(1200px,94%); display:grid; grid-template-columns: 1fr 420px; gap:26px; padding:34px; margin-top:18px;
  background: linear-gradient(180deg, var(--card), var(--card-2)); border-radius:var(--card-radius); box-shadow:var(--shadow); backdrop-filter: blur(12px); }


.weather-left{ display:flex; flex-direction:column; gap:18px; padding-right:6px; }
.location .place{ font-size:28px; margin:0; font-weight:700; letter-spacing:0.2px; }
.time-local{ margin-top:6px; color:var(--muted-white); font-size:13px; }


.main-temp{ display:flex; align-items:center; gap:20px; margin-top:6px; }
.icon-large{ font-size:88px; width:116px; height:116px; display:flex; align-items:center; justify-content:center; border-radius:18px; background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); }
.temp{ font-size:96px; font-weight:800; line-height:1; }
.desc{ font-size:18px; color:var(--muted-white); text-transform:capitalize; margin-top:6px; }


.details-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-top:8px; }
.detail{ background: rgba(255,255,255,0.03); padding:12px 14px; border-radius:10px; display:flex; flex-direction:column; }
.detail-label{ font-size:12px; color:rgba(255,255,255,0.75); }
.detail-value{ font-weight:700; margin-top:6px; }


.weather-right{ display:flex; flex-direction:column; gap:14px; }
.sunset-sunrise{ display:flex; justify-content:space-between; background: rgba(255,255,255,0.02); padding:12px; border-radius:10px; font-size:14px; }
.forecast-title{ font-size:13px; color: rgba(255,255,255,0.9); }
.forecast-row{ display:flex; gap:10px; overflow-x:auto; padding:6px 2px; }


.fcard{ min-width:84px; background: rgba(255,255,255,0.03); border-radius:10px; padding:8px 10px; text-align:center; display:flex; flex-direction:column; gap:8px; align-items:center; font-size:13px; }
.fcard .day{ font-weight:700; }
.fcard .ficon{ font-size:20px; }
.fcard .temp-range{ font-weight:700; }


.hidden{ display:none; }
.error{ color:#ffdddd; background: rgba(255,30,77,0.12); padding:8px; border-radius:8px; }


.footer{ margin-top:12px; opacity:0.85; color: rgba(255,255,255,0.85); }


.fade{ opacity:0; transform: translateY(6px); transition: opacity .45s ease, transform .45s ease; }
.fade.show{ opacity:1; transform: translateY(0); }


@media (max-width:980px){
  .weather-card{ grid-template-columns: 1fr; }
  .temp{ font-size:64px; }
  .icon-large{ font-size:56px; width:82px; height:82px; }
  .forecast-row{ justify-content:flex-start; }
}

