@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
  --bg-light: url('assets/bg.jpg');
  --bg-dark: url('assets/bg-night.png');

  --color-text-light: white;
  --color-text-dark: #eaeaea;

  --glass-light: rgba(255, 255, 255, 0.2);
  --glass-dark: rgba(0, 0, 0, 0.35);

  --blur: blur(10px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  color: var(--color-text-light);
}

body {
  background: var(--bg-light) no-repeat center/cover;
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease;
  position: relative;
}

body.theme-dark {
  background: var(--bg-dark) no-repeat center/cover;
  --color-text-light: var(--color-text-dark);
}

body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: var(--blur);
  z-index: 0;
}

.main-container {
  position: relative;
  z-index: 1;
  width: 320px;
  min-height: 520px;
  background: linear-gradient(to top, var(--glass-dark), var(--glass-light));
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(100px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: softPulse 6s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  border-radius: 99px;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #2196F3;
}
input:checked + .slider:before {
  transform: translateX(24px);
}

/* Input */
.input-container {
  position: relative;
}
.city-input {
  width: 100%;
  padding: 10px 16px;
  padding-right: 45px;
  border-radius: 99px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 500;
  outline: none;
  transition: border 0.25s, box-shadow 0.3s;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}
.city-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}
.city-input:focus {
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.35);
}
.search-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
}
.search-btn span {
  font-size: 24px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease, text-shadow 0.3s ease;
}
.search-btn:hover span {
  transform: scale(1.2);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
}

/* Weather Info */
.weather-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.location-date-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.location {
  display: flex;
  align-items: center;
  gap: 6px;
}
.weather-summary-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.weather-summary-img {
  width: 120px;
  height: 120px;
}
.pulseGlow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}
.weather-summary-info {
  text-align: right;
}
.weather-conditions-container {
  display: flex;
  justify-content: space-between;
}
.condition-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.condition-item span {
  font-size: 28px;
}
.forecast-items-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.forecast-items-container::-webkit-scrollbar {
  display: none;
}
.forecast-item {
  min-width: 70px;
  background: rgba(255, 255, 255, 0.15);
  padding: 10px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: background 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
}
.forecast-item:hover {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}
.forecast-item-img {
  width: 36px;
  height: 36px;
}
.regular-txt {
  font-weight: 400;
}

/* Message Sections */
.section-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
  margin-top: 20%;
}
.section-message img {
  height: 180px;
  width: auto;
}

/* Weather Animation Layer */
#weather-animation {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-repeat: repeat;
  background-position: center;
  opacity: 0.25;
  animation: moveAnimation 20s linear infinite;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Glowing Icon */
.material-symbols-outlined {
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes moveAnimation {
  0% { background-position: 0 0; }
  100% { background-position: 1000px 1000px; }
}
@keyframes pulseGlow {
  0% { filter: drop-shadow(0 0 0px rgba(255,255,255,0.4)); }
  50% { filter: drop-shadow(0 0 10px rgba(255,255,255,0.8)); }
  100% { filter: drop-shadow(0 0 0px rgba(255,255,255,0.4)); }
}
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255,255,255,0.1); }
  50% { box-shadow: 0 0 35px rgba(255,255,255,0.25); }
}

/* Responsive */
@media (max-width: 400px) {
  .main-container {
    width: 90%;
    min-height: auto;
    padding: 16px;
  }

  .weather-summary-container {
    flex-direction: column;
    align-items: center;
  }

  .weather-summary-info {
    text-align: center;
  }
}