* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #333;
  color: #ffffff;
  min-height: 100vh;
}

.container {
  display: flex;
  height: 95vh;
  width: 80vw;
  background-color: #121212;
  position: relative;
  left: 160px;
  top: 20px;
  border-radius: 20px;
  height: 95vh;
  width: 80vw;
  display: flex;
}



.sidebar {
  width: 25%;
  background-color: #121212;
  padding: 2rem;
  display: flex;
  gap: 18px;
  flex-direction: column !important;
  border-right: 1px solid #333;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;

}

.logo {
  height: 14vh;
  position: relative;
  top: 14px;
  padding: 10px;
  left: 30px;
  display: flex;
  justify-content: center;
  opacity: 0.8;


}

.feels-like,
.visibility .humidity {
  height: 107px !important;
  width: 268px !important;
}
.sidebar-details > * {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}
.logo { animation-delay: 0.2s; }
.search-bar { animation-delay: 0.4s; }
.current-weather { animation-delay: 0.6s; }
.temperature-graph { animation-delay: 0.8s; }
.promo-box { animation-delay: 1s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.dashboard > * {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.dashboard.loaded > * {
  opacity: 1;
  transform: translateX(0);
}
.top-bar { transition-delay: 0.2s; }
.weekly-forecast { transition-delay: 0.4s; }
.overview { transition-delay: 0.6s; }

.weekly-forecast .day-card {
  opacity: 0;
  transform: scale(0.9);
  animation: popIn 0.5s ease-out forwards;
}
.weekly-forecast .day-card:nth-child(1) { animation-delay: 0.6s; }
.weekly-forecast .day-card:nth-child(2) { animation-delay: 0.7s; }
.weekly-forecast .day-card:nth-child(3) { animation-delay: 0.8s; }
.weekly-forecast .day-card:nth-child(4) { animation-delay: 0.9s; }
.weekly-forecast .day-card:nth-child(5) { animation-delay: 1.0s; }
.weekly-forecast .day-card:nth-child(6) { animation-delay: 1.1s; }
.weekly-forecast .day-card:nth-child(7) { animation-delay: 1.2s; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.sidebar-details {
  position: relative;
  top: -49px;
}

.location-details {
  display: flex;
  align-items: center;
  /* vertically center image and text */
  gap: 2px;
  /* more breathing space between image and text */
  position: relative;
  left: -10px;
  /* reduced shift for better balance */
  color: #ffffff;
  /* ensure the text is visible on dark background */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.location-details img {
  height: 25px;
  width: 25px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  margin-bottom: 3px;
}

.location-details p {
  margin: 0;
  font-size: 20px;
  font-family: 'Poppins', sans-serif;
  font-weight: 200;
}

.dashboard {
  width: 75%;
  padding: 2rem;
  overflow-y: auto;
}

.location h2 {
  font-size: 1.5rem;
}

/* #search-btn{
    width: 10px;
    height: 10px;
  } */
#search-icon {
  height: 17px;
  opacity: 0.7;
}

#search-icon:hover {
  opacity: 1;
  cursor: pointer;
}

.search-bar {
  width: 90%;
  background: #2b2b2bf1;
  display: flex;
  align-items: center;
  border-radius: 10px;
  padding: 10px 10px;
  height: 27px;
  position: relative;
  left: 15px;
  top: 5px;
}

.search-bar input {
  background: transparent;
  border: 0;
  outline: none;
  flex: 1;
  padding: 3px;
  font-size: 10px;
  color: #e5e4f0c0;

}

.search-bar button {
  cursor: pointer;
  padding-top: 1px;
}

.location p {
  color: #aaa;
}

.current-weather {
  text-align: center;
  padding: 8px;
  padding-top: 2px;
  padding-bottom: 16px;
}

.current-weather h1 {
  font-size: 3rem;
}

.weather-icon i {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.temperature-graph {
  background-color: #2b2b2b;
  padding: 0.7rem;
  border-radius: 1rem;
  text-align: center;
  font-size: 15px;
  position: relative;
  right: 16px;
  width: 18vw;

}

.temperature-graph canvas {
  margin-top: 1rem;
  max-width: 100%;
}

.labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #ccc;
}

.promo-box {
  background-color: #2b2b2b;
  padding: 1rem;
  border-radius: 1rem;
  text-align: center;
  position: relative;
  top: 10px;
}

.promo-box img {
  width: 100%;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.promo-box button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}



.weekly-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.day-card {
  background-color: #2b2b2b;
  padding: 1rem;
  border-radius: 1rem;
  text-align: center;
  font-size: 0.9rem;
  height: 150px;
}

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  height: 353px !important;
  width: 852px !important;
}

.card {
  background-color: #2b2b2b;
  padding: 1rem;
  border-radius: 1rem;

}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.card small {
  color: #aaa;
  font-size: 0.8rem;
}

.wind-speed {
  text-align: center;
  margin-top: 20px;
  margin-left: 9px;
}


.overview h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
}

