@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', 'Poppins', sans-serif;
  min-height: 100vh;
  color: white;
  background: linear-gradient(-45deg, #0f172a, #1d4ed8, #7c3aed, #06b6d4, #22c55e);
  background-size: 400% 400%;
  animation: gradientShift 14s ease infinite;
  overflow-x: hidden;
}


header {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

header h1 {
  letter-spacing: 1px;
  /* text-shadow: 0 0 10px rgba(255,255,255,0.2);*/
  text-shadow: 0 4px 18px rgba(255, 255, 255, 0.18);
}


/* Animated background */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  25% {
    background-position: 50% 100%;
  }

  50% {
    background-position: 100% 50%;
  }

  75% {
    background-position: 50% 0%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Optional glowing blobs */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  opacity: 0.45;
}

body::before {
  top: 5%;
  left: -80px;
  background: #60a5fa;
}



body::after {
  bottom: 5%;
  right: -80px;
  background: #c084fc;
}

/* Glass sections */
header,
section>div,
#loading>div,
#errorMessage>div,
#weatherAlert>div {
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

/* Main title glow */
h1 {
  letter-spacing: 0.5px;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.2),
    0 0 25px rgba(255, 255, 255, 0.1);
}

/* Better text rendering */
h1,
h2,
h3,
p,
span,
button,
input {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Inputs */
input {
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

input:focus {
  transform: scale(1.01);
  box-shadow:
    0 0 0 2px rgba(147, 197, 253, 0.45),
    0 8px 30px rgba(59, 130, 246, 0.18);
}

/* Buttons premium */
button {
  font-family: inherit;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

button:active {
  transform: scale(0.96);
}

/* Shine effect */
button::before,
.recent-city-btn::before,
.forecast-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg,
      transparent,
      rgba(255, 255, 255, 0.16),
      transparent);
  transform: skewX(-20deg);
}

button:hover::before,
.recent-city-btn:hover::before,
.forecast-card:hover::before {
  left: 140%;
  transition: 0.9s;
}

/* Weather main card */
#currentWeather>div {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: fadeUp 0.7s ease;
}

#emptyState img {
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

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

  100% {
    transform: translateY(0px);
  }
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg,
      #eeeeee 25%,
      #dddddd 37%,
      #eeeeee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 10px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* Forecast cards */
.forecast-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.10);
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease, background- 0.35s ease;
  animation: fadeUp 0.7s ease;
}

.forecast-card:hover {
  transform: translateY(-10px) scale(1.03);
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.28),
    0 0 20px rgba(255, 255, 255, 0.08);
}

/* Recent search buttons */
.recent-city-btn {
  position: relative;
  overflow: hidden;
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.recent-city-btn:hover {
  transform: translateY(-3px) scale(1.02);
  background: rgba(255, 255, 255, 0.18);
}

/* Main weather icon */
#currentIcon {
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.24));
  animation: floatIcon 3.2s ease-in-out infinite;
}

@keyframes floatIcon {

  0%,
  100% {
    transform: translateY(0px);
  }

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

/* City + temp styling */
#currentCity {
  font-weight: 800;
  letter-spacing: 0.8px;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

#currentTemp {
  text-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25),
    0 0 18px rgba(255, 255, 255, 0.10);
}

/* Small weather stat cards */
#currentWeather .bg-white\/10 {
  transition: all 0.3s ease;
}

#currentWeather .bg-white\/10:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

/* Toast */
#toast {
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

/* Error and alert styling */
#errorMessage>div {
  box-shadow: 0 20px 45px rgba(239, 68, 68, 0.35);
}

#weatherAlert>div {
  box-shadow: 0 20px 45px rgba(250, 204, 21, 0.25);
}

/* Fade animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Headings */
h2 {
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

/* Better forecast heading */
#forecastSection h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.38);
}

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

  body::before,
  body::after {
    width: 220px;
    height: 220px;
    filter: blur(70px);
  }

  #currentTemp {
    font-size: 3.8rem !important;
  }

  #currentCity {
    font-size: 2.2rem !important;
  }

  #currentIcon {
    font-size: 4.7rem !important;
  }
}

@media (max-width: 480px) {
  #toast {
    right: 12px;
    left: 12px;
    top: 88px;
    text-align: center;
  }
}