html{
  background: #333;
}
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  background: linear-gradient(112.1deg, #202639 11.4%, #3f4c77 70.2%);
  overflow-y: scroll;
  overflow-x: hidden;
  position: relative;
  font-family: 'Poppins', sans-serif;
}

/* Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}
.logo-img {
  max-width: 50px;
  max-height: 50px;
}
.nav-component__degree-block {
  margin: 20px;
}
.nav-component__degree-block .celcius{
  color: rgb(251, 255, 127);
}
.nav-component__degree-block .farenheit{
  color: rgb(255, 127, 127);
}
.checkbox {
  opacity: 0;
  cursor: pointer;
}

label {
  width: 85px;
  height: 40px;
  background-color: rgba(9, 32, 63, 0.8);
  display: flex;
  border-radius: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  position: relative;
  transform: scale(1);
}

.ball {
  width: 35px;
  height: 35px;
  background-color: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  transition: transform 0.2s linear;
}
.checkbox:checked + label .ball {
  transform: translateX(45px);
}

/* Header Text */
.header-component {
  padding: 5px 20px;
  border-radius: 15px;
  text-align: center;
  color: #fff;
  background: linear-gradient(
    112.1deg,
    rgb(32, 38, 57) 11.4%,
    rgb(63, 76, 119) 70.2%
  );
  font-size: 1em;
  font-weight: 700;
  width: fit-content; 
  position: relative;
  margin: 6px auto;
  z-index: 9;
}

#date-time{
 font-family:monospace;
}

