:root {
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-dark: #0f172a;
  --text: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --radius: 1.25rem;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --font: "Outfit", system-ui, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  padding: clamp(1rem, 3vw, 2rem);
  background: linear-gradient(145deg, #1e3a5f 0%, #0f172a 45%, #312e81 100%);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  transition: background-image 0.4s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.app-status {
  max-width: 72rem;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.95);
  color: #422006;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
}

.wrapper {
  display: flex;
  flex-direction: column;
  max-width: 72rem;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

@media (min-width: 960px) {
  .wrapper {
    flex-direction: row;
    align-items: stretch;
    min-height: min(640px, 85vh);
  }
}

.sidebar {
  flex: 0 0 auto;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .sidebar {
    width: 34%;
    max-width: 22rem;
    min-width: 16rem;
  }
}

.sidebar-inner {
  flex: 1;
}

.search {
  display: flex;
  align-items: stretch;
  margin-bottom: 1.25rem;
  position: relative;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  border: 1px solid #e2e8f0;
  border-right: none;
  border-radius: 0.65rem 0 0 0.65rem;
  padding: 0 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search button {
  width: 2.75rem;
  border: none;
  border-radius: 0 0.65rem 0.65rem 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: filter 0.2s;
}

.search button:hover {
  filter: brightness(1.05);
}

.search ul {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  border-radius: 0.65rem;
  box-shadow: var(--shadow);
  background: #fff;
  z-index: 20;
  border: 1px solid #e2e8f0;
}

.search ul li {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  text-transform: capitalize;
  font-size: 0.9rem;
}

.search ul li:last-child {
  border-bottom: none;
}

.search ul li:hover,
.search ul li.active {
  background: #f8fafc;
}

.weather-icon {
  text-align: center;
  margin: 0.5rem 0 1rem;
}

.weather-icon #icon {
  width: min(70%, 9rem);
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(15, 23, 42, 0.15));
}

.temperature {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
}

.temperature #temp {
  font-size: clamp(3rem, 8vw, 4.25rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.04em;
}

.temperature .temp-unit {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.35rem;
}

.date-time {
  margin-top: 0.5rem;
}

.date-time p {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.divider {
  height: 1px;
  background: #e2e8f0;
  margin: 1.25rem 0;
}

.condition-rain {
  font-size: 0.85rem;
  text-transform: capitalize;
  color: var(--muted);
}

.condition-rain > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.condition-rain i {
  font-size: 1.1rem;
  color: var(--accent);
}

.location {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
}

.location-icon i {
  font-size: 1.25rem;
  color: var(--accent);
  margin-top: 0.1rem;
}

.main {
  flex: 1;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: #f1f5f9;
  position: relative;
  padding-bottom: 5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toolbar .options {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  list-style: none;
}

.toolbar .options button {
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.toolbar .options button:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.06);
}

.toolbar .options button.active {
  color: #fff;
  background: var(--accent);
}

.toolbar .units button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  padding: 0;
  color: var(--text);
  background: #fff;
  border: 1px solid #e2e8f0;
}

.toolbar .units button.active {
  color: #fff;
  background: var(--surface-dark);
  border-color: var(--surface-dark);
}

.forecast-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-start;
}

.forecast-cards .card {
  min-width: 5.5rem;
  flex: 1 1 auto;
  max-width: 7rem;
  border-radius: 1rem;
  background: var(--card);
  text-align: center;
  padding: 0.85rem 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.forecast-cards .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.card h2 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.card .card-icon {
  width: 45%;
  margin: 0 auto;
}

.card .day-temp {
  font-size: 0.8rem;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.15rem;
  font-weight: 600;
}

.highlights {
  margin-top: 2rem;
}

.highlights .heading {
  width: 100%;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: capitalize;
  letter-spacing: -0.02em;
}

.highlight-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.85rem;
}

.card2 {
  border-radius: 1rem;
  background: var(--card);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  min-height: 8.5rem;
}

.card2 .card-heading {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card2 .content {
  margin-top: auto;
  padding-top: 0.5rem;
}

.card2 .content > p:first-child:not(.label) {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card2 .content > p:nth-child(2) {
  font-size: 0.8rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-weight: 500;
}

.content-split {
  text-align: left;
}

.content-split p {
  font-size: 0.9rem !important;
  margin-top: 0.35rem !important;
  text-align: left !important;
}

.content-split .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-right: 0.25rem;
}

.credits {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2.5rem);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.credits strong {
  color: var(--text);
  font-weight: 700;
}
