:root {
  --bg-dark: #0a0f1f;
  --panel: #121a2c;
  --accent: #00bfff;
  --accent2: #ff4ecb;
  --glass: rgba(255, 255, 255, 0.05);
  --text: #e8f2ff;
  --muted: rgba(200, 220, 240, 0.65);
  --transition: all 0.4s ease;
}
*{box-sizing:border-box;margin:0;padding:0;transition:var(--transition)}
html,body,#globeCanvas,#map{height:100%}
body{
  font-family:Inter,system-ui,Segoe UI,Roboto,"Poppins",sans-serif;
  background: url("dark3.jpg") no-repeat center center/cover fixed;
  color:var(--text);
  height:100vh;
  overflow:hidden;
  transition:background .6s ease;
}
.topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 60;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  padding: 0 14px;
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title {
  position: static;
  transform: none;
  font-weight: 600;
  letter-spacing: 0.6px;
  pointer-events: none;
}

.theme-toggle {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  transition: transform .3s ease;
}

.theme-toggle:hover{transform:rotate(25deg) scale(1.2)}
.app{display:flex;flex-direction:column;height:100vh;padding-top:48px;align-items:center}
.left-pane{
  width:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:18px;padding:28px 18px;flex:1;
  transition:opacity .6s, transform .6s;
}
.left-pane.hidden{opacity:0;transform:translateY(20px);pointer-events:none}
#globeWrap{
  width:100%;max-width:900px;height:50vh;min-height:300px;
  border-radius:14px;overflow:hidden;
  background:linear-gradient(180deg,#0c1326,#000c14);
  box-shadow:0 12px 40px rgba(0,0,0,0.7);position:relative;
  transition:var(--transition)
}
#globeCanvas{display:block;width:100%;height:100%}
#particlesLite{position:absolute;inset:0;pointer-events:none}
.controls{width:100%;max-width:900px;display:flex;flex-direction:column;gap:12px;margin-top:12px}
.search-group{position:relative;width:100%}
#cityInput{
  width:100%;padding:14px 16px;border-radius:10px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.05);
  color:var(--text);outline:none;font-size:16px;
  box-shadow:inset 0 -1px 0 rgba(255,255,255,0.03);
}
#cityInput::placeholder{color:var(--muted)}
.suggestions{
  position:absolute;left:0;right:0;top:50px;
  background:var(--panel);border-radius:8px;
  border:1px solid rgba(255,255,255,0.05);
  overflow:hidden;max-height:220px;
  box-shadow:0 10px 30px rgba(0,0,0,0.65);
  display:none;z-index:30
}
.suggestions .item{
  padding:10px 12px;cursor:pointer;
  border-bottom:1px solid rgba(255,255,255,0.03);
  font-size:15px;color:var(--text)
}
.suggestions .item:last-child{border-bottom:none}
.suggestions .item:hover{background:rgba(255,255,255,0.06)}
.btn-row{display:flex;gap:10px;margin-top:6px;flex-wrap:wrap}
.btn{
  flex:1;padding:12px 14px;border-radius:10px;border:none;
  cursor:pointer;font-weight:600;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  color:#031017;
  box-shadow:0 8px 24px rgba(0,0,0,0.5);
  transition:transform .3s ease, box-shadow .3s ease;
  min-width:140px;
}
.btn:hover{transform:translateY(-2px);box-shadow:0 10px 28px rgba(0,0,0,0.6)}
.btn.ghost{
  background:transparent;border:1px solid rgba(255,255,255,0.1);color:var(--text)
}
.btn.primary{
  background:linear-gradient(90deg,var(--accent),#26d6ff);color:#04141a
}
.right-pane{
  flex:1;width:100%;position:absolute;left:0;top:48px;bottom:0;padding:18px;
  display:flex;flex-direction:column;gap:12px;
  align-items:stretch;justify-content:flex-start;
  transition:transform .6s,opacity .6s,background .4s;
  backdrop-filter:blur(8px);z-index:20;
}
.right-pane[aria-hidden="true"]{pointer-events:none;opacity:0;transform:translateY(20px)}
.right-pane[aria-hidden="false"]{pointer-events:auto;opacity:1;transform:translateY(0)}
.back{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 9999;
  cursor: pointer;
  font-size: 15px;
  display: none;
}
.back:hover{background:rgba(255,255,255,0.12)}
.map{
  flex:1;border-radius:12px;overflow:hidden;
  border:1px solid rgba(255,255,255,0.06);
  box-shadow:0 12px 40px rgba(0,0,0,0.55)
}
.weather-panel {
  width: 100%;
  max-width: 860px;
  margin: 20px auto 0 auto;
  background: linear-gradient(145deg, rgba(18,22,35,0.95), rgba(30,34,60,0.95));
  padding: 28px;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(0, 200, 255, 0.15);
  opacity: 0;
  transform: translateY(40px);
  transition: transform 0.7s ease, opacity 0.7s ease, background 0.6s ease, box-shadow 0.6s ease;
  color: #eaf6ff;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fadeUp 0.9s ease forwards;
  position: relative;
  overflow: hidden;
}

.weather-panel.show {
  opacity: 1;
  transform: translateY(0);
}

.weather-panel:hover {
  box-shadow: 0 18px 55px rgba(0,0,0,0.7), 0 0 35px rgba(0, 200, 255, 0.25);
  transform: translateY(-6px) scale(1.02);
}

.weather-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 2px;
  background: linear-gradient(130deg, #00d2ff, #3a7bd5, #00d2ff);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, 
                 linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  animation: borderGlow 6s linear infinite;
}

@keyframes borderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.weather-head h3 {
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(0,200,255,0.7);
}

.w-now {
  font-weight: 700;
  font-size: 26px;
  text-shadow: 0 0 16px rgba(0,200,255,0.7);
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  from { text-shadow: 0 0 8px rgba(0,200,255,0.6); }
  to { text-shadow: 0 0 20px rgba(0,200,255,1); }
}

.w-details {
  margin-top: 14px;
  font-size: 16px;
  color: #dbe6f2;
  line-height: 1.7;
}

.w-more div {
  flex: 1 1 45%;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  transition: background 0.4s ease, transform 0.4s ease;
  text-shadow: 0 0 6px rgba(0,200,255,0.4);
}

.w-more div:hover {
  background: rgba(0,200,255,0.12);
  transform: scale(1.05);
}

.fday {
  flex: 1 1 28%;
  background: rgba(255,255,255,0.08);
  padding: 16px 12px;
  border-radius: 16px;
  text-align: center;
  color: #fff;
  transition: transform 0.4s ease, background 0.4s ease;
  box-shadow: 0 0 14px rgba(0,200,255,0.12);
}

.fday:hover {
  transform: scale(1.08);
  background: rgba(0,200,255,0.2);
  box-shadow: 0 0 22px rgba(0,200,255,0.3);
}

.fday img {
  width: 52px;
  height: 52px;
  margin-top: 10px;
  filter: drop-shadow(0 0 8px rgba(0,200,255,0.6));
}

body.light .weather-panel {
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(240,240,240,0.95));
  color: #222;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 25px rgba(255,200,0,0.15);
}