/* Card */
.weather-component__card {
  margin: 32px auto;
  position: relative;
  background: linear-gradient(135deg, rgba(9, 32, 63, 0.9) 0%, rgba(83, 120, 149, 0.9) 100%);
  padding: 2.5em;
  width: 100%;
  max-width: 1200px;
  min-width: 320px;
  min-height: 400px;
  height: auto;
  backdrop-filter: blur(15px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-radius: 25px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.weather-component__card::before {
  content: '';
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 25px;
  pointer-events: none;
}
.weather-component__search {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.search-container {
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  padding: 5px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 500px;
  transition: all 0.3s ease;
}

.search-container:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

input.weather-component__search-bar {
  outline: none;
  padding: 15px 20px;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  flex: 1;
  color: #333;
  border: none;
  border-radius: 50px 0 0 50px;
  caret-color: #156569;
}
input.weather-component__search-bar::placeholder {
  color: #666;
  font-weight: 400;
}
input.weather-component__search-bar:focus {
  outline: none;
}
.button_container {
  border-radius: 0 45px 45px 0;
  display: flex;
  align-items: center;
  padding: 5px;
}
.weather-component__button {
  margin: 0;
  border-radius: 50%;
  border: none;
  height: 45px;
  width: 45px;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.weather-component__button-microphone {
  margin-left: 8px;
  border-radius: 50%;
  border: none;
  height: 45px;
  width: 45px;
  outline: none;
  background: linear-gradient(135deg, #28a745, #20c997);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.weather-component__button:hover,
.weather-component__button-microphone:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.weather-component__searchbar h1 {
  overflow: hidden;
  border-right: 1px solid;
  margin: 0 auto;
  position: relative;
  animation: reza 4s steps(30, end);
  animation-iteration-count: infinite;
}
option:hover,
.active {
  background-color: lightblue;
}
button:focus {
  box-shadow: 0px 0px 10px rgb(255 255 255 / 50%);
}

/* weather section */
.weather-component__AQI {
  width: max-content;
  display: flex;
  flex-direction: column;
}
.weather-component__city-temperature {
  margin: 20px auto;
  width: 90%;
  max-width: 400px;
  font-size: 3.2rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  border-radius: 20px;
  padding: 15px 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-component__data {
  padding: 16px;
  position: relative;
  z-index: 2;
}

.weather-component__desc-primary {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  border-radius: 20px;
  min-height: 80px;
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-component__icn {
  height: 60px;
  margin-bottom: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

.weather-component__icn img {
  width: 60px;
  height: 60px;
}

#AirQuality {
  margin: 0 5px;
  font-weight: 600;
}
.loading {
  visibility: hidden;
  max-height: 20px;
  position: relative;
}
.loading:after {
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: visible;
  content: "Loading...";
  position: absolute;
  right: 50%;
  top: 15px;
  left: 50%;
}

/* Global Styles */
.flex-1 {
  flex: 1;
}
.transition {
  transition: 2s;
}

/* Secondary weather info */
.weather-component__desc-secondary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.secondary-left,
.secondary-right {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
}
.secondary-right {
  align-items: flex-end;
}
.humidity-container,
.wind-container,
.sunrise-container,
.sunset-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.good-quality {
  border-radius: 32px;
  text-align: center;
  color: #009966;
}

.satisfactory-quality {
  border-radius: 32px;
  color: #ffde33;
}

.sensitive-quality {
  border-radius: 32px;
  text-align: center;
  color: rgb(255, 102, 0);
}

.unhealthy-quality {
  border-radius: 32px;
  text-align: center;
  color: #cc0033;
}

.very-unhealthy-quality {
  border-radius: 32px;
  text-align: center;
  color: #550a55;
}

.hazardous-quality {
  border-radius: 32px;
  text-align: center;
  color: #7e0023;
}

.not-available {
  border-radius: 32px;
  text-align: center;
  color: gray;
}
.humidity-img, .wind-img, .sunrise-img {
  width: 25px;
  height: 25px;
  margin: 0;
}
.sunset-img{
  width: 30px;
  height: 30px;
  margin: 0;
}
.weather-component__city-name {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 300;
  margin-bottom: 10px;
}
.weather-component__city-temperature {
  text-align: center;
}
.air-quality-label {
  margin: auto 5px;
  padding: 1px 5px;
}

/* Forecast Section */
.forecast-section {
  margin-top: 3rem;
}
.forecast-component {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.forecast-img {
  height: 50px;
  width: 50px;
}
.forecast-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.forecast-component__items-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 1.5rem;
  align-items: stretch;
  font-family: "Inter", sans-serif;
  width: 100%;
  margin: 0 auto;
}

/* Large devices - 5 items per row */
@media (min-width: 1200px) {
  .forecast-component__items-wrapper {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Medium-large devices - 4 items per row */
@media (min-width: 992px) and (max-width: 1199px) {
  .forecast-component__items-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Medium devices - 3 items per row */
@media (min-width: 768px) and (max-width: 991px) {
  .forecast-component__items-wrapper {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Small devices - 2 items per row */
@media (min-width: 576px) and (max-width: 767px) {
  .forecast-component__items-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Extra small devices - 1 item per row */
@media (max-width: 575px) {
  .forecast-component__items-wrapper {
    grid-template-columns: 1fr;
  }
}

.forecast-component__item {
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  margin: 0;
  padding: 1.5rem 1rem;
  transition: all 0.3s ease;
}
.forecast-component__item img {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
}
.forecast-component__item:hover {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: linear-gradient(135deg, rgba(9, 32, 63, 0.8), rgba(83, 120, 149, 0.6));
  border-radius: 20px;
  cursor: pointer;
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}



/* toast style */
.center {
  text-align: center;
}
#toast {
  visibility: hidden;
  min-width: 170px;
  background: #fafafacd;
  box-shadow: rgb(0 0 0 / 40%) 0px 3px 8px;
  color: black;
  text-align: center;
  border-radius: 10px;
  padding: 7px 4px;
  position: fixed;
  top: 15px;
  z-index: 3000;
  right: 16px;
  font-size: 16px;
  transform: translateY(-100%);
  transition: transform 0.25s ease-in-out;
}
#toast.show {
  visibility: visible;
  transform: translateY(0);
}
.toast-component__checkicon i {
  font-size: 40px;
  color: #47d764;
}

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

::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px grey;
  border-radius: 5px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb {
  background: #171717;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #171717;
}

/* Footer */
footer {
  background-color: rgba(9, 32, 63, 0.8);
  height: 150px;
  display: flex;
  position: relative;
  top: 100px;
  justify-content: center;
  align-items: center;
  text-emphasis-style: bold;
  margin: 3rem auto 0;
  backdrop-filter: blur(10px);
}
.textfooter {
  color: white;
  text-align: center;
  font-size: 1rem;
}
.footerSection {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: white;
  display: inline-flex;
  gap: 2rem;
}
.link1 {
  padding: 0.5rem 0.5rem;
  box-sizing: border-box;
  margin-right: 50px;
  color: #ffffff;
  transition-property: scale();
  transition-duration: 0.5s;
}
.link1:hover {
  transform: scale(1.2, 1.2);
  transition-timing-function: linear;
  color: #ffffff;
}
.link2 {
  font-weight: 900;
  padding: 0.5rem 0.5rem;
  box-sizing: border-box;
  transition-property: scale();
  transition-duration: 0.5s;
}
.link2:hover {
  transform: scale(1.2, 1.2);
  transition-timing-function: linear;
}

/* current day in future weather forecast*/
.forecast-component__item-current-day {
  background: linear-gradient(135deg, rgba(9, 32, 63, 0.9), rgba(83, 120, 149, 0.7));
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* scroll btn css */
#scroll-btn {
  opacity: 0;
  width: 40px;
  height: 40px;
  color: #fff;
  background-color: deepskyblue;
  position: fixed;
  bottom: 20%;
  right: 10%;
  border: 2px solid #fff;
  border-radius: 50%;
  font: bold 20px monospace;
  transition: opacity 0.5s, transform 0.5s;
}
.scroll-top {
  position: absolute;
  z-index: 5;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  -webkit-box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.1);
  box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.1); 
}

.scroll-top > span {
    position: absolute;
    font-size: 2rem;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    color: #000 !important; 
}
#scroll-btn.show {
  opacity: 1;
  transition: opacity 1s, transform 1s;
}

/* Responsive Design Improvements */
@media only screen and (max-width: 768px) {
  #toast {
    top: 50%;
    transform: translateY(-50%);
    right: 50%;
    transform: translateX(50%) !important;
    transform: none;
    transition: none;
  }
  .nav-component {
    height: fit-content;
  }
  
  .weather-component__card {
    padding: 20px;
    margin: 20px 10px;
    min-height: 400px;
  }

  .search-container {
    max-width: 100%;
  }

  .weather-component__desc-primary {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .weather-component__desc-secondary {
    flex-direction: column;
    gap: 1rem;
  }

  .secondary-right {
    align-items: flex-start;
  }

  .weather-component__city-name {
    font-size: 1.8rem;
  }

  .weather-component__city-temperature {
    font-size: 2.5rem;
  }

  .forecast-component {
    padding: 0 10px;
  }
}

@media only screen and (max-width: 550px) {
  .link {
    width: 45%;
  }

  .weather-component__city-name {
    font-size: 1.5rem;
  }

  .weather-component__city-temperature {
    font-size: 2rem;
    padding: 10px;
  }

  .weather-component__AQI {
    flex-direction: column;
    text-align: center;
  }

  .weather-component__card {
    padding: 15px;
    margin: 15px 5px;
  }

  input.weather-component__search-bar {
    padding: 12px 15px;
    font-size: 14px;
  }

  .weather-component__button,
  .weather-component__button-microphone {
    height: 40px;
    width: 40px;
  }

  .forecast-component__item {
    padding: 1rem 0.5rem;
    min-height: 160px;
  }

  .forecast-component__item img {
    width: 50px;
    height: 50px;
  }
}