@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@800&family=Montserrat:wght@400;600&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
  height: 100%;
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;
  color: #FFF8F0;
  transition: color 0.3s;
}

body.weather-cold { color: #E0F7FA; }
body.weather-heat { color: #FFEFD5; }
body.weather-storm { color: #E8EAF6; }
body.weather-rain { color: #BBDEFB; }
body.weather-wind { color: #F0F4F8; }
body.weather-fog { color: #CFD8DC; }
body.weather-clear { color: #FFFDE7; }

body.weather-cold .confidence, body.weather-cold .card .label { color: #B3E5FC; }
body.weather-heat .confidence, body.weather-heat .card .label { color: #FFDAB9; }
body.weather-storm .confidence, body.weather-storm .card .label { color: #C5CAE9; }
body.weather-rain .confidence, body.weather-rain .card .label { color: #90CAF9; }
body.weather-wind .confidence, body.weather-wind .card .label { color: #E3E9ED; }
body.weather-fog .confidence, body.weather-fog .card .label { color: #B0BEC5; }
body.weather-clear .confidence, body.weather-clear .card .label { color: #FFF59D; }

body.modal-open {
  overflow: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 10;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-title {
  font-family: 'Poppins', sans-serif;
  font-size: 3rem;
  font-weight: 800;
}

/* My Location button */
.my-location-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.my-location-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.02);
}

.my-location-btn:active {
  transform: scale(0.98);
}

.my-location-btn svg {
  opacity: 0.9;
  flex-shrink: 0;
}

/* Hide text on very small screens, keep icon */
@media (max-width: 400px) {
  .my-location-btn span {
    display: none;
  }
  .my-location-btn {
    padding: 8px;
    border-radius: 50%;
  }
}

.tagline {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-top: 0.5rem;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 1px 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.main {
  text-align: center;
}

/* HOME layout overrides (mockup) */
#home-screen {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  min-height: 70vh;
  padding-top: clamp(2.5rem, 6vh, 4.5rem);
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: calc(130px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

#home-screen .brand,
#home-screen .brand-text,
#home-screen .tagline {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  align-items: flex-start;
}

#home-screen .confidence {
  margin-top: clamp(3rem, 14vh, 7.5rem);
}

/* ========== NEW HERO TEMP LAYOUT ========== */
/* "Probably 29°" - BIG hero element - VIBRANT GOLD */
.temp {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.25rem 0 0.15rem;
  color: #ffd700;
  text-shadow: 
    0 0 20px rgba(255, 215, 0, 0.6),
    0 0 40px rgba(255, 215, 0, 0.4),
    3px 3px 6px rgba(0, 0, 0, 0.9);
}

/* High/Low underneath - better contrast */
.temp-hilo,
#tempHiLo {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

#tempHiLo .hi {
  color: #ff6b6b;
  text-shadow: 
    0 0 10px rgba(255, 107, 107, 0.6),
    3px 3px 6px rgba(0, 0, 0, 0.9);
}

#tempHiLo .lo {
  color: #5ddfff;
  margin-left: 0.75rem;
  text-shadow: 
    0 0 10px rgba(93, 223, 255, 0.6),
    3px 3px 6px rgba(0, 0, 0, 0.9);
}

/* Headline - bold and vibrant with strong shadow */
.headline {
  font-size: 2.2rem;
  font-weight: 800;
  text-shadow: 
    0 0 15px currentColor,
    3px 3px 6px rgba(0, 0, 0, 0.9);
  transition: text-shadow 0.3s;
  margin-bottom: 0.25rem;
}

/* Description/humor line - orange/coral for warmth */
.description {
  font-size: 1.4rem;
  font-weight: 600;
  color: #ff8c42;
  margin-bottom: 0.75rem;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
}

/* Weather byline - split into 2 rows, subtle */
.weather-byline {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  margin-top: 0.5rem;
  letter-spacing: 0.3px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.byline-row {
  font-size: 0.95rem;
}

/* Home layout wrapper - enables two-column on mobile */
.home-layout {
  position: relative;
}

.sidebar {
  position: absolute;
  right: 2rem;
  top: clamp(160px, 24vh, 260px);
  bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 12px);
  width: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1rem;
}

/* Two-panel sidebar: hero card more prominent, sources lighter */
.card-hero {
  padding: 1.1rem;
}

.card-sources {
  background: rgba(255,255,255,0.08);
  padding: 0.8rem;
}

.card-sources .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-sources .value {
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: pre-line;
}

.card {
  background: rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  border-radius: 20px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 30px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.18);
  text-align: center;
}

.home-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80vh;
  gap: 2rem;
}

@media (max-width: 600px) {
  .home-hero {
    flex-direction: column;
    height: auto;
  }
}

.label {
  font-size: 0.9rem;
  opacity: 0.7;
}

.value {
  font-size: 1.2rem;
  font-weight: 600;
}

#confidenceValue {
  font-size: 0.69rem; /* ~11px - smaller to prevent cutoff by bottom nav */
  line-height: 1.3;
  white-space: pre-line;
}

.confidence {
  font-size: 1rem;
  margin-bottom: 2rem;
}

.confidence-bar {
  height: 4px;
  background: currentColor;
  opacity: 0.5;
  margin-top: 5px;
  border-radius: 2px;
  transition: width 0.3s;
}

.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 2rem;
  background: rgba(0,0,0,0.5);
  padding: 0.75rem 1rem;
  z-index: 100;
  height: var(--nav-h, 72px);
  max-width: none;
}

.nav button {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* SCREEN PANELS (Hourly/Week/Search/Settings) */
.screenPanel {
  position: fixed;
  inset: var(--panel-top) var(--panel-side) calc(var(--nav-h) + var(--panel-bottom)) var(--panel-side);
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 20;
}

.glass-panel {
  background: rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.18);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Helvetica Neue", Arial, sans-serif;
  color: var(--panel-text, #222);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screen-panel-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.screen-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen-panel-footer {
  display: flex;
  justify-content: center;
}

.screen-title {
  text-align: center;
  font-size: clamp(28px, 3vw, 44px);
  margin-bottom: 0;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Weather-themed screen title colors */
body.weather-clear .screen-title { color: #ffd700; }
body.weather-heat .screen-title { color: #ff8c42; }
body.weather-cold .screen-title { color: #00bfff; }
body.weather-rain .screen-title { color: #64b5f6; }
body.weather-storm .screen-title { color: #9575cd; }
body.weather-wind .screen-title { color: #90a4ae; }
body.weather-fog .screen-title { color: #b0bec5; }

@media (max-width: 900px) {
  :root {
    --panel-side: 24px;
    --panel-top: 96px;
  }
}

@media (max-width: 640px) {
  :root {
    --panel-side: 16px;
    --panel-top: 88px;
    --panel-bottom: 16px;
  }
}

/* WEEK */
.week-screen .screen-panel-body {
  min-width: 0;
}

.week-screen .daily-cards {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow-y: auto;
}

.week-screen .daily-card {
  padding: clamp(0.6rem, 1vw, 0.9rem);
}

/* HOURLY */
.hourly-screen .screen-panel-body {
  min-width: 0;
}

.hourly-screen .hourly-timeline {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  overflow-x: auto;
  min-width: 0;
}

.hourly-card,
.daily-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 1rem;
  min-width: 160px;
  gap: 0.5rem;
}

body.ui-dark .hourly-card,
body.ui-dark .daily-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.12);
}

.hour-row,
.day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hour-icon,
.day-icon {
  font-size: 1.1rem;
}

.precip-bar {
  height: calc(var(--prob) * 1%);
  width: 4px;
  background: #3b82f6;
  border-radius: 4px;
  align-self: flex-end;
}

.confidence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.confidence-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.conf-high { background: #22c55e; }
.conf-med { background: #f59e0b; }
.conf-low { background: #ef4444; }

.hour-wind,
.day-uv {
  font-size: 0.85rem;
  color: var(--panel-subtext, #4b5563);
}

.icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  margin-right: 6px;
}

/* Removed 600px vertical stacking - keep horizontal scroll on all screen sizes */

/* ========== VERTICAL TABLE LAYOUT FOR HOURLY/WEEKLY (Yr-style) ========== */
.hourly-timeline,
.daily-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  overflow-y: auto;
  padding: 0;
}

/* Hourly row styling */
.hourly-row {
  display: grid;
  grid-template-columns: 60px 40px 60px 50px 50px;
  gap: 8px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  margin-bottom: 4px;
}

.hourly-row.hourly-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  padding-bottom: 8px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.2);
}

.hourly-row .h-time {
  font-weight: 600;
  color: #fff;
}

.hourly-row .h-icon {
  font-size: 1.2rem;
  text-align: center;
}

.hourly-row .h-temp {
  font-weight: 700;
  font-size: 1.1rem;
}

.hourly-row .h-rain,
.hourly-row .h-wind {
  font-size: 0.85rem;
  opacity: 0.9;
  text-align: right;
  color: #fff;
}

/* Daily row styling */
.daily-row {
  display: grid;
  grid-template-columns: 1fr 40px 55px 55px 50px;
  gap: 8px;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  margin-bottom: 4px;
}

.daily-row.daily-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  padding-bottom: 8px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.2);
}

.daily-row .d-day {
  font-weight: 600;
  color: #fff;
}

.daily-row .d-icon {
  font-size: 1.2rem;
  text-align: center;
}

.daily-row .d-high {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: right;
}

.daily-row .d-low {
  font-size: 0.95rem;
  opacity: 0.85;
  text-align: right;
  color: #fff;
}

.daily-row .d-rain {
  font-size: 0.85rem;
  opacity: 0.9;
  text-align: right;
  color: #fff;
}

/* Day badge inline */
.day-badge {
  display: inline-block;
  font-size: 0.6rem;
  text-transform: uppercase;
  background: rgba(255,255,255,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Recent item with logo */
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recent-item::before {
  display: none !important;
}

.recent-logo {
  flex-shrink: 0;
}

.recent-name {
  flex: 1;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.result-icon {
  font-size: 1rem;
}


.result-temp {
  margin-left: auto;
  font-weight: 600;
}

/* SEARCH */
.search-screen .screen-panel-header {
  align-items: center;
}

.search-screen {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  color: inherit;
  max-width: 500px;
  margin: 0 auto;
  padding: 16px;
}

.search-screen #searchInput {
  margin: 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: inherit;
}

.search-screen #searchInput::placeholder {
  color: rgba(255,255,255,0.6);
}

.search-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-lists {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-screen .section {
  margin: 0;
  max-width: none;
}

.search-screen .section h3 {
  color: inherit;
  opacity: 0.9;
}

.search-screen .section ul li {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  color: inherit;
}

.search-screen .section ul li:hover {
  background: rgba(255,255,255,0.2);
}

.search-screen #favoritesList,
.search-screen #recentList {
  max-height: 20vh;
  overflow-y: auto;
  padding-bottom: 6px;
}

.favorite-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fav-star {
  background: none;
  border: none;
  cursor: pointer;
  color: #f5c542;
  font-size: 1.1rem;
}

.fav-star.is-fav {
  color: #f5c542;
}

.fav-icon {
  font-size: 1.1rem;
}

.fav-temp {
  margin-left: auto;
  font-weight: 600;
}

.recent-item::before {
  content: '•';
  margin-right: 8px;
  color: #111;
}

.search-screen .search-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.search-screen .manage-btn,
.search-screen .clear-recents {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  color: inherit;
  padding: 0.5rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0;
}

.search-screen .manage-btn:hover,
.search-screen .clear-recents:hover {
  background: rgba(255,255,255,0.25);
}

/* SETTINGS */
.settings-screen {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  color: inherit;
  max-height: 80vh;
  overflow-y: auto;
}

.settings-screen .screen-panel-header {
  color: inherit;
}

.settings-screen .screen-panel-body {
  overflow: auto;
  align-items: center;
}

.settings-screen .settings-section {
  margin-bottom: 0;
}

.settings-screen .settings-section h3 {
  color: inherit;
  opacity: 0.9;
}

.settings-screen .settings-option {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.settings-screen .settings-option label {
  color: inherit;
}

.settings-screen .settings-option select {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: inherit;
}

.settings-screen .settings-section p {
  opacity: 0.8;
}

@media (max-width: 900px) {
  .settings-screen .settings-section {
    max-width: 100%;
  }
}

/* Removed 640px grid override - using flex for horizontal scroll */

.settings-section {
  width: 100%;
  max-width: 600px;
  padding: 0.5rem 0;
}

.settings-section h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.settings-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.settings-option label {
  flex: 1;
  font-size: 1.1rem;
  color: #111;
}

.settings-option select {
  padding: 0.8rem 2.2rem 0.8rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.95);
  color: #111;
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #333 50%),
    linear-gradient(135deg, #333 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.settings-option input[type="checkbox"], input[type="radio"] {
  appearance: none;
  width: 50px;
  height: 30px;
  background: #c7c7c7;
  border-radius: 15px;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.1);
}

.settings-option input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: #16a34a;
}

.settings-option input[type="checkbox"]::before, input[type="radio"]::before {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: 0.3s;
}

.settings-option input[type="checkbox"]:checked::before, input[type="radio"]:checked::before {
  left: 22px;
}

select option {
  color: #111;
  background: #fff;
}

.hidden {
  display: none !important;
}

.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 2rem 3rem;
  border-radius: 20px;
  font-size: 1.2rem;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.toast {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
  pointer-events: all;
}

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 20px;
  background: rgba(255,255,255,0.6);
  animation: fall linear infinite;
}

.particle.rain {
  width: 2px;
  height: 20px;
  opacity: 0.75;
}

.particle.snow {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  animation: float linear infinite;
}

.particle.wind {
  width: 10px;
  height: 2px;
  background: rgba(255,255,255,0.5);
  animation: drift linear infinite;
}

@keyframes fall {
  0% {
    transform: translateY(-100px);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

@keyframes float {
  0% {
    transform: translateY(-40px) translateX(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(40px);
    opacity: 0;
  }
}

@keyframes drift {
  0% {
    transform: translateX(-40px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateX(100vw);
    opacity: 0;
  }
}

#logoCircle {
  width: 40px;
  height: 40px;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#logoCircle svg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  width: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-location {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0.95;
  margin-top: 0.25rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.save-btn {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  color: currentColor;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
}

.save-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.sources {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 1rem;
}

#searchInput {
  width: 100%;
  max-width: 500px;
  padding: 1rem;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: currentColor;
  font-size: 1rem;
  margin: 1rem auto;
  display: block;
}

#searchInput::placeholder {
  color: rgba(255,255,255,0.5);
}

.cancel-btn, .manage-btn {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  color: currentColor;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0.5rem;
}

.refresh-icon {
  background: none;
  border: none;
  color: currentColor;
  font-size: 0.9rem;
  cursor: pointer;
  margin-left: 8px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.refresh-icon:hover {
  color: #fff;
  transform: rotate(360deg);
}

.cancel-btn:hover, .manage-btn:hover {
  background: rgba(255,255,255,0.3);
}

.section {
  margin: 2rem 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.section ul {
  list-style: none;
  padding: 0;
}

.section ul li {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 1rem;
  margin: 0.5rem 0;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section ul li:hover {
  background: rgba(255,255,255,0.2);
  transform: translateX(5px);
}

.fav-name {
  flex: 1;
  cursor: pointer;
}

.remove-fav {
  background: rgba(255,0,0,0.3);
  border: 1px solid rgba(255,0,0,0.5);
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  padding: 0;
}

.remove-fav:hover {
  background: rgba(255,0,0,0.6);
  transform: scale(1.1);
}

.fav-limit {
  text-align: center;
  opacity: 0.7;
  font-size: 0.9rem;
  margin: 1rem 0;
  display: none;
}

.hourly-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 0;
  max-width: 100%;
}

.hourly-card {
  min-width: 110px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 15px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hour-time {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.hour-temp {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hour-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.2rem 0;
}

.hour-detail .detail-label {
  opacity: 0.6;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.hour-detail .detail-value {
  font-weight: 500;
}

.daily-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow-y: auto;
}

.daily-card {
  flex: 0 0 auto;
  min-width: 130px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 15px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.day-name {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.day-temp {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.day-hero {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
  padding: 0.2rem 0.5rem;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  margin: 0.25rem auto;
}

.day-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.2rem 0;
}

.day-detail .detail-label {
  opacity: 0.6;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.day-detail .detail-value {
  font-weight: 500;
}

#bgImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.footer {
  position: fixed;
  bottom: 5px;
  right: 10px;
  font-size: 0.8rem;
  opacity: 0.6;
  color: currentColor;
}

#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

#scrim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
}

/* HOME SCREEN LAYOUT OVERRIDES (mockup alignment) */
:root {
  --home-bottom-safe: 120px;
  --bottom-nav-height: 120px;
  --bottom-nav-h: 72px;
  --overlay-pad: 24px;
  --nav-h: 72px;
  --panel-top: 200px;
  --panel-side: 72px;
  --panel-bottom: 24px;
}

main#home-screen.main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding-top: clamp(2rem, 6vh, 3.5rem);
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: calc(var(--home-bottom-safe) + env(safe-area-inset-bottom));
}

body:has(main#home-screen.main:not(.hidden)) .header {
  text-align: left;
  align-items: flex-start;
}

body:has(main#home-screen.main:not(.hidden)) .brand {
  justify-content: flex-start;
}

body:has(main#home-screen.main:not(.hidden)) .brand-text {
  align-items: flex-start;
}

body:has(main#home-screen.main:not(.hidden)) .brand-title,
body:has(main#home-screen.main:not(.hidden)) .brand-location,
body:has(main#home-screen.main:not(.hidden)) .tagline {
  text-align: left;
}

main#home-screen.main #confidence,
main#home-screen.main #sources,
main#home-screen.main #headline,
main#home-screen.main #temp,
main#home-screen.main #tempHiLo,
main#home-screen.main #description {
  text-align: left;
  max-width: 680px;
}

main#home-screen.main #confidence {
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  main#home-screen.main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  main#home-screen.main #confidence {
    margin-top: 0.75rem;
  }
}

/* ========== CONDITION-SPECIFIC TEXT EFFECTS ========== */
/* Each class has: color glow + dark shadow for contrast on any background */
.hero-storm { color: #9932cc; text-shadow: 0 0 15px #9932cc, 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; }
.hero-rain { color: #4682b4; text-shadow: 0 0 10px #4682b4, 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; }
.hero-heat { color: #ff6600; text-shadow: 0 0 10px #ff6600, 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; }
.hero-cold { color: #00bfff; text-shadow: 0 0 10px #00bfff, 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; }
.hero-wind { color: #a9a9a9; text-shadow: 0 0 8px #a9a9a9, 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; }
.hero-uv { color: #ffd700; text-shadow: 0 0 10px #ffd700, 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; }
.hero-clear { color: #ffffff; text-shadow: 0 0 5px #ffffff, 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; }
.hero-cloudy { color: #c0c0c0; text-shadow: 0 0 5px #c0c0c0, 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; }
.hero-fog { color: #a0a0a0; text-shadow: 2px 2px 4px rgba(0,0,0,0.8); font-weight: 900; filter: blur(0.5px); }

/* ========== HERO FADE-IN ANIMATION ========== */
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#home-screen .headline,
#home-screen .temp,
#home-screen .temp-hilo,
#home-screen .description {
  animation: heroFadeIn 1s ease-in forwards;
}

#home-screen .temp {
  animation-delay: 0.1s;
}

#home-screen .temp-hilo {
  animation-delay: 0.2s;
}

#home-screen .headline {
  animation-delay: 0.3s;
}

#home-screen .description {
  animation-delay: 0.4s;
}

/* ========== TEMPERATURE COLOR CLASSES ========== */
.temp-hot { color: #ff6600; }
.temp-warm { color: #ffaa00; }
.temp-cold { color: #00bfff; }
.temp-freezing { color: #87ceeb; }

/* ========== WEATHER ICONS ========== */
.weather-icon { font-size: 1.4em; margin-right: 4px; }

/* ========== MOBILE RESPONSIVE (Two-Column Layout) ========== */
@media (max-width: 480px) {
  /* Mobile performance optimizations */
  * {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  
  /* Use solid backgrounds instead of blur for better performance */
  .glass-panel,
  .card,
  .hourly-row,
  .daily-row,
  .my-location-btn {
    background: rgba(0,0,0,0.5) !important;
  }
  
  .hourly-row.hourly-header,
  .daily-row.daily-header {
    background: rgba(0,0,0,0.3) !important;
  }

  html, body {
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body {
    font-size: 0.95rem;
  }

  .container {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0.5rem;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }

  /* Header compact on mobile */
  .header {
    margin-bottom: 0;
    text-align: left;
    padding-left: 4px;
  }

  .brand {
    justify-content: flex-start;
    margin-left: 0;
  }

  /* Show logo on mobile */
  #logoCircle {
    display: flex;
    width: 32px;
    height: 32px;
    margin-right: 0.5rem;
  }

  #logoCircle svg {
    width: 32px;
    height: 32px;
  }

  .brand-text {
    text-align: left;
    align-items: flex-start;
  }

  .brand-title {
    font-size: 1.4rem;
    word-break: break-word;
    text-align: left;
  }

  .brand-location {
    font-size: 0.9rem;
    word-break: break-word;
    text-align: left;
  }

  .tagline {
    font-size: 16px;
    text-align: left;
    margin-top: 0;
    margin-bottom: 4px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    letter-spacing: 0.01em;
    opacity: 1;
  }

  /* Two-column home layout */
  .home-layout {
    display: grid;
    grid-template-columns: 65% 35%;
    gap: 8px;
    align-items: start;
    min-height: calc(100vh - 140px);
    min-height: calc(100dvh - 140px);
    padding-bottom: 8px;
    position: relative;
  }

  /* Left column: hero text - left aligned, tight spacing */
  #home-screen {
    padding: 0.2rem 0 0 4px;
    min-height: auto;
    align-items: flex-start;
    text-align: left;
    gap: 0;
    max-width: 65%;
    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
    mix-blend-mode: normal !important;
  }

  #home-screen .confidence {
  display: none;
}

#home-screen .sources {
  display: none;
}

  /* MOBILE: "Probably 29°" - BIG and VIBRANT GOLD */
  .temp {
    font-size: 2.8rem;
    line-height: 1.1;
    margin: 0.15rem 0 0.1rem;
    text-align: left;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 
      0 0 20px rgba(255, 215, 0, 0.6),
      0 0 40px rgba(255, 215, 0, 0.4),
      3px 3px 6px rgba(0, 0, 0, 0.95);
  }

  /* MOBILE: High/Low - vibrant colors, strong contrast */
  .temp-hilo,
  #tempHiLo {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    text-align: left;
    font-weight: 700;
  }

  #tempHiLo .hi {
    color: #ff6b6b;
    text-shadow: 
      0 0 10px rgba(255, 107, 107, 0.6),
      3px 3px 6px rgba(0, 0, 0, 0.95);
  }

  #tempHiLo .lo {
    color: #5ddfff;
    margin-left: 0.5rem;
    text-shadow: 
      0 0 10px rgba(93, 223, 255, 0.6),
      3px 3px 6px rgba(0, 0, 0, 0.95);
  }

  /* MOBILE: Headline - vibrant with strong shadow */
  .headline {
    font-size: clamp(1.4rem, 5.5vw, 1.8rem);
    word-break: break-word;
    text-align: left;
    font-weight: 800;
    text-shadow: 
      0 0 15px currentColor,
      3px 3px 6px rgba(0, 0, 0, 0.95);
    line-height: 1.2;
    letter-spacing: 0.01em;
    margin-bottom: 4px;
    margin-top: 0;
  }

  .description {
    font-size: 18px;
    margin-bottom: 0;
    margin-top: 4px;
    text-align: left;
    font-weight: 600;
    color: #ff8c42;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.95);
    line-height: 1.5;
    letter-spacing: 0.01em;
  }

  /* Weather byline - readable on any background */
  .weather-byline {
    font-size: 14px;
    line-height: 1.5;
    margin-top: 0.5rem;
    text-align: left;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.02em;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.95);
    opacity: 1 !important;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .byline-row {
    font-size: 14px;
    opacity: 0.85;
  }

  /* Right column: two glass panels - docked lower-right */
  .sidebar {
    position: absolute;
    right: 12px;
    top: auto;
    bottom: calc(var(--nav-h, 72px) + env(safe-area-inset-bottom) + 20px);
    transform: none;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin: 0;
  }

  /* Glass panels - compact pills */
  .card {
    width: fit-content;
    max-width: 100%;
    min-width: 100px;
    text-align: right;
    padding: 8px 12px;
    margin-bottom: 0;
    border-radius: 14px;
    background: rgba(255,255,255,0.12);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  }

  .card .label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.8;
    margin-bottom: 2px;
  }

  .card .value {
    font-size: 0.9rem;
    font-weight: 600;
  }

  /* Sources card - lighter styling */
  .card-sources {
    background: rgba(255,255,255,0.08);
    padding: 6px 10px;
  }

  .card-sources .value {
    font-size: 0.6rem;
    font-weight: 400;
    line-height: 1.35;
  }

  /* Nav fixed at bottom */
  .nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    gap: 0.5rem;
    font-size: 0.75rem;
    z-index: 100;
    padding: 8px 4px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  /* Screen panels - FULL WIDTH on mobile */
  .search-screen,
  .settings-screen {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 75vh;
    overflow-y: auto;
    padding: 12px;
  }

  .screenPanel {
    left: 8px !important;
    right: 8px !important;
    max-height: 70vh;
    overflow-y: auto;
  }

  /* Hourly/Week - VERTICAL table layout */
  .hourly-timeline,
  .daily-cards {
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  /* Hourly row - mobile sizing */
  .hourly-row {
    grid-template-columns: 50px 35px 55px 45px 45px;
    gap: 4px;
    padding: 10px 4px;
  }

  .hourly-row.hourly-header {
    font-size: 0.6rem;
  }

  .hourly-row .h-temp {
    font-size: 1rem;
  }

  .hourly-row .h-rain,
  .hourly-row .h-wind {
    font-size: 0.75rem;
  }

  /* Daily row - mobile sizing */
  .daily-row {
    grid-template-columns: 1fr 35px 50px 50px 45px;
    gap: 4px;
    padding: 10px 4px;
  }

  .daily-row.daily-header {
    font-size: 0.6rem;
  }

  .daily-row .d-high {
    font-size: 1rem;
  }

  .daily-row .d-low,
  .daily-row .d-rain {
    font-size: 0.8rem;
  }

  .day-badge {
    font-size: 0.5rem;
    padding: 1px 4px;
  }

  .screen-panel-body {
    max-height: 60vh;
    overflow-y: auto;
  }

  .home-hero {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

/* ========== SHORT-HEIGHT MOBILE DEVICES ========== */
/* Only layout adjustments - text sizes inherit from main mobile query */
@media (max-width: 480px) and (max-height: 700px) {
  .sidebar {
    gap: 4px;
  }

  .card {
    padding: 5px 8px;
  }

  .card .label {
    font-size: 0.5rem;
  }

  .card .value {
    font-size: 0.75rem;
  }

  .card-sources .value {
    font-size: 0.55rem;
  }

  .temp {
    font-size: 2.4rem;
  }

  .temp-hilo,
  #tempHiLo {
    font-size: 1rem;
  }
}
