/* ==================================================
   SKYCAST — DYNAMIC WEATHER DASHBOARD
================================================== */

:root {
  --bg-one: #dceeff;
  --bg-two: #f8fbff;

  --text: #15213a;
  --muted: #718096;

  --primary: #3478d4;
  --primary-light: #76baf2;
  --primary-dark: #225da9;

  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.92);

  --border: rgba(255, 255, 255, 0.72);

  --shadow:
    0 18px 55px
    rgba(48, 87, 127, 0.14);

  --shadow-hover:
    0 28px 70px
    rgba(48, 87, 127, 0.22);

  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --container: 1180px;
}


/* ==================================================
   RESET
================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  overflow-x: hidden;

  font-family:
    "DM Sans",
    sans-serif;

  color: var(--text);

  background:
    linear-gradient(
      135deg,
      var(--bg-one),
      var(--bg-two)
    );

  line-height: 1.6;

  transition:
    background 0.8s ease,
    color 0.5s ease;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.container {
  width:
    min(
      var(--container),
      calc(100% - 40px)
    );

  margin-inline: auto;
}


/* ==================================================
   WEATHER THEMES
================================================== */

body.weather-clear {
  --bg-one: #d8efff;
  --bg-two: #fff3cf;

  --primary: #3687e0;
  --primary-light: #f6bb43;
}

body.weather-cloudy {
  --bg-one: #dce5ee;
  --bg-two: #f8fafc;

  --primary: #64798e;
  --primary-light: #9cb0c3;
}

body.weather-rain {
  --bg-one: #cbdce8;
  --bg-two: #e8f1f7;

  --primary: #396d9d;
  --primary-light: #6fa6cc;
}

body.weather-snow {
  --bg-one: #e8f7ff;
  --bg-two: #ffffff;

  --primary: #6ea5d6;
  --primary-light: #aad9f5;
}

body.weather-night {
  --bg-one: #10182f;
  --bg-two: #273a62;

  --text: #f4f8ff;
  --muted: #bdc9da;

  --surface:
    rgba(255, 255, 255, 0.1);

  --surface-strong:
    rgba(255, 255, 255, 0.14);

  --border:
    rgba(255, 255, 255, 0.15);
}


/* ==================================================
   BACKGROUND EFFECTS
================================================== */

.background-effects,
.weather-effects {
  position: fixed;

  inset: 0;

  pointer-events: none;
}

.background-effects {
  z-index: -3;

  overflow: hidden;
}

.weather-effects {
  z-index: -1;

  overflow: hidden;
}


/* Decorative Orbs */

.orb {
  position: absolute;

  border-radius: 50%;

  filter: blur(12px);
}

.orb-one {
  width: 560px;
  height: 560px;

  left: -220px;
  top: -190px;

  background:
    radial-gradient(
      circle,
      rgba(73, 153, 240, 0.3),
      transparent 68%
    );

  animation:
    orbOne
    14s ease-in-out
    infinite alternate;
}

.orb-two {
  width: 600px;
  height: 600px;

  right: -240px;
  top: 220px;

  background:
    radial-gradient(
      circle,
      rgba(121, 196, 255, 0.26),
      transparent 70%
    );

  animation:
    orbTwo
    17s ease-in-out
    infinite alternate;
}

@keyframes orbOne {

  to {
    transform:
      translate(110px, 100px)
      scale(1.18);
  }

}

@keyframes orbTwo {

  to {
    transform:
      translate(-110px, 70px)
      scale(1.12);
  }

}


/* Floating Clouds */

.floating-cloud {
  position: absolute;

  color:
    rgba(255, 255, 255, 0.22);

  font-size: 10rem;

  filter: blur(1px);

  user-select: none;
}

.cloud-one {
  top: 120px;
  right: 5%;

  animation:
    cloudMoveOne
    22s ease-in-out
    infinite alternate;
}

.cloud-two {
  top: 650px;
  left: 4%;

  font-size: 7rem;

  animation:
    cloudMoveTwo
    27s ease-in-out
    infinite alternate;
}

@keyframes cloudMoveOne {

  to {
    transform:
      translateX(-100px);
  }

}

@keyframes cloudMoveTwo {

  to {
    transform:
      translateX(120px);
  }

}


/* ==================================================
   DYNAMIC RAIN / SNOW / STARS
================================================== */

