:root {
  --bg: #0a1020;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --text: #f8fafc;
  --muted: #a8b3c7;
  --accent: #38bdf8;
  --warm: #fbbf24;
  --good: #34d399;
  --danger: #fb7185;
  --border: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 15%, rgba(56, 189, 248, 0.28), transparent 26rem),
    radial-gradient(circle at 85% 12%, rgba(251, 191, 36, 0.24), transparent 24rem),
    linear-gradient(145deg, #0a1020, #111827 52%, #13251f);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.dashboard {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 0;
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 26px;
  align-items: stretch;
}

.search-panel,
.weather-panel {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.search-panel {
  position: relative;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
}

.search-panel::after {
  content: "";
  width: 220px;
  height: 220px;
  position: absolute;
  left: -80px;
  bottom: -80px;
  border-radius: 999px;
  background: conic-gradient(from 90deg, var(--accent), var(--good), var(--warm), var(--accent));
  filter: blur(28px);
  opacity: 0.22;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 999px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 4vw, 3.12rem);
  line-height: 0.96;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.intro {
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.02rem;
}

.search-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

label {
  color: #e2e8f0;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

input {
  min-width: 0;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  outline: none;
  background: rgba(2, 6, 23, 0.7);
  color: var(--text);
  font-size: 1rem;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

button {
  min-height: 52px;
  padding: 0 20px;
  border: none;
  border-radius: 15px;
  color: #06111a;
  background: linear-gradient(135deg, var(--accent), var(--good));
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(56, 189, 248, 0.2);
  transition: transform 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.status-message {
  position: relative;
  z-index: 1;
  min-height: 28px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.status-message.is-error {
  color: var(--danger);
}

.status-message.is-loading {
  color: #7dd3fc;
}

.weather-panel {
  min-height: 620px;
  padding: 30px;
}

.empty-state {
  min-height: 236px;
  margin-top: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.empty-icon {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 4rem;
}

.weather-panel:not(.is-empty) .empty-state {
  display: none;
}

.weather-content {
  display: grid;
  gap: 22px;
}

.globe-section {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.14), transparent 18rem),
    linear-gradient(135deg, rgba(2, 6, 23, 0.88), rgba(15, 23, 42, 0.92));
}

#earthCanvas {
  display: block;
  width: 100%;
  height: 260px;
}

.globe-label {
  position: absolute;
  right: 18px;
  bottom: 18px;
  max-width: min(260px, calc(100% - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
}

.globe-label span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.globe-label strong {
  display: block;
  margin-top: 4px;
  color: #e0f2fe;
  font-size: 1rem;
}

.current-weather {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(251, 191, 36, 0.08)),
    var(--panel-strong);
}

.location-name {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
}

.condition-text {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 800;
}

.temperature-wrap {
  text-align: right;
}

.weather-icon {
  display: block;
  font-size: 3.2rem;
}

.current-temp {
  display: block;
  font-size: clamp(3.2rem, 8vw, 5.5rem);
  line-height: 0.9;
}

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

.detail-grid div,
.forecast-card {
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(2, 6, 23, 0.48);
}

.detail-grid div {
  padding: 17px;
}

.detail-grid span,
.forecast-range,
.section-heading span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--warm);
  font-size: 1.25rem;
}

.forecast-section {
  margin-top: 4px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.forecast-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.forecast-card {
  min-height: 170px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.forecast-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-3px);
}

.forecast-day {
  margin: 0;
  font-weight: 900;
}

.forecast-icon {
  font-size: 2.2rem;
}

.forecast-temp {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 900;
}

.forecast-condition {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
    padding: 28px 0;
  }

  .search-panel {
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .search-row,
  .detail-grid,
  .forecast-list {
    grid-template-columns: 1fr;
  }

  .current-weather,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .temperature-wrap {
    text-align: left;
  }

  #earthCanvas {
    height: 220px;
  }
}