.sunrise {
  display: flex;
  height: 60px;
  align-items: center;
  /* Vertically align image and text */
  gap: 10px;
}

.sunrise img {
  height: 55px;
}

.sunset {
  display: flex;
  height: 60px;
  align-items: center;
  /* Vertically align image and text */
  gap: 15px;
}

.sunset img {
  height: 46px;
  margin-left: 4px;
}

.weeklyweather {
  height: 62px;
  padding: 2px;
}

.uv-value {
  position: relative;
  bottom: 67px;
  left: 9px;
  text-align: center;
}

#windChart {
  position: relative;
  top: 12px;
  left: -8px;
}

#tempChart {
  position: relative;
  right: 2px;
  top: 3px;
}

#uvChart {
  width: 15vw !important;
  position: relative;
  bottom: 38px;
  left: 10px;
  object-fit: cover;
}

.sunrise-sunset,
.uv-index,
.wind-status {
  max-height: 30vh;

}

.uv-subtext {
  position: relative;
  bottom: 68px;
  text-align: center;
  left: 100px;
}

/* Existing media query */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar,
  .dashboard {
    width: 100%;
    border-radius: 0;
  }
}

/* Additional media queries for full responsiveness */

/* Adjust container positioning for larger tablets */
@media (max-width: 1024px) {
  .container {
    left: 50px;
    top: 10px;
    width: 90vw;
    height: 90vh;
  }
}

/* Adjust container for small mobile devices */
@media (max-width: 480px) {
  .container {
    left: 0;
    top: 0;
    width: 100vw;
    height: auto;
  }
}

/* Adjust sidebar and dashboard padding for smaller screens */
@media (max-width: 600px) {
  .sidebar {
    padding: 1rem;
  }

  .dashboard {
    padding: 1rem;
  }
}

/* Make fixed-width/height elements responsive */
@media (max-width: 768px) {

  .feels-like,
  .visibility,
  .humidity {
    width: 100% !important;
    height: auto !important;
  }

  .logo {
    left: 90px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 3px;
  }

  .temperature-graph {
    width: 92vw;
    right: 0;
    margin-bottom: 12px;
  }

  .dashboard {
    bottom: 42px;
    position: relative;
  }

  #windChart {
    top: -1px;
  }
  .sunset{
    margin-left: -4px;
  }

  .wind-status {
    width: 92vw;
    height: auto !important;
    max-height: none;
    padding: 10px 10px;
    
  }

  .wind-speed {
    position: relative;
    bottom: 10px;
    font-size: 13px;

  }

  .top-bar {
    margin-bottom: 1rem;
    padding: 9px;
    margin-top: -14px;
  }

  .overview {
    width: 100% !important;
    height: auto !important;
    grid-template-columns: 1fr;
    /* Stack cards vertically */
  }

  .uv-value {
    text-align: center;
    position: relative;
    left: 0px;
    bottom: 68px;
    font-size: 13px;
  }

  .uv-subtext {
    left: 0;
    margin-left: auto;
    margin-right: auto;
    display: block;
    text-align: center;
    position: relative;
  }

  .uv-index {
    max-height: 33vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

  }


  #tempChart {
    width: 100% !important;
    left: 3px;
    top: 5px;
    margin: -0.5rem;
    padding: 20px;
  }

  #uvChart {
    width: 98% !important;
    margin-top: -1px;
    left: 5px;
  }
}

/* Scale text and icons for very small screens */
@media (max-width: 480px) {
  .current-weather h1 {
    font-size: 2rem;
  }

  .weather-icon i {
    font-size: 2rem;
  }

  .location-details p {
    font-size: 16px;
  }

  .sunrise img,
  .sunset img {
    height: 40px;
  }

  .promo-box img {
    width: 100%;
    height: auto;
  }

  .promo-box button {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* Adjust grid layouts for smaller screens */
@media (max-width: 600px) {
  .weekly-forecast {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.5rem;
  }

  .day-card {
    padding: 0.5rem;
    height: auto;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar,
  .dashboard {
    width: 100%;
  }
}
