@import url('https://fonts.googleapis.com/css2?family=Poppins: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');

* {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: #0c1527;
}

:root.overcast {
  --weather: linear-gradient(135deg, #1E1E1E 0%, #2E2E2E 100%);
  --weather-color: #958787;
  --light: #EEEEEE;
  --gray: #d5d0d0;
  --info-color: #595049;
}

:root.rain {
  --weather: linear-gradient(135deg, #0D2B52 0%, #1A4574 100%);
  --weather-color: #3b7f9f;
  --light: #E1F5FE;
  --gray: #29B6F6;
  --info-color: #125362;
}

:root.thunder {
  --weather: linear-gradient(135deg, #6214d7 0%, #5303a9af 100%);
  --weather-color: #6214d7;
  --light: #fff;
  --gray: #c3b4b4;
  --info-color: #39028a;
}

:root.sunny {
  --weather: linear-gradient(135deg, #6B3A10 0%, #42240A 100%);
  --weather-color: #874205;
  --light: #FDF2E9;
  --gray: #f2f0ef;
  --info-color: #9c4600;
}

:root.clear {
  --weather: linear-gradient(135deg, #556f91 0%, #203d63 100%);
  --weather-color: #10506d;
  --light: #E1F5FE;
  --gray: #29B6F6;
  --info-color: #043e5f;
}


:root.snowy {
  --weather: linear-gradient(135deg, #0D2B52 0%, #1A4574 100%);
  --weather-color: #085376;
  --light: #E1F5FE;
  --info-color: #02131b;
  --gray: #81D4FA;
}




.search-bar {
  display: flex;
  width: 100%;
  max-width: 400px;
  /* still keeps a nice upper limit */
  justify-content: end;
  margin: 20px 2em 20px auto;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-city-input {
  flex: 1;
  min-width: 0;
  /* ensures it shrinks if needed */
  padding: 12px 16px;
  border: none;
  font-size: 16px;
  outline: none;
  color: #505050;
  box-sizing: border-box;
}


.search-city-input::placeholder {
  color: #999;
}

.search-btn {
  padding: 0 16px;
  border: none;
  background: var(--weather-color);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}



/* For sticky positioning at top */
.sticky-search {
  position: sticky;
  top: 0;
  background: white;
  padding: 12px;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.main-container {
  display: flex;
  margin: auto;
  align-items: stretch;
}

.current-weather {
  transition: 0.3s all ease;
  padding: 2em;
  background: var(--weather);
  border-radius: 20px;
  width: 60%;
  border: 1px solid var(--weather-color);
  margin: 1em;
}

.card-header {
  display: flex;
  justify-content: space-between;
}

.card-header-left {
  display: flex;
}

.card-header-right {
  display: flex;
  flex-direction: column;
  align-items: end;
}


.location-marker {
  padding: 12px;
  margin: 0 20px 0px 0px;
  border-radius: 50%;
  background-color: #0a536b90;
  width: 24px;
  height: 24px;
}

.city-name {
  color: var(--light);
}

.country-name {
  color: var(--gray);
  font-weight: 500;
}

.last-update {
  font-weight: 500;
  color: var(--gray);
}

.last-time {
  font-weight: 500;
  color: var(--light);
}

/*Card-Mid Section*/
.card-mid-section {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin: 20px auto;
}


.temperature {
  font-size: 4em;
  color: var(--light);
}

.weather-status {
  font-weight: 600;
  color: var(--light);
}

.weather-detail {
  color: var(--gray);
  font-weight: 500;
  font-size: 1.05em;
}


.weather-img {
  background-color: var(--info-color);
  border-radius: 50%;
  padding: 10px;
  width: 100%;
}

/*Card-Bottom Section*/

.card-bottom-section {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 40px;
}

.more-info {
  font-size: 1.1em;
  font-weight: 500;
  color: var(--gray);
  text-align: center;
  width: 30%;
  height: 20%;
  background-color: var(--info-color);
  padding: 12px;
  border-radius: 12px;
  transition: 0.3s all ease;
  cursor: pointer;
}

.more-info:hover {
  background-color: var(--weather-color);
  transform: scale(1.05);
}

.feels-like-temp {
  color: var(--light);
}

.humidity {
  color: var(--light);
}

.uv-index {
  font-weight: 500;
}

.margin-top {
  margin-top: 40px;
}

.today-highlights {
  border-radius: 12px;
  padding: 1em;
  background: var(--weather);
  width: 40%;
  margin: 1em;
  border: 1px solid var(--weather-color);

}

.highlights {
  border: 1px solid var(--weather);
  background-color: var(--info-color);
  border-radius: 50%;
  padding: 10px;
  width: 24px;
  height: 24px;
}

.highlights-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.today-highlights p {
  color: var(--light);
  font-weight: 600;
  font-size: 1.2em;
}

.highlights-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 8px;
  padding: 12px;
  border-radius: 12px;
  color: var(--light);
  transition: 0.3s all ease;
  background-color: #ffffff23;
  cursor: pointer;
}

.highlights-info:hover {
  background-color: #ffffff59;
  transform: scale(1.02);
}

.highlights-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info {
  display: flex;
  align-items: center;
  justify-content: space-between;

}

.highlights-info img {
  width: 30px;
}

.sunrise-sunset {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5em;
  width: 92%;
  margin: 1em auto;
  color: var(--light);
  border-radius: 8px;
  border: 1px solid var(--weather-color);
  background: var(--weather);

}

.sunrise-img {
  padding: 10px;
  border-radius: 50%;
  background-color: var(--info-color);
}


.sunset-img {
  padding: 10px;
  border-radius: 50%;
  background-color: var(--info-color);
}

.sunrise-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sunrise-container span {
  color: var(--gray);
  font-size: 1.2em;
}

.sunset-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sunset-container span {
  color: var(--gray);
  font-size: 1.2em;
}

.hour-head {
  display: flex;
  gap: 1em;
  align-items: center;
  margin: 2.5em;

}

.hour-heading {
  color: var(--light);
}

.daily-forecast-container {
  display: flex;
  flex-wrap: wrap;
  width: 95%;
  margin: 2em auto;
  gap: 1em;
}

.daily-forecast {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  gap: 0.5em;
  width: 150px;
  padding: 1em;
  background: var(--weather);
  border-radius: 8px;
  color: var(--gray);
  border: 1px solid var(--weather-color);
  transition: 0.3s all ease;
  cursor: pointer;
}

.hourly-temperature {
  font-size: 1.4em;
}

.daily-forecast:hover {
  background: #ffffff28;
  transform: scale(1.05);
}

.daily-forecast-img {
  width: 30%;
  background: var(--info-color);
  padding: 10px;
  border-radius: 50%;
}

/* ===== Responsive Additions ===== */
@media (max-width: 1400px) {
  .main-container {
    flex-direction: column;
  }

  .current-weather,
  .today-highlights {
    width: 88%;
    margin: 1em auto;
  }

  .today-highlights {
    width: 92%;
  }
}

@media (max-width: 768px) {

  .daily-forecast-container {
    justify-content: center;
  }

  /* Search Bar */
  .search-bar {
    width: 100%;
    margin: 2em auto;
  }

  .current-weather {
    width: 84%;
    margin: 1em auto;
  }

  .sunrise-sunset {
    width: 86% !important;
    margin: 0 auto;
  }

  .sunrise-img {
    padding: 8px;
    width: 40px;
  }

  .sunset-img {
    padding: 8px;
    width: 40px;
  }


  .search-city-input {

    padding-left: 20px;
  }



  /* Current Weather Card */
  .card-mid-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .weather-img {
    margin-top: 20px;
    max-width: 100px;
  }

  .card-bottom-section {
    flex-wrap: wrap;
    justify-content: center;
  }

  .more-info {
    width: 45%;
    min-width: 140px;
    margin-bottom: 10px;
  }

  /* Highlights Section */
  .today-highlights {
    width: 90%;
  }


  .highlights-info {
    padding: 10px;
    margin: 8px 0;
  }

  .daily-forecast {
    width: 40%;
  }

  /* Typography Adjustments */
  .temperature {
    font-size: 3em;
  }

  .weather-status {
    font-size: 1.5em;
  }
}

@media (max-width: 480px) {

  /* Smaller Screens */
  .current-weather {
    padding: 1.5em;
  }

  .daily-forecast-img {
    width: 10%;
  }

  .daily-forecast {
    width: 80%;
  }

  .sunrise-sunset {
    flex-direction: column;
    gap: 1em;
    width: 82% !important;
    margin: 0 auto;
  }

  .sunrise-container span {
    font-size: 1em;
  }

  .sunset-container span {
    font-size: 1em;
  }

  .more-info {
    width: 100%;
  }

  /* Touch Targets */
  .search-btn,
  .more-info,
  .highlights-info {
    min-height: 48px;
  }
}