/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a73e8;
  --accent: #ffcc00;
  --text-light: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.75);
  --panel-bg: rgba(0, 0, 0, 0.35);
  --panel-border: rgba(255, 255, 255, 0.15);
  --transition-slide: opacity 0.8s ease, transform 0.8s ease;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-light);
  background: #1a1a2e;
}

/* ===== Background Layer ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: background 2s ease;
}

/* ===== Particle Canvas ===== */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ===== Dashboard ===== */
.dashboard {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
  padding-bottom: 50px;
}

/* ===== Slides ===== */
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition-slide);
  pointer-events: none;
  padding: 40px;
}

.slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.slide-header {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 30px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

/* ===== Slide 1: Intro ===== */
.intro-content { text-align: center; }

.loc-badge {
  font-size: 1.5rem;
  margin-bottom: 20px;
  background: var(--panel-bg);
  padding: 8px 24px;
  border-radius: 30px;
  border: 1px solid var(--panel-border);
  display: inline-block;
}

.intro-temp {
  font-size: 8rem;
  font-weight: 200;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.intro-temp .degree { font-weight: 100; }

.intro-condition {
  font-size: 1.8rem;
  margin-top: 10px;
  font-weight: 300;
}

.intro-time {
  font-size: 1rem;
  color: var(--text-dim);
  margin-top: 15px;
}

/* ===== Slide 2: Current Conditions ===== */
.current-grid {
  display: flex;
  gap: 60px;
  align-items: center;
}

.big-temp {
  font-size: 6rem;
  font-weight: 200;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.feels-like {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 5px;
}

.current-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 40px;
  background: var(--panel-bg);
  padding: 24px 32px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 1.05rem;
  padding: 4px 0;
}

.detail-row span:first-child { color: var(--text-dim); }

/* ===== Slide 3: Hourly ===== */
.hourly-scroll {
  display: flex;
  gap: 16px;
  max-width: 90vw;
  overflow: hidden;
  justify-content: center;
}

.hour-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
  min-width: 80px;
  backdrop-filter: blur(8px);
  transition: transform 0.3s ease;
}

.hour-card:hover { transform: translateY(-5px); }

.hour-time { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 8px; }
.hour-icon { font-size: 1.8rem; margin-bottom: 6px; }
.hour-temp { font-size: 1.4rem; font-weight: 600; }
.hour-precip { font-size: 0.8rem; color: var(--accent); margin-top: 4px; }

/* ===== Slide 4: Daily ===== */
.daily-list {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 24px;
  backdrop-filter: blur(8px);
}

.day-name { font-size: 1.1rem; font-weight: 600; width: 120px; }
.day-icon { font-size: 1.8rem; }
.day-desc { font-size: 0.9rem; color: var(--text-dim); flex: 1; margin-left: 12px; }
.day-temps { font-size: 1.1rem; }
.day-high { font-weight: 700; }
.day-low { color: var(--text-dim); }

/* ===== Slide 5: Almanac ===== */
.almanac-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 700px;
}

.almanac-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: transform 0.3s ease;
}

.almanac-card:hover { transform: scale(1.05); }

.almanac-icon { font-size: 2.5rem; margin-bottom: 10px; }
.almanac-label { font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.almanac-value { font-size: 1.5rem; font-weight: 700; }

/* ===== Progress Bar ===== */
.progress-track {
  position: fixed;
  bottom: 40px;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0,0,0,0.3);
  z-index: 30;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

===== Music Toggle =====
/* .music-toggle { */
  /* position: fixed; */
  /* top: 20px; */
  /* right: 20px; */
  /* z-index: 10; */
  /* background: var(--panel-bg); */
  /* border: 1px solid var(--panel-border); */
  /* border-radius: 50%; */
  /* width: 48px; */
  /* height: 48px; */
  /* font-size: 1.3rem; */
  /* cursor: pointer; */
  /* backdrop-filter: blur(8px); */
  /* transition: transform 0.2s ease, background 0.2s ease; */
  /* display: flex; */
  /* align-items: center; */
  /* justify-content: center; */
/* } */

/* .music-toggle:hover { transform: scale(1.1); background: rgba(0,0,0,0.5); } */

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .progress-track { bottom: 35px; }
  .music-controls { top: 55px; right: 10px; gap: 4px; padding: 4px 8px; }
  .slide-nav-btn { width: 48px; height: 48px; font-size: 1.5rem; top: 53%; }
  .slide-nav-btn.left { left: 8px; }
  .slide-nav-btn.right { right: 8px; }
  .dashboard { padding-top: 50px; padding-bottom: 45px; }
}

/* ===== Location Search Panel ===== */
.location-search {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
}

.search-content {
  background: #1a1a2e;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.search-content h3 {
  margin-bottom: 15px;
  color: var(--text-light);
}

#zip-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  background: #2a2a40;
  border: 1px solid #4a4a60;
  border-radius: 8px;
  color: white;
  margin-bottom: 10px;
}

#zip-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.2);
}

.search-results {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
  background: #151525;
  border-radius: 8px;
}

.result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #2a2a40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: #2a2a40;
}

.result-item.highlighted {
  background: var(--primary);
  color: white;
}

.result-item small {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-left: 10px;
}

.result-item.error {
  color: #ff6b6b;
  padding: 15px;
}

.search-actions {
  display: flex;
  gap: 10px;
}

.search-actions button {
  flex: 1;
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#search-btn {
  background: var(--primary);
  color: white;
}

#search-btn:hover {
  background: #0d5bbd;
}

#cancel-btn {
  background: #4a4a60;
  color: white;
}

#cancel-btn:hover {
  background: #5a5a70;
}