.rain-drop {
  position: absolute;

  top: -40px;

  width: 2px;
  height: 22px;

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.58);

  animation:
    rainFall linear infinite;
}

@keyframes rainFall {

  to {
    transform:
      translateY(110vh)
      translateX(-80px);
  }

}

.snowflake {
  position: absolute;

  top: -30px;

  color: white;

  opacity: 0.8;

  animation:
    snowFall linear infinite;
}

@keyframes snowFall {

  to {
    transform:
      translateY(110vh)
      translateX(80px)
      rotate(360deg);
  }

}

.star {
  position: absolute;

  width: 3px;
  height: 3px;

  border-radius: 50%;

  background: white;

  opacity: 0.7;

  box-shadow:
    0 0 7px
    rgba(255, 255, 255, 0.7);

  animation:
    twinkle
    2s ease-in-out
    infinite alternate;
}

@keyframes twinkle {

  from {
    opacity: 0.2;

    transform:
      scale(0.7);
  }

  to {
    opacity: 1;

    transform:
      scale(1.3);
  }

}


/* ==================================================
   HEADER
================================================== */

.site-header {
  position: sticky;

  top: 0;

  z-index: 1000;

  background:
    rgba(255, 255, 255, 0.36);

  backdrop-filter:
    blur(22px);

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.5);
}

.header-content {
  min-height: 78px;

  display: flex;

  align-items: center;

  justify-content:
    space-between;

  gap: 20px;
}


/* Logo */

.logo {
  display: flex;

  align-items: center;

  gap: 11px;

  font-family:
    "Manrope",
    sans-serif;

  font-size: 1.55rem;

  font-weight: 800;

  letter-spacing: -0.04em;
}

.logo > span:last-child > span {
  color: var(--primary);
}

.logo-icon {
  display: grid;

  width: 42px;
  height: 42px;

  place-items: center;

  border-radius: 14px;

  background:
    linear-gradient(
      135deg,
      var(--primary),
      var(--primary-light)
    );

  color: white;

  box-shadow:
    0 10px 24px
    rgba(52, 120, 212, 0.28);

  animation:
    logoFloat
    3.5s ease-in-out
    infinite;
}

@keyframes logoFloat {

  50% {
    transform:
      translateY(-4px);
  }

}


/* Header Buttons */

.header-actions {
  display: flex;

  align-items: center;

  gap: 9px;
}

.icon-button,
.unit-toggle {
  height: 46px;

  min-width: 46px;

  border:
    1px solid
    rgba(255, 255, 255, 0.72);

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.7);

  color: #1d4f87;

  font-weight: 700;

  box-shadow:
    0 8px 25px
    rgba(40, 80, 120, 0.1);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.unit-toggle {
  padding: 0 16px;
}

.icon-button {
  font-size: 1.3rem;
}

.icon-button:hover,
.unit-toggle:hover {
  transform:
    translateY(-3px)
    scale(1.04);

  box-shadow:
    var(--shadow);
}


/* ==================================================
   HERO
================================================== */

.hero {
  padding:
    85px 0 55px;
}

.hero-content {
  max-width: 850px;

  animation:
    fadeUp
    0.75s ease both;
}

@keyframes fadeUp {

  from {
    opacity: 0;

    transform:
      translateY(25px);
  }

  to {
    opacity: 1;

    transform:
      translateY(0);
  }

}

.eyebrow,
.section-label,
.card-label {
  display: inline-flex;

  align-items: center;

  gap: 9px;

  font-size: 0.75rem;

  font-weight: 800;

  letter-spacing: 0.17em;

  text-transform: uppercase;
}

.eyebrow,
.section-label {
  color: var(--primary-dark);
}

.eyebrow {
  margin-bottom: 0;
}

.live-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #2db879;

  box-shadow:
    0 0 0
    6px
    rgba(45, 184, 121, 0.12);

  animation:
    livePulse
    2s infinite;
}

@keyframes livePulse {

  50% {
    box-shadow:
      0 0 0
      12px
      rgba(45, 184, 121, 0);
  }

}


/* Main Heading */

.hero h1 {
  max-width: 900px;

  margin-top: 30px;

  font-family:
    "Manrope",
    sans-serif;

  font-size:
    clamp(
      3.3rem,
      7vw,
      6.5rem
    );

  line-height: 1.08;

  letter-spacing: -0.055em;
}

