:root{
  /* stronger emerald look */
  --pink-1: rgba(187, 72, 170, 0.1);
  --pink-2: rgba(187, 72, 151, 0.22);
  --pink-accent: #c22fa0;
  --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.03), var(--pink-1));
  --glass-brd: rgba(187, 72, 170, 0.18);
  --text: #f6f7fb;
  --muted: #d6e9df;
  --accent: #80bfff;
  --accent-2: #a0d9ff;
  --shadow: 0 22px 60px rgba(6,10,10,0.52);
  --glow-color: rgba(194, 47, 172, 0.5); /* for placeholder glow */
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin:0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: #071019;
  overflow-x: hidden;
}

/* Background video */
.bg-video{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  object-fit: cover;
  filter: brightness(0.82) saturate(110%);
  z-index: -1;
  transition: opacity .6s ease;
}

/* App shell */
.app{
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: clamp(14px, 3vw, 28px);
  background:
    radial-gradient(60% 80% at 70% 0%, rgba(128,191,255,0.05), transparent 60%),
    radial-gradient(40% 60% at 10% 20%, rgba(160,217,255,0.03), transparent 60%);
}

/* Controls */
.controls{
  display: grid;
  gap: 10px;
  justify-items: center;
}
.search{
  display:flex;
  gap:10px;
  width: min(680px, 100%);
}
.search input{
  flex:1;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-brd);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  outline: none;
  backdrop-filter: blur(6px);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.search input:focus{
  box-shadow: 0 8px 30px rgba(47,194,122,0.12);
  border-color: var(--emerald-2);
}
.search input::placeholder{
  color: #ffd700;
  opacity: 0.95;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.3); /* yellowish glowing effect */
}
.btn{
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #062036;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s ease, filter .18s ease;
}
.btn:hover{ filter: brightness(1.06); }
.btn:active{ transform: translateY(1px) scale(0.99); }
.btn.outline{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--glass-brd);
  box-shadow: none;
}
.btn.toggle{ width: 76px; }

/* Geolocation button states */
.btn.geo-success{
  background: linear-gradient(135deg, rgba(40,170,110,0.95), rgba(30,150,90,0.95));
  color: #06201a;
  border: 1px solid rgba(255,255,255,0.06);
}
.spinner {
  display:inline-block;
  margin-left: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  border-top: 2px solid var(--emerald-accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta-row{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Card */
.card.glass{
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 26px);
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 18px 50px rgba(10,20,15,0.45);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card.glass:hover{
  transform: translateY(-6px);
  box-shadow: 0 30px 80px rgba(10,25,20,0.55);
}

/* Header */
.card-header{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: clamp(12px, 2vw, 24px);
  align-items: end;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  padding-bottom: clamp(12px, 2vw, 18px);
  margin-bottom: clamp(12px, 2vw, 18px);
}
.place h1{
  font-size: clamp(22px, 4vw, 36px);
  margin: 0 0 6px;
}
.place p{
  margin: 0;
  color: var(--muted);
  font-size: clamp(13px, 1.8vw, 16px);
}
.main-temp{
  display:flex;
  align-items:center;
  gap: clamp(12px, 2vw, 24px);
}
#bigTemp{
  font-size: clamp(44px, 10vw, 84px);
  font-weight: 800;
  line-height: 1;
}
.main-desc{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: clamp(16px, 3vw, 22px);
}
.main-desc img{
  width: clamp(38px, 6vw, 60px);
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35));
}

/* Metrics grid */
.metrics{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: clamp(10px, 2vw, 16px);
}
.metric{
  display:flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  padding: 14px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  min-height: 84px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.metric i{ opacity: 0.95; }
.metric span{ color: var(--muted); font-size: 13px; }
.metric strong{ font-size: 16px; }

.metric:hover{
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(40,160,100,0.10);
  border-color: rgba(72,187,138,0.36);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(72,187,138,0.02));
}

/* Footer */
.footer{
  display:flex;
  justify-content:center;
  align-items:center;
  opacity: 0.85;
  font-size: 12px;
}

/* FAB Chat */
.chat-fab{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #062036;
  font-size: 22px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--shadow);
  cursor:pointer;
  z-index: 20;
}

/* Chat panel */
.chat-panel{
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: min(420px, calc(100% - 24px));
  height: min(70dvh, 560px);
  background: rgba(13, 23, 44, 0.7);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 25;
}
.chat-panel.open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.chat-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.chat-title{ display:flex; align-items:center; gap:8px; font-weight:700; }
.chat-close{
  background: transparent; border:none; color: var(--text); font-size: 18px; cursor:pointer;
}
.chat-messages{
  padding: 12px;
  overflow:auto;
  display:flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.bubble{
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.3;
  width: fit-content;
}
.bubble.user{
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #062036;
}
.bubble.ai{
  align-self: flex-start;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
}
.typing{
  display:inline-flex;
  gap: 4px;
}
.dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; opacity: 0.6;
  animation: blink 1s infinite ease-in-out;
}
.dot:nth-child(2){ animation-delay: .15s; }
.dot:nth-child(3){ animation-delay: .3s; }
@keyframes blink{
  0%, 80%, 100%{ transform: translateY(0); opacity: 0.5; }
  40%{ transform: translateY(-3px); opacity: 1; }
}
.chat-inputbar{
  display:flex; gap:8px; padding: 10px; border-top: 1px solid rgba(255,255,255,0.15);
}
.chat-inputbar input{
  flex:1; padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08); color: var(--text); outline:none;
}
.chat-inputbar input::placeholder{
  color: #ffd700;
  opacity: 0.95;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.3); /* yellowish glowing effect */
}

/* Forecast section */
.forecast-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255,255,255,0.06);
}
.forecast-section h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text);
}
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.forecast-item {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  padding: 12px;
  border-radius: 14px;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.forecast-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(40,160,100,0.10);
}
.forecast-date {
  font-size: 0.9rem;
  color: var(--muted);
}
.forecast-temp {
  font-weight: bold;
  font-size: 1rem;
  margin: 6px 0;
}
.forecast-desc {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 980px){
  .metrics{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px){
  .card-header{ grid-template-columns: 1fr; align-items: start; }
  .metrics{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px){
  .metrics{ grid-template-columns: repeat(2, 1fr); }
}