.change-loc-btn {
  background: transparent;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.change-loc-btn:hover {
  opacity: 1;
}

/* ===== Music Controls ===== */
.music-controls {
  position: fixed;
  top: 65px;
  right: 20px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 50px;
  padding: 6px 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.music-toggle {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.music-toggle:hover { transform: scale(1.1); }

.music-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
}

.music-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.track-info {
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  min-width: 50px;
}

/* ===== Slide Navigation Buttons ===== */
.slide-nav-btn {
  position: fixed;
  top: 55%;
  transform: translateY(-50%);
  z-index: 20;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 2rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-nav-btn.left {
  left: 20px;
}

.slide-nav-btn.right {
  right: 20px;
}

.slide-nav-btn:hover {
  transform: translateY(-50%) scale(1.1);
  background: rgba(0, 0, 0, 0.5);
}

.slide-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

@media (max-width: 768px) {
  .slide-nav-btn {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .slide-nav-btn.left {
    left: 10px;
  }
  .slide-nav-btn.right {
    right: 10px;
  }
}

/* ===== HEADER (Always Visible) ===== */
.dashboard-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loc-badge {
  font-size: 1.1rem;
  background: var(--panel-bg);
  padding: 6px 16px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.change-loc-btn {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  margin-left: 4px;
}

.change-loc-btn:hover { opacity: 1; }

.header-temp {
  font-size: 2rem;
  font-weight: 200;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ===== RADAR ===== */
.radar-container {
  width: 100%;
  height: 55vh;
  max-width: 700px;
  margin: 20px auto;
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a1a;
}

#radar-map {
  border-radius: 10px;
}

/* Leaflet dark theme tweaks */
.leaflet-container {
  background: #0a0a1a !important;
  font-family: inherit !important;
}

.leaflet-control-zoom a {
  background: rgba(0,0,0,0.6) !important;
  color: white !important;
  border: 1px solid var(--panel-border) !important;
}

.leaflet-control-attribution {
  background: rgba(0,0,0,0.5) !important;
  color: #aaa !important;
  font-size: 0.7rem !important;
}

/* .radar-overlay { */
  /* position: absolute; */
  /* bottom: 0; */
  /* left: 0; */
  /* right: 0; */
  /* padding: 12px; */
  /* background: linear-gradient(transparent, rgba(0,0,0,0.8)); */
  /* display: flex; */
  /* flex-direction: column; */
  /* gap: 8px; */
/* } */

#radar-timestamp {
  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
}

.radar-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.radar-controls button {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 6px 12px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.radar-controls button:hover {
  background: rgba(255,255,255,0.15);
}

/* ===== TICKER FOOTER ===== */
.ticker-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--panel-border);
  height: 40px;
  overflow: hidden;
}

.ticker-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ticker-text {
  white-space: nowrap;
  padding: 8px 0;
  color: var(--text-light);
  font-size: 0.95rem;
  animation: ticker-scroll 30s linear infinite;
  padding-left: 100%;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
  /* Header smaller */
  .dashboard-header {
    padding: 6px 12px;
  }
  
  .loc-badge {
    font-size: 0.9rem;
    padding: 4px 10px;
  }
  
  .header-temp {
    font-size: 1.4rem;
  }
  
  /* Smaller intro temp if still used */
  .intro-temp { font-size: 5rem; }
  
  /* Slide adjustments */
  .big-temp { font-size: 4rem; }
  .slide-header { font-size: 1.1rem; letter-spacing: 2px; }
  
  /* Two-column almanac */
  .almanac-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Hide day description on cards */
  .day-desc { display: none; }
  
  /* Hourly cards wrap */
  .hourly-scroll { flex-wrap: wrap; }
  
  /* Navigation buttons smaller */
  .slide-nav-btn { width: 48px; height: 48px; font-size: 1.5rem; }
  .slide-nav-btn.left { left: 8px; }
  .slide-nav-btn.right { right: 8px; }
  
  /* Music controls stack better */
  .music-controls { gap: 4px; padding: 4px 8px; }
  .music-btn, .music-toggle { width: 36px; height: 36px; font-size: 1rem; }
  .track-info { font-size: 0.7rem; max-width: 80px; }
  
  /* Radar container smaller */
  .radar-container { height: 40vh; }
  
  /* Ticker font smaller */
  .ticker-text { font-size: 0.85rem; }
  
  /* Progress bar thinner */
  .progress-track { height: 3px; }
}

@media (max-width: 480px) {
  .loc-badge { font-size: 0.8rem; padding: 3px 8px; }
  .header-temp { font-size: 1.2rem; }
  .big-temp { font-size: 3rem; }
  .slide-header { font-size: 1rem; }
  .music-controls { position: absolute; top: 60px; right: 10px; }
  .slide-nav-btn { width: 40px; height: 40px; font-size: 1.2rem; }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .dashboard-header { height: 40px; }
  .ticker-footer { display: none; }  /* Hide ticker in landscape */
  .slide-nav-btn { top: 50%; }
  .music-controls { top: 45px; }
}

/* ===== Current Conditions Mobile Adaptive ===== */
@media (max-width: 768px) {
  .current-grid {
    flex-direction: column;
    gap: 12px;
  }

  .big-temp {
    font-size: 3rem;
    text-align: center;
    padding: 20px;
  }

  .feels-like {
    font-size: 0.9rem;
    margin-top: 5px;
  }

  .current-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    padding: 0 15px;
  }

  .detail-row {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .current-details {
    grid-template-columns: 1fr;
  }

  .big-temp {
    font-size: 2.5rem;
  }

  .slide-header {
    font-size: 0.9rem !important;
    letter-spacing: 1px !important;
  }
}