.hero h1 span {
  display: block;

  margin-top: 6px;

  background:
    linear-gradient(
      90deg,
      var(--primary),
      var(--primary-light),
      var(--primary)
    );

  background-size:
    200% auto;

  color: transparent;

  background-clip: text;

  -webkit-background-clip: text;

  animation:
    titleGradient
    6s linear
    infinite;
}

@keyframes titleGradient {

  to {
    background-position:
      200% center;
  }

}


/* Hero Description */

.hero-text {
  max-width: 650px;

  margin-top: 34px;

  color: var(--muted);

  font-size: 1.08rem;

  line-height: 1.85;
}


/* ==================================================
   SEARCH
================================================== */

.search-area {
  position: relative;

  display: flex;

  gap: 13px;

  margin-top: 42px;
}

.search-form {
  flex: 1;

  display: flex;

  align-items: center;

  padding: 7px;

  border:
    1px solid
    rgba(255, 255, 255, 0.76);

  border-radius: 20px;

  background:
    rgba(255, 255, 255, 0.72);

  backdrop-filter:
    blur(20px);

  box-shadow:
    var(--shadow);

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.search-form:focus-within {
  transform:
    translateY(-2px);

  box-shadow:
    var(--shadow-hover);
}

.search-icon {
  display: grid;

  width: 46px;

  flex-shrink: 0;

  place-items: center;

  color: #7b8ca0;

  font-size: 1.4rem;
}

.search-form input {
  flex: 1;

  min-width: 0;

  height: 50px;

  border: none;

  outline: none;

  background: transparent;

  color: #15213a;

  font-size: 1rem;
}

.search-form input::placeholder {
  color: #98a5b3;
}

.search-form button {
  height: 49px;

  padding: 0 26px;

  border: none;

  border-radius: 14px;

  background:
    linear-gradient(
      135deg,
      var(--primary),
      var(--primary-light)
    );

  color: white;

  font-weight: 700;

  box-shadow:
    0 10px 24px
    rgba(52, 120, 212, 0.25);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.search-form button:hover {
  transform:
    translateY(-2px);

  box-shadow:
    0 14px 30px
    rgba(52, 120, 212, 0.32);
}

.location-button {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 8px;

  min-height: 64px;

  padding: 0 22px;

  border:
    1px solid
    rgba(255, 255, 255, 0.74);

  border-radius: 19px;

  background:
    rgba(255, 255, 255, 0.65);

  backdrop-filter:
    blur(18px);

  color: var(--text);

  font-weight: 700;

  box-shadow:
    var(--shadow);

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.location-button:hover {
  transform:
    translateY(-3px);

  box-shadow:
    var(--shadow-hover);
}


/* ==================================================
   SEARCH SUGGESTIONS
================================================== */

.search-suggestions {
  display: none;

  width:
    min(
      760px,
      100%
    );

  margin-top: 9px;

  overflow: hidden;

  border:
    1px solid
    rgba(255, 255, 255, 0.8);

  border-radius: 17px;

  background:
    rgba(255, 255, 255, 0.95);

  box-shadow:
    var(--shadow);

  backdrop-filter:
    blur(20px);

  position: relative;

  z-index: 100;
}

.search-suggestions.show {
  display: block;
}

.suggestion-item {
  width: 100%;

  display: flex;

  justify-content:
    space-between;

  align-items: center;

  gap: 20px;

  padding: 15px 18px;

  border: none;

  border-bottom:
    1px solid #edf1f5;

  background: transparent;

  color: #15213a;

  text-align: left;
}

.suggestion-item:hover {
  background: #edf6ff;
}


/* ==================================================
   STATUS
================================================== */

.weather-status {
  display: none;

  margin-top: 15px;

  padding: 13px 16px;

  border-radius: 14px;

  font-weight: 600;
}

.weather-status.show {
  display: block;
}

.weather-status.loading {
  background:
    rgba(228, 241, 255, 0.9);

  color: #235d9d;
}

.weather-status.error {
  background:
    rgba(255, 231, 231, 0.9);

  color: #aa4343;
}


/* ==================================================
   DASHBOARD
================================================== */

.weather-dashboard {
  padding:
    25px 0 85px;
}

.dashboard-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.25fr)
    minmax(0, 0.9fr);

  gap: 22px;
}


/* ==================================================
   CURRENT WEATHER CARD
================================================== */

.current-weather-card {
  position: relative;

  overflow: hidden;

  min-height: 420px;

  padding: 34px;

  border-radius:
    var(--radius-lg);

  background:
    linear-gradient(
      145deg,
      rgba(39, 111, 201, 0.98),
      rgba(73, 147, 225, 0.94),
      rgba(113, 187, 241, 0.91)
    );

  color: white;

  box-shadow:
    0 30px 70px
    rgba(42, 103, 170, 0.27);

  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.weather-card-glow {
  position: absolute;

  width: 320px;
  height: 320px;

  right: -100px;
  top: -120px;

  border-radius: 50%;

  background:
    rgba(255, 255, 255, 0.12);
}

.current-card-header {
  position: relative;

  z-index: 2;

  display: flex;

  justify-content:
    space-between;

  gap: 20px;
}

.current-card-header h2 {
  margin-top: 8px;

  font-size: 2.2rem;
}

.current-card-header p {
  color:
    rgba(255, 255, 255, 0.75);
}

.last-updated {
  font-size: 0.75rem !important;
}


/* Favourite */

.favourite-button {
  width: 48px;
  height: 48px;

  border:
    1px solid
    rgba(255, 255, 255, 0.3);

  border-radius: 50%;

  background:
    rgba(255, 255, 255, 0.14);

  color: white;

  font-size: 1.55rem;
}

.favourite-button.active {
  background: white;

  color: #e9a827;
}


/* Current Weather */

.current-weather-main {
  position: relative;

  z-index: 2;

  display: flex;

  align-items: center;

  gap: 30px;

  margin-top: 50px;
}

.weather-icon-box {
  display: grid;

  width: 125px;
  height: 125px;

  place-items: center;

  border-radius: 30px;

  background:
    rgba(255, 255, 255, 0.12);
}

.weather-icon {
  font-size: 4.7rem;

  animation:
    weatherFloat
    4s ease-in-out
    infinite;
}

@keyframes weatherFloat {

  50% {
    transform:
      translateY(-10px);
  }

}

.temperature {
  display: flex;

  font-size:
    clamp(
      4.5rem,
      9vw,
      7.5rem
    );

  font-weight: 700;

  line-height: 0.9;
}

.temperature sup {
  margin-top: 9px;

  font-size: 1.7rem;
}

.weather-description {
  margin-top: 15px;

  font-size: 1.12rem;

  font-weight: 700;
}

.feels-like {
  color:
    rgba(255, 255, 255, 0.72);
}

.temperature-range {
  display: flex;

  gap: 30px;

  margin-top: 36px;

  padding-top: 22px;

  border-top:
    1px solid
    rgba(255, 255, 255, 0.19);
}


/* ==================================================
   DETAIL CARDS
================================================== */

.weather-details-grid {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 14px;
}

.detail-card {
  display: flex;

  align-items: center;

  gap: 16px;

  min-height: 125px;

  padding: 22px;

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-md);

  background:
    var(--surface);

  backdrop-filter:
    blur(20px);

  box-shadow:
    var(--shadow);

  transition:
    0.3s ease;
}

.detail-card:hover {
  transform:
    translateY(-6px);
}

.detail-icon {
  display: grid;

  width: 50px;
  height: 50px;

  place-items: center;

  border-radius: 15px;

  background:
    rgba(63, 135, 215, 0.12);

  font-size: 1.5rem;
}

.detail-card span {
  color: var(--muted);

  font-size: 0.82rem;
}

.detail-card strong {
  display: block;

  margin-top: 4px;
}


/* ==================================================
   SECTIONS
================================================== */

.hourly-section,
.forecast-section,
.saved-section {
  margin-top: 60px;
}

.section-heading {
  display: flex;

  justify-content:
    space-between;

  align-items: flex-end;

  gap: 20px;

  margin-bottom: 24px;
}

.section-heading h2 {
  margin-top: 5px;

  font-size: 2.1rem;
}

.section-heading p {
  color: var(--muted);
}


/* ==================================================
   HOURLY
================================================== */

.hourly-forecast {
  display: grid;

  grid-auto-flow: column;

  grid-auto-columns:
    minmax(130px, 1fr);

  gap: 14px;

  overflow-x: auto;

  padding-bottom: 18px;
}

.hour-card {
  padding: 21px;

  border-radius:
    var(--radius-md);

  background:
    var(--surface);

  box-shadow:
    var(--shadow);

  text-align: center;

  transition:
    0.3s ease;
}

.hour-card:hover {
  transform:
    translateY(-7px);
}

.hour-card.current-hour {
  border:
    2px solid
    var(--primary);
}

.hour-icon {
  margin:
    15px 0;

  font-size: 2.3rem;
}


/* ==================================================
   FORECAST
================================================== */

.forecast-grid {
  display: grid;

  grid-template-columns:
    repeat(5, 1fr);

  gap: 15px;
}

.forecast-card {
  padding: 24px;

  border-radius:
    var(--radius-md);

  background:
    var(--surface);

  box-shadow:
    var(--shadow);

  text-align: center;

  transition:
    0.3s ease;
}

.forecast-card:hover {
  transform:
    translateY(-8px);
}

.forecast-icon {
  margin:
    22px 0 18px;

  font-size: 3rem;
}

.forecast-card strong {
  display: block;

  font-size: 1.7rem;
}


/* ==================================================
   SAVED LOCATIONS
================================================== */

.saved-locations {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 15px;
}

.saved-location-card {
  position: relative;

  padding: 22px;

  border-radius:
    var(--radius-md);

  background:
    var(--surface);

  box-shadow:
    var(--shadow);

  cursor: pointer;
}

.remove-favourite {
  position: absolute;

  right: 12px;
  top: 12px;

  width: 34px;
  height: 34px;

  border: none;

  border-radius: 50%;
}

.empty-favourites {
  grid-column:
    1 / -1;

  padding: 40px;

  border:
    1px dashed
    rgba(100, 135, 170, 0.42);

  border-radius:
    var(--radius-md);

  text-align: center;
}


/* ==================================================
   FOOTER
================================================== */

.footer {
  border-top:
    1px solid
    rgba(190, 210, 228, 0.55);

  background:
    rgba(255, 255, 255, 0.4);
}

.footer-content {
  min-height: 115px;

  display: grid;

  grid-template-columns:
    1fr auto auto;

  align-items: center;

  gap: 25px;
}

.footer-content p {
  color: var(--muted);

  font-size: 0.83rem;
}


/* ==================================================
   ACCESSIBILITY
================================================== */

.sr-only {
  position: absolute;

  width: 1px;
  height: 1px;

  overflow: hidden;

  clip:
    rect(
      0,
      0,
      0,
      0
    );
}


/* ==================================================
   TABLET
================================================== */

@media
(max-width: 950px) {

  .dashboard-grid {
    grid-template-columns:
      1fr;
  }

  .weather-details-grid {
    grid-template-columns:
      repeat(3, 1fr);
  }

  .forecast-grid {
    grid-template-columns:
      repeat(3, 1fr);
  }

  .saved-locations {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns:
      1fr;

    padding:
      28px 0;
  }

}


/* ==================================================
   MOBILE
================================================== */

@media
(max-width: 700px) {

  .container {
    width:
      calc(100% - 28px);
  }

  .hero {
    padding:
      55px 0 40px;
  }

  .hero h1 {
    margin-top: 24px;

    font-size:
      clamp(
        2.8rem,
        13vw,
        4.5rem
      );

    line-height: 1.1;
  }

  .hero-text {
    margin-top: 26px;
  }

  .search-area {
    margin-top: 34px;

    flex-direction:
      column;
  }

  .location-button {
    width: 100%;
  }

  .current-weather-main {
    gap: 20px;
  }

  .weather-details-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .forecast-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .saved-locations {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .section-heading {
    align-items:
      flex-start;

    flex-direction:
      column;
  }

}


/* ==================================================
   SMALL MOBILE
================================================== */

@media
(max-width: 480px) {

  .logo {
    font-size: 1.3rem;
  }

  .search-icon {
    display: none;
  }

  .search-form input {
    padding-left: 10px;

    font-size: 16px;
  }

  .current-weather-main {
    flex-direction:
      column;

    align-items:
      flex-start;
  }

  .temperature-range {
    flex-direction:
      column;
  }

  .weather-details-grid,
  .forecast-grid,
  .saved-locations {
    grid-template-columns:
      1fr;
  }

}


/* ==================================================
   REDUCED MOTION
================================================== */

@media
(prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration:
      0.01ms !important;

    animation-iteration-count:
      1 !important;
  }

}
