
  


:root {

  /* ── Background colours ── */
  --c-bg:          #dad7cd;       /* page background (soft lavender-grey)         */
  --c-surface:     #dad7cd;       /* card / panel background                       */
  --c-surface-alt: #dad7cd;       /* slightly tinted surface (stat cells, etc.)    */
  --c-sidebar-bg:  #a3b18a;       /* sidebar background (deep navy-purple)         */

  /* ── Text colours ── */
  --c-text:        #344e41;       /* primary text — near-black                     */
  --c-muted:       #588157;       /* secondary / label text                        */
  --c-on-dark:     #588157;       /* text on the dark sidebar                      */
  --c-on-dark-dim: #588157;       /* muted text on the dark sidebar                */

  /* ── Accent colours ──
     The accent is used for: focus rings, active states, chart lines,
     the visibility bar, and hover highlights.
     Change this one value to shift the whole app's accent colour. */
  --c-accent:      #3a5a40;       /* violet-purple                                 */
  --c-accent-light:#dad7cd;       /* tint of accent for backgrounds                */
  --c-accent-glow: rgba(234, 240, 225, 0.18); /* glow / shadow using accent colour  */

  /* ── Border & divider ── */
  --c-border:      rgba(22, 20, 31, 0.08);   /* light-mode border                  */

  /* ── Chart colours ──
     Used in Chart.js datasets. Change these to restyle the charts. */
  --c-chart-temp:     #7c6af7;    /* temperature line                              */
  --c-chart-rain:     #60a5fa;    /* precipitation bars                            */
  --c-chart-humidity: #34d399;    /* humidity line                                 */

  /* ── Status / semantic colours ── */
  --c-good:        #22c55e;       /* good AQI, positive states                     */
  --c-warn:        #f59e0b;       /* warning states                                */
  --c-danger:      #ef4444;       /* danger / error states                         */

  /* ── Typography ── */
  --f-body:   'Outfit', sans-serif;
  --f-mono:   'DM Mono', monospace;

  /* ── Radii ──
     Increase these for a rounder look, decrease for sharper. */
  --r-sm:   4px;
  --r-md:   7px;
  --r-lg:   10px;
  --r-xl:   10px;

  /* ── Transitions ── */
  --t-fast:   0.15s ease;
  --t-normal: 0.25s ease;
  --t-slow:   0.4s ease;

  /* ── Shadows ── */
  --shadow-card:  0 2px 16px rgba(22, 20, 31, 0.07);
  --shadow-hover: 0 4px 24px rgba(22, 20, 31, 0.12);
}


[data-theme="dark"] {
  --c-bg:          #0e0d18;
  --c-surface:     #161424;
  --c-surface-alt: #1e1c30;
  --c-sidebar-bg:  #0a0914;
  --c-text:        #e8e5f5;
  --c-muted:       #5a5675;
  --c-border:      rgba(232, 229, 245, 0.07);
  --c-accent-light:#2d2556;
  --shadow-card:   0 2px 16px rgba(0, 0, 0, 0.35);
  --shadow-hover:  0 4px 24px rgba(0, 0, 0, 0.5);
}


/* ================================================================
  3. RESET & BASE STYLES
================================================================ */

/* Remove all default browser margin / padding / box-sizing weirdness */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  /* Prevents iOS from auto-zooming on input focus */
  -webkit-text-size-adjust: 100%;
  /* Smooth scrolling for anchor links */
  scroll-behavior: smooth;
}

body {
  font-family: var(--f-body);
  font-weight: 300;
  background-color: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  /* Smooth colour transitions when switching dark/light mode */
  transition: background-color var(--t-normal), color var(--t-normal);
  line-height: 1.5;
}

/* Remove default button styles — we apply our own */
button {
  font-family: var(--f-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* Remove default input styles */
input {
  font-family: var(--f-body);
  border: none;
  outline: none;
}

/* Prevent images from overflowing their containers */
img { max-width: 100%; }


.page {
  display: grid;
  /* Sidebar is fixed at 260px; main content takes the rest */
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--c-sidebar-bg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  /* Stick sidebar to top when user scrolls */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  /* Hide the scrollbar but keep it scrollable */
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* ── Main content ── */
.main-content {
  padding: 40px 32px 80px;
  /* Limit how wide the content can get on very large screens */
  max-width: 900px;
}

/* Inner content wrapper — cards stack vertically with consistent gap */
#content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-card);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  color: var(--c-text);
}

.theme-toggle:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-hover);
}

.theme-toggle:active {
  transform: scale(0.95);
}


.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* The small coloured circle before the app name */
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-accent);
  /* Soft glow using the accent colour */
  box-shadow: 0 0 12px var(--c-accent);
  flex-shrink: 0;
}

.brand-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--c-on-dark);
}