body.light .weather-panel::before {
  background: linear-gradient(130deg, #ffb347, #ffcc33, #ffb347);
}

body.light .w-now {
  text-shadow: 0 0 12px rgba(255,200,0,0.8);
  color: #000c14;
}

body.light .w-details,
body.light .w-more,
body.light .w-more div,
body.light .fday {
  color: #000c14;
  text-shadow: none;
}


.loading-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,rgba(2,6,23,0.7),rgba(2,6,23,0.9));z-index:80}
.loading-overlay.hidden{display:none}
.loader{display:flex;flex-direction:column;align-items:center;gap:14px}
.pulse{width:64px;height:64px;border-radius:50%;background:radial-gradient(circle,#26d6ff,#0077ff);box-shadow:0 12px 40px rgba(0,119,255,0.4);animation:beat 1.2s infinite}
@keyframes beat{0%{transform:scale(1)}50%{transform:scale(.88)}100%{transform:scale(1)}}
.loading-text{color:var(--text);font-weight:600}
@media (max-width:1000px){
  #globeWrap{height:38vh;min-height:220px}
  .controls{max-width:100%}
  .btn-row{flex-direction:column}
  .btn{width:100%;min-width:auto}
}
.light{
  --bg-dark:#fff4e1;
  --panel:#fff7eb;
  --accent:#ff7b54;
  --accent2:#ffb347;
  --glass:rgba(10,14,18,0.04);
  --text:#2e1a0f;
  --muted:rgba(46,26,15,0.65);
  background: url("light.jpg") no-repeat center center/cover fixed;
}
body.light .loading-text {
  color: #ffffff; 
}

@media (max-width:768px){
  .topbar{height:44px;padding:0 10px}
  .title{font-size:16px}
  .theme-toggle{font-size:16px}
  #globeWrap{height:30vh;min-height:180px}
  .controls{gap:10px}
  #cityInput{padding:12px 14px;font-size:14px}
  .btn{padding:10px 12px;font-size:14px}
  .weather-panel{padding:20px;border-radius:18px}
  .w-now{font-size:22px}
  .weather-head h3{font-size:18px}
  .w-details{font-size:14px}
  .w-more div{padding:10px;font-size:14px}
  .fday{padding:12px 10px}
  .fday img{width:40px;height:40px}
}

@media (max-width:480px){
  .topbar{height:40px}
  .title{font-size:14px}
  .theme-toggle{font-size:14px}
  #globeWrap{height:25vh;min-height:160px}
  .controls{gap:8px}
  #cityInput{padding:10px 12px;font-size:13px}
  .btn{padding:9px 10px;font-size:13px}
  .weather-panel{padding:16px;border-radius:14px}
  .w-now{font-size:20px}
  .weather-head h3{font-size:16px}
  .w-details{font-size:13px;line-height:1.5}
  .w-more div{padding:8px;font-size:13px}
  .fday{padding:10px 8px}
  .fday img{width:34px;height:34px}
}
