:root {
  --bg-page: #cfe4fb;
  --blue-1: #6fa8f0;
  --blue-2: #4a86e0;
  --white: #ffffff;
  --panel-bg: #eaf2fd;
  --text-primary: #1b2430;
  --text-secondary: #7d8aa0;
  --text-muted: #a4aec1;
  --border: #e7edf7;
  --accent: #4a86e0;
  --icon-blue-bg: #4a86e0;
  --icon-amber-bg: #f2a93c;
  --icon-coral-bg: #ef7a5c;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 20px 45px -20px rgba(30, 60, 110, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-page);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 900px 500px at 12% -5%, #e4f0fd 0%, transparent 60%),
    radial-gradient(ellipse 900px 600px at 100% 0%, #dcebfb 0%, transparent 55%),
    linear-gradient(180deg, #d7e9fc 0%, #cfe4fb 45%, #bcd8f7 100%);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 56px 20px;
  position: relative;
  overflow-x: hidden;
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: #a9cdf7;
  top: -140px;
  left: -120px;
}

.blob-2 {
  width: 360px;
  height: 360px;
  background: #ffe3ad;
  top: -80px;
  right: -100px;
  opacity: 0.35;
}

.blob-3 {
  width: 480px;
  height: 480px;
  background: #ffffff;
  bottom: -220px;
  left: 40%;
  opacity: 0.4;
}

.app {
  width: 100%;
  max-width: 1080px;
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */

.app-header {
  text-align: center;
  margin-bottom: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--blue-1), var(--blue-2));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px -8px rgba(74, 134, 224, 0.6);
}
.quick-cities {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.quick-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.55);
  color: #2c4a75;
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.15s ease;
}

.chip:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.brand-icon svg {
  width: 16px;
  height: 16px;
}
.brand-trust {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: linear-gradient(135deg, #2f6fd6, #6fa8f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-tagline {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* ---------- Search ---------- */

.search-wrap {
  position: relative;
  margin: 0 auto 22px;
  max-width: 460px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: 999px;
  padding: 14px 18px;
  box-shadow: 0 16px 40px -16px rgba(30, 60, 110, 0.35), 0 2px 6px rgba(30, 60, 110, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: box-shadow 0.2s ease;
}

.search-box:focus-within {
  box-shadow: 0 16px 40px -16px rgba(30, 60, 110, 0.35), 0 0 0 3px rgba(74, 134, 224, 0.18);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#city-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
}

#city-input::placeholder {
  color: var(--text-muted);
}

.location-btn {
  border: none;
  background: var(--panel-bg);
  color: var(--accent);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.location-btn svg {
  width: 16px;
  height: 16px;
}

.location-btn:hover {
  background: #dbe8fb;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 40px -16px rgba(30, 60, 110, 0.35);
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 20;
}

.suggestions li {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggestions li:hover,
.suggestions li.active {
  background: var(--panel-bg);
}

.suggestions .s-name {
  font-weight: 500;
  color: var(--text-primary);
}

.suggestions .s-region {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- State boxes ---------- */

.state-box {
  text-align: center;
  padding: 64px 24px;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.state-box.error {
  color: #b3382a;
  background: #fdecea;
}

.empty-illustration {
  margin-bottom: 18px;
}

.empty-svg {
  width: 96px;
  height: 72px;
}

.empty-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Dashboard layout ---------- */

.dashboard {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.6);
  overflow: hidden;
  max-width: 100%;
}

@media (max-width: 760px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

/* ---------- Left panel ---------- */

.panel-left {
  background: linear-gradient(160deg, var(--blue-1), var(--blue-2));
  color: var(--white);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  min-height: 560px;
  overflow: hidden;
}

.panel-top {
  position: relative;
  z-index: 2;
}

.location-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}

.pin-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.date-label {
  margin: 4px 0 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.sun-times {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.sun-times span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sun-times svg {
  width: 15px;
  height: 15px;
}

.temp-block {
  position: relative;
  z-index: 2;
  margin: 18px 0;
}

.temp-main {
  font-size: 76px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
}

.temp-main .deg {
  font-size: 40px;
  font-weight: 400;
  vertical-align: top;
}

.condition-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.95);
}

.weather-icon {
  font-size: 20px;
}

.condition-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.condition-tags .tag-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

.skyline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: 160px;
}

.skyline svg {
  width: 100%;
  height: 100%;
}

/* ---------- Right panel ---------- */

.panel-right {
  padding: 32px;
  background: var(--white);
  min-width: 0;
}

.hourly-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 20px 8px;
}

.hourly-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hourly-head h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.hourly-range {
  font-size: 12px;
  color: var(--text-secondary);
}

.hourly-scroll {
  width: 100%;
  overflow-x: auto;
}

#hourly-chart {
  width: 100%;
  min-width: 640px;
  height: 200px;
  display: block;
}

.details-title {
  font-size: 15px;
  font-weight: 600;
  margin: 26px 0 14px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
}

.detail-card {
  background: var(--panel-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.detail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -14px rgba(30, 60, 110, 0.3);
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.detail-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}

.detail-icon svg {
  width: 14px;
  height: 14px;
}

.icon-blue { background: var(--icon-blue-bg); }
.icon-amber { background: var(--icon-amber-bg); }
.icon-coral { background: var(--icon-coral-bg); }

.detail-value {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 2px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 6px;
}

.detail-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.scale-bar {
  height: 6px;
  border-radius: 4px;
  background: #dbe4f2;
  margin-top: 10px;
  overflow: hidden;
}

.scale-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}

.scale-bar.segmented {
  display: flex;
  gap: 3px;
  background: none;
  overflow: visible;
}

.scale-bar.segmented span {
  flex: 1;
  width: 100%;
  background: #dbe4f2;
  border-radius: 3px;
}

.scale-bar.segmented span.filled {
  background: var(--icon-amber-bg);
}