.search-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Row containing the text input and the Search button */
.search-row {
  display: flex;
  gap: 8px;
}

/* ── City search input ── */
.search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 300;
  color: var(--c-on-dark);
  transition: border-color var(--t-fast), background var(--t-fast);
}

.search-input:focus {
  border-color: var(--c-accent);
  background: rgba(124, 106, 247, 0.1);
}

.search-input::placeholder {
  color: var(--c-on-dark-dim);
}

/* ── Shared button base style ── */
.btn {
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 400;
  padding: 12px 16px;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

/* Search button — accent background */
.btn-search {
  background: var(--c-accent);
  color: #fff;
  flex-shrink: 0;
}

.btn-search:hover {
  /* Slightly darken on hover — we use a semi-transparent overlay trick */
  background: color-mix(in srgb, var(--c-accent) 85%, #000);
}

/* Location button — subtle ghost style */
.btn-location {
  width: 100%;
  text-align: left;
  color: var(--c-on-dark-dim);
  padding: 10px 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-location:hover { color: var(--c-on-dark); }

.btn-icon {
  font-size: 16px;
  flex-shrink: 0;
}


.recent-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-on-dark-dim);
  padding-left: 2px;
}

/* Each recent city chip */
.recent-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  font-size: 13px;
  color: var(--c-on-dark-dim);
  text-align: left;
  width: 100%;
  transition: background var(--t-fast), color var(--t-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recent-chip:hover {
  background: rgba(124, 106, 247, 0.15);
  color: var(--c-on-dark);
}

/* Small arrow shown on hover for each recent chip */
.recent-chip::after {
  content: '→';
  opacity: 0;
  transition: opacity var(--t-fast);
  font-size: 11px;
}

.recent-chip:hover::after { opacity: 1; }


.unit-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto; /* pushes it to the bottom of the sidebar */
}

.unit-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-on-dark-dim);
  padding-left: 2px;
}

.unit-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 4px;
}

/* Individual °C / °F buttons */
.unit-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: calc(var(--r-md) - 4px);
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-on-dark-dim);
  transition: background var(--t-fast), color var(--t-fast);
  text-align: center;
}

/* Active / selected unit button */
.unit-btn.active {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--c-accent-glow);
}

.unit-btn:not(.active):hover {
  color: var(--c-on-dark);
}


.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: background var(--t-normal), border-color var(--t-normal);
}



/* Padded inner section (city name + big temp) */
.current-body {
  padding: 28px 28px 20px;
}

/* Top row: city info on the left, nothing on the right */
.current-top {
  margin-bottom: 24px;
}

.city-name {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  /* Long city names will truncate with … instead of wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Small country code + last-updated timestamp */
.city-meta {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 4px;
}

/* Row containing the giant temperature and the weather emoji */
.temp-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

/* The big number itself — uses the monospace font for precision */
.temp-number {
  font-family: var(--f-mono);
  font-size: 80px;        /* ← change this to make the temperature bigger/smaller */
  font-weight: 300;
  line-height: 1;
  letter-spacing: -3px;
}

/* Weather condition emoji (or symbol if you use the minimal style) */
.weather-emoji {
  font-size: 48px;
  line-height: 1;
  margin-top: 10px;
}

/* Short text description e.g. "scattered clouds" */
.weather-desc {
  font-size: 14px;
  color: var(--c-muted);
  text-transform: capitalize;
  margin-bottom: 16px;
}

/* High / low temperature strip */
.high-low {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-muted);
  display: flex;
  gap: 14px;
}

/* The ↑ high value is slightly brighter than the ↓ low */
.high-low .high { color: var(--c-text); }


.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--c-border);
}

/* Individual data cell */
.stat-cell {
  padding: 18px 22px;
  background: var(--c-surface-alt);
  border-right: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  transition: background var(--t-normal);
}

/* Remove right border from even cells (right column) */
.stat-cell:nth-child(2n) {
  border-right: none;
}

/* Remove bottom border from the last two cells */
.stat-cell:nth-last-child(-n+2) {
  border-bottom: none;
}

/* Uppercase label above the value */
.stat-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 6px;
}

/* The actual stat value (temperature, percentage, etc.) */
.stat-value {
  font-family: var(--f-mono);
  font-size: 22px;
  font-weight: 300;
}

/* Optional sub-text beneath the value e.g. wind direction "NW" */
.stat-sub {
  font-size: 11px;
  color: var(--c-muted);
  margin-top: 3px;
}

/* Visibility progress bar
   A thin horizontal bar showing visibility as a fraction of 10 km */
.vis-bar {
  height: 3px;
  background: var(--c-border);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.vis-fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: 3px;
  /* Animate the bar width when it first appears */
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Full-width stat cell — spans both columns */
.stat-full {
  grid-column: 1 / -1;
  border-right: none !important;
}


.sun-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--c-border);
}

