* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  padding: 30px;
  max-width: 900px;
  width: 100%;
  transition: 0.3s ease-in-out;
}

.container:hover {
  transform: scale(1.01);
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 25px;
  color: #fff;
}

.search-box {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

input {
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  width: 60%;
  outline: none;
  font-size: 1rem;
}

button {
  padding: 12px 20px;
  background: #00c6ff;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #0072ff;
}

.history {
  text-align: center;
  margin-bottom: 20px;
}

.history button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  margin: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: 0.2s ease-in-out;
}

.history button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.current-weather {
  text-align: center;
  margin-bottom: 20px;
}

.weather-icon {
  width: 100px;
  height: 100px;
}

.current-weather p {
  margin-top: 8px;
  font-size: 1rem;
}

.forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
}

.day {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  transition: 0.3s;
}

.day:hover {
  transform: scale(1.05);
}

.day img {
  width: 50px;
}

.map {
  height: 300px;
  margin-top: 30px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.error {
  color: #ff4d4f;
  text-align: center;
  margin-top: 15px;
  font-weight: bold;
}

@media (max-width: 768px) {
  input {
    width: 100%;
  }

  .search-box {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
.hourly-forecast {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.hour-box {
  background: rgba(255, 255, 255, 0.15);
  padding: 10px;
  border-radius: 12px;
  min-width: 100px;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hour-box img {
  width: 40px;
}
.current-weather p:last-child {
  border-top: 1px solid #ccc;
  padding-top: 10px;
  margin-top: 10px;
}
canvas#tempChart {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.hourly-forecast {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  margin-top: 20px;
  padding-bottom: 10px;
}

.hour-block {
  min-width: 100px;
  background: #ffffff10;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  color: white;
  flex-shrink: 0;
  backdrop-filter: blur(5px);
}

.hour-block img {
  width: 40px;
  height: 40px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-top: -10px;
}

.switch input { display: none; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Dark Mode Styles */
body.dark-mode {
  background: #1e1e1e;
  color: #f0f0f0;
}

body.dark-mode .container {
  background: rgba(30, 30, 30, 0.9);
}

body.dark-mode input,
body.dark-mode button {
  background-color: #333;
  color: #fff;
  border-color: #555;
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(24px);
}
body.dark-mode .day,
body.dark-mode .hour-block {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

body.dark-mode .forecast .day:hover,
body.dark-mode .hour-block:hover {
  transform: scale(1.05);
}

body.dark-mode canvas#tempChart {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

body.dark-mode .map {
  filter: grayscale(1);
  border: 1px solid #555;
}

body.dark-mode .history button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.dark-mode .history button:hover {
  background: rgba(255, 255, 255, 0.2);
}
.search-box button {
  margin-top: 5px;
}


