/* FONT IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
  --bg-gradient: linear-gradient(to bottom, #2c3e50, #4ca1af);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.15);
  --text-color: #ffffff;
  --accent: #fcd34d;
  --card-radius: 20px;
  --blur: 12px;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-color);
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: start;
}

/* MAIN CONTAINER */
.container {
  width: 100%;
  max-width: 430px;
  padding: 1rem;
  border-radius: 25px;
  backdrop-filter: blur(var(--blur));
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 600;
}

#theme-toggle {
  background: none;
  color: var(--accent);
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
}

/* SEARCH BAR */
.search-section {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

#city-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--card-radius);
  border: none;
  font-size: 1rem;
  background: var(--glass-bg);
  color: white;
  outline: none;
}

#search-btn {
  background: var(--accent);
  color: black;
  font-weight: bold;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: var(--card-radius);
  cursor: pointer;
}

/* CURRENT WEATHER */
.current-weather {
  text-align: center;
  margin-bottom: 2rem;
}

#weather-icon {
  width: 100px;
  height: 100px;
}

#temperature {
  font-size: 4rem;
  font-weight: 600;
  margin: 0.3rem 0;
}

#description {
  font-size: 1.1rem;
  font-weight: 300;
}

/* STATS */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.stats p {
  background: var(--glass-bg);
  border-radius: var(--card-radius);
  padding: 0.8rem;
  font-size: 0.9rem;
  text-align: center;
  border: 1px solid var(--border-glow);
  box-shadow: inset 0 0 5px rgba(255,255,255,0.05);
}

/* FORECAST SCROLL */
.scroll-x {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-top: 0.5rem;
  margin-bottom: 2rem;
}

.scroll-x::-webkit-scrollbar {
  height: 5px;
}
.scroll-x::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.hour-card, .day-card {
  flex: 0 0 auto;
  background: var(--glass-bg);
  border-radius: var(--card-radius);
  padding: 1rem;
  min-width: 110px;
  text-align: center;
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.hour-card img, .day-card img {
  width: 40px;
  height: 40px;
  margin-bottom: 0.5rem;
}

/* NEWS */
.weather-news ul {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.weather-news li {
  background: var(--glass-bg);
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-glow);
  font-size: 0.9rem;
}

/* FOOTER */
footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.8rem;
  opacity: 0.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* Smooth fade-in for weather data */
.fade-in {
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Background variants based on weather */
body.clear {
  background: linear-gradient(to bottom, #56ccf2, #2f80ed);
}

body.clouds {
  background: linear-gradient(to bottom, #757f9a, #d7dde8);
}

body.rain {
  background: linear-gradient(to bottom, #485563, #29323c);
}

body.snow {
  background: linear-gradient(to bottom, #e6dada, #274046);
}

body.thunderstorm {
  background: linear-gradient(to bottom, #232526, #1c1c1c);
}