.sun-cell {
  padding: 16px 22px;
}

.sun-cell:first-child {
  border-right: 1px solid var(--c-border);
}

.sun-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 5px;
}

.sun-time {
  font-family: var(--f-mono);
  font-size: 20px;
  font-weight: 300;
}


.aqi-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 400;
  padding: 3px 9px;
  border-radius: 99px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.02em;
  /* Prevent it from shrinking on narrow screens */
  flex-shrink: 0;
}


.section-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-muted);
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--c-border);
}



/* Outer scroll container — hides scrollbar visually */
.hourly-strip {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hourly-strip::-webkit-scrollbar { display: none; }

/* Individual 3-hour block */
.hour-block {
  flex: 0 0 80px;   /* ← change 80px to make blocks wider/narrower */
  padding: 16px 0;
  text-align: center;
  border-right: 1px solid var(--c-border);
  transition: background var(--t-fast);
}

.hour-block:last-child { border-right: none; }

.hour-block:hover {
  background: var(--c-surface-alt);
}

.hour-time {
  font-size: 11px;
  color: var(--c-muted);
  margin-bottom: 8px;
}

.hour-icon {
  font-size: 20px;
  margin-bottom: 8px;
  /* Prevent emoji from being cut off */
  line-height: 1.2;
}

.hour-temp {
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 300;
}

/* Rain probability shown in the chart accent colour */
.hour-rain {
  font-size: 10px;
  color: var(--c-chart-rain);
  margin-top: 4px;
}



/* Each day is a horizontal flex row */
.day-row {
  display: flex;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--c-border);
  gap: 14px;
  transition: background var(--t-fast);
}

.day-row:last-child { border-bottom: none; }
.day-row:hover { background: var(--c-surface-alt); }

/* Fixed-width day name keeps columns aligned */
.day-name {
  font-size: 13px;
  font-weight: 400;
  width: 38px;
  flex-shrink: 0;
}

.day-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* Description takes all remaining space */
.day-desc {
  flex: 1;
  font-size: 12px;
  color: var(--c-muted);
  text-transform: capitalize;
  /* Truncate if description is very long */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* High and low temps aligned to the right */
.day-temps {
  font-family: var(--f-mono);
  font-size: 13px;
  text-align: right;
  flex-shrink: 0;
}

.day-high { color: var(--c-text); }
.day-low  { color: var(--c-muted); font-size: 12px; }


.chart-card {
  padding: 22px;
}

/* Canvas container — gives the chart a fixed height */
.chart-wrap {
  position: relative;
  height: 180px;   /* ← change this to make the charts taller/shorter */
  margin-top: 14px;
}

/* Chart title row — label on the left, optional legend on the right */
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* Small coloured dot + label legend items */
.chart-legend {
  display: flex;
  gap: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--c-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}


.state-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 64px 32px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.state-icon {
  font-size: 32px;
  color: var(--c-muted);
  margin-bottom: 14px;
  opacity: 0.5;
}

.state-text {
  font-size: 14px;
  color: var(--c-muted);
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Pulsing animation shown while data is loading */
.loading-pulse {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}


@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Applied to every weather card by JS after data loads */
.animate-in {
  animation: fadeSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger: each subsequent card delays by 70ms */
.animate-in:nth-child(1) { animation-delay: 0.00s; }
.animate-in:nth-child(2) { animation-delay: 0.07s; }
.animate-in:nth-child(3) { animation-delay: 0.14s; }
.animate-in:nth-child(4) { animation-delay: 0.21s; }
.animate-in:nth-child(5) { animation-delay: 0.28s; }
.animate-in:nth-child(6) { animation-delay: 0.35s; }



/* Tablet and below */
@media (max-width: 900px) {
  .main-content {
    padding: 28px 20px 60px;
  }
}

/* Mobile */
@media (max-width: 768px) {

  /* Stack sidebar on top of main content */
  .page {
    grid-template-columns: 1fr;
  }

  /* Sidebar becomes a horizontal strip at the top */
  .sidebar {
    position: static;
    height: auto;
    padding: 24px 20px;
    flex-direction: column;
    gap: 16px;
  }

  /* Push unit toggle back inline instead of to the bottom */
  .unit-section {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .main-content {
    padding: 20px 16px 60px;
  }

  /* Smaller temperature on very small screens */
  .temp-number { font-size: 60px; }

  /* Tighter card padding */
  .current-body { padding: 20px 20px 16px; }
  .stat-cell    { padding: 14px 16px; }

  /* Theme toggle repositioned for mobile */
  .theme-toggle {
    top: 14px;
    right: 14px;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .temp-number { font-size: 50px; }
  .weather-emoji { font-size: 36px; }
}