@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  --bg: #581b98;
  --text-title: hsl(212, 21%, 14%);
  --para: hsl(228, 12%, 48%);
  --card-bg: hsl(0, 0%, 100%);
  --color-shadow: #9c1de7;
  --font-family: "Barlow Condensed", sans-serif;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #1e1b4b 0%, #581c87 50%, #7c2d92 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-container {
  background: linear-gradient(180deg, #1e1b4b 0%, #581c87 50%, #7c2d92 100%);
  border-radius: 2rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  color: white;
  position: relative;
  overflow: hidden;
  max-width: 400px;
  width: 100%;
  margin: 1rem;
}

/* Stars background */
.stars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.6;
}

.star-1 {
  width: 4px;
  height: 4px;
  top: 2rem;
  left: 2rem;
  opacity: 0.6;
}

.star-2 {
  width: 4px;
  height: 4px;
  top: 4rem;
  right: 3rem;
  opacity: 0.8;
}

.star-3 {
  width: 2px;
  height: 2px;
  top: 6rem;
  left: 4rem;
  opacity: 0.4;
}

.star-4 {
  width: 4px;
  height: 4px;
  top: 8rem;
  right: 2rem;
  opacity: 0.7;
}

.star-5 {
  width: 2px;
  height: 2px;
  top: 10rem;
  left: 1.5rem;
  opacity: 0.5;
}

.star-6 {
  width: 4px;
  height: 4px;
  top: 12rem;
  right: 5rem;
  opacity: 0.6;
}

.star-7 {
  width: 2px;
  height: 2px;
  top: 14rem;
  left: 3rem;
  opacity: 0.4;
}

.star-8 {
  width: 4px;
  height: 4px;
  top: 16rem;
  right: 1.5rem;
  opacity: 0.8;
}

.star-9 {
  width: 2px;
  height: 2px;
  top: 18rem;
  left: 5rem;
  opacity: 0.5;
}

.star-10 {
  width: 4px;
  height: 4px;
  top: 20rem;
  right: 4rem;
  opacity: 0.7;
}

.weather-content {
  position: relative;
  z-index: 10;
  padding: 2rem;
}

.location {
  font-size: 1.5rem;
  font-weight: 300;
  text-align: center;
  margin-bottom: 0.5rem;
}

.temperature {
  font-size: 4rem;
  font-weight: 100;
  text-align: center;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.condition {
  font-size: 1.125rem;
  text-align: center;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.high-low {
  text-align: center;
  opacity: 0.7;
  margin-bottom: 2rem;
}

.house-illustration {
  text-align: center;
  margin-bottom: 2rem;
  height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forecast-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.tab-container {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2rem;
  padding: 0.25rem;
  display: flex;
}

.tab-btn {
  background: none;
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
  transform: scale(1.05);
}

.tab-btn:hover:not(.active) {
  opacity: 0.9;
  transform: scale(1.02);
}

.forecast-container {
  min-height: 120px;
  position: relative;
}

.forecast-content {
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.forecast-content.transitioning {
  opacity: 0;
  transform: translateY(1rem);
}

/* Hourly forecast */
.hourly-forecast {
  display: flex;
  gap: 0.5rem;
}

.hourly-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 0.75rem;
  text-align: center;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(1rem);
  animation: slideInUp 0.3s ease forwards;
}

.hourly-item:hover {
  transform: scale(1.05) translateY(0);
}

.hourly-item.active {
  background: rgba(147, 51, 234, 0.5);
}

.hourly-time {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

.hourly-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
  transition: transform 0.3s ease;
}

.hourly-item:hover .hourly-icon {
  transform: rotate(12deg);
}

.hourly-temp {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Weekly forecast */
.weekly-forecast {
  display: none;
}

.weekly-forecast.active {
  display: block;
}

.weekly-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateX(2rem);
  animation: slideInLeft 0.3s ease forwards;
}

.weekly-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.02) translateX(0);
}

.weekly-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.weekly-day {
  font-size: 0.875rem;
  font-weight: 500;
  width: 3rem;
}

.weekly-icon {
  font-size: 1.5rem;
  opacity: 0.8;
  transition: transform 0.3s ease;
}

.weekly-item:hover .weekly-icon {
  transform: rotate(12deg);
}

.weekly-temps {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.weekly-high {
  font-size: 0.875rem;
  font-weight: 500;
}

.weekly-low {
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Animations */
@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Staggered animation delays */
.hourly-item:nth-child(1) {
  animation-delay: 0ms;
}

.hourly-item:nth-child(2) {
  animation-delay: 100ms;
}

.hourly-item:nth-child(3) {
  animation-delay: 200ms;
}

.hourly-item:nth-child(4) {
  animation-delay: 300ms;
}

.hourly-item:nth-child(5) {
  animation-delay: 400ms;
}

.weekly-item:nth-child(1) {
  animation-delay: 0ms;
}

.weekly-item:nth-child(2) {
  animation-delay: 80ms;
}

.weekly-item:nth-child(3) {
  animation-delay: 160ms;
}

.weekly-item:nth-child(4) {
  animation-delay: 240ms;
}

.weekly-item:nth-child(5) {
  animation-delay: 320ms;
}

/* Responsive design */
@media (min-width: 768px) {
  .weather-container {
    max-width: 500px;
  }

  .location {
    font-size: 2rem;
  }

  .temperature {
    font-size: 5rem;
  }

  .condition {
    font-size: 1.25rem;
  }

  .weather-content {
    padding: 2.5rem;
  }

  .hourly-item {
    padding: 1rem;
  }

  .weekly-item {
    padding: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .weather-container {
    max-width: 445px;
  }

  .location {
    font-size: 2.5rem;
  }

  .temperature {
    font-size: 6rem;
  }

  .condition {
    font-size: 1.5rem;
  }

  .weather-content {
    padding: 3rem;
  }
}
