@import url("https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap");

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  list-style: none;
  font-family: "Rubik", sans-serif;
}

:root {
  --font-color-main: #332464;
  --white-color: #fff;
  --primary-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  --secondary-gradient: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
  --shadow-color: rgba(51, 36, 100, 0.2);
  --hover-shadow: rgba(51, 36, 100, 0.35);
}

body {
  background: var(--secondary-gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#screen {
  background: var(--white-color);
  width: 100%;
  max-width: 480px;
  border-radius: 25px;
  box-shadow: 0 15px 30px var(--shadow-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 90vh;
}

/* Navigation */
nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px;
  background: var(--font-color-main);
  border-radius: 0 0 25px 25px;
  box-shadow: 0 4px 8px var(--shadow-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav ul {
  display: flex;
  gap: 2.5rem;
}

nav ul li a {
  color: var(--white-color);
  font-size: 20px;
  padding: 10px 18px;
  border-radius: 50px;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

nav ul li a:hover,
nav ul li a.active {
  background: var(--white-color);
  color: var(--font-color-main);
  box-shadow: 0 4px 12px var(--hover-shadow);
}

/* City Name */
.city-name {
  color: var(--font-color-main);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 0 10px;
  gap: 10px;
  font-weight: 600;
  font-size: 1.6rem;
  text-shadow: 1px 1px 3px rgba(51, 36, 100, 0.2);
}

.city-name i {
  font-size: 24px;
  color: var(--primary-gradient);
  animation: pulse 2.5s infinite ease-in-out;
}

/* Weather Icon */
.weather-icon-css {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 350px;
  margin-top: 10px;
  position: relative;
}

.weather-icon-css img {
  width: 80%;
  max-width: 300px;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(51, 36, 100, 0.15));
  border-radius: 20px;
  transition: transform 0.3s ease;
}

.weather-icon-css img:hover {
  transform: scale(1.05);
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

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

/* Weather Description */
.weather-description {
  height: 150px;
  margin-top: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--font-color-main);
  gap: 40px;
  padding: 0 20px;
  flex-wrap: wrap;
}

.show-metric {
  font-size: 96px;
  font-weight: 700;
  padding-left: 10px;
  text-shadow: 2px 2px 6px rgba(51, 36, 100, 0.15);
  min-width: 120px;
  text-align: center;
  color: var(--primary-gradient);
}

.weather-details {
  font-size: 16px;
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-weight: 500;
  text-align: left;
  user-select: none;
}

.weather-details .h-f {
  display: flex;
  gap: 15px;
  font-size: 14px;
  color: #555;
}

.weather-details .h-f div {
  background: var(--secondary-gradient);
  padding: 6px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(51, 36, 100, 0.1);
  font-weight: 600;
}

/* Forecast Boxes */
.forcasts-box {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 25px 15px;
  color: var(--font-color-main);
  gap: 20px;
  flex-wrap: wrap;
}

/* Today Forecast */
.today-forecast {
  width: 130px;
  height: 210px;
  border-radius: 25px;
  display: flex;
  gap: 10px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--primary-gradient);
  color: var(--white-color);
  box-shadow: 0 8px 20px rgba(101, 67, 255, 0.3);
  transition: transform 0.3s ease;
  cursor: default;
}

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

.weather-icon-today img {
  width: 50px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.temp-today {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 1.5px;
}

.weather-main-today {
  padding-top: 5px;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
  text-transform: capitalize;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
}

/* Future Forecast */
.future-forecast {
  flex: 1;
  min-width: 280px;
  height: 210px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 25px;
  background: var(--white-color);
  box-shadow: 0 8px 20px var(--shadow-color);
  padding: 15px 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-gradient) transparent;
}

.future-forecast::-webkit-scrollbar {
  height: 8px;
}

.future-forecast::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 10px;
}

#future-forecast-box {
  display: grid;
  grid-auto-flow: column;
  gap: 15px;
  width: 95%;
  padding: 0 12px;
  overscroll-behavior-x: contain;
}

/* Individual forecast box */
.weather-forecast-box {
  width: 90px;
  height: 130px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border: 1.5px solid var(--font-color-main);
  background: #fafafa;
  box-shadow: 0 4px 10px rgba(51, 36, 100, 0.05);
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  user-select: none;
}

.weather-forecast-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px var(--hover-shadow);
  border-color: var(--primary-gradient);
  background: var(--secondary-gradient);
  color: var(--white-color);
}

.day-weather {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--font-color-main);
}

.weather-icon-forecast img {
  width: 36px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.temp-weather {
  font-size: 14px;
  font-weight: 600;
}

.weather-main-forecast {
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
  color: var(--font-color-main);
}

/* Responsive */
@media screen and (max-width: 480px) {
  #screen {
    border-radius: 20px;
    min-height: 100vh;
  }

  .weather-icon-css {
    height: 280px;
  }

  .weather-icon-css img {
    width: 70%;
  }

  .show-metric {
    font-size: 72px;
  }

  .weather-details {
    width: 120px;
    font-size: 14px;
  }

  .forcasts-box {
    flex-direction: column;
    gap: 25px;
    padding: 20px 10px;
  }

  .today-forecast {
    width: 100%;
    max-width: 320px;
    height: 180px;
    border-radius: 20px;
  }

  .future-forecast {
    width: 100%;
    min-width: 100%;
    height: 180px;
  }

  #future-forecast-box {
    gap: 12px;
  }

  .weather-forecast-box {
    width: 80px;
    height: 110px;
  }
}
