/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* ===== Theme Colors ===== */
:root {
  --primary: #12B6FE;
  --secondary: #06469A;
  --accent: #ffb703;
  --dark: #000E29;
  --light: #caf0f8;
  --card-bg: rgba(255, 255, 255, 0.15);
  --text-light: rgba(255, 255, 255, 0.9);
  --text-lighter: rgba(255, 255, 255, 0.7);
}

/* ===== Body ===== */
body {
  background: linear-gradient(135deg, var(--dark), var(--secondary), var(--primary));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 10px;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSg0NSkiPjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjAzKSIvPjwvZGVmcz48cmVjdCBmaWxsPSJ1cmwoI3BhdHRlcm4pIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIi8+PC9zdmc+');
  z-index: -1;
}

/* ===== Header ===== */
header {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 20px;
  animation: fadeIn 1s ease forwards;
}

header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  margin-bottom: 5px;
}

header p {
  font-size: 1.1rem;
  color: var(--text-lighter);
  font-weight: 300;
}

/* ===== Search Box ===== */
.search-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 25px;
  animation: fadeInUp 1s ease forwards;
  width: 100%;
  max-width: 500px;
  flex-wrap: wrap;
}

.search-box input {
  padding: 15px 20px;
  font-size: 1rem;
  border-radius: 15px;
  border: none;
  outline: none;
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
}

.search-box input::placeholder {
  color: var(--text-lighter);
}

.search-box input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.search-box button {
  padding: 15px 20px;
  background-color: var(--accent);
  border: none;
  border-radius: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--dark);
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-box button:hover {
  background-color: #ffa000;
  transform: translateY(-2px);
}

/* ===== Quick Buttons ===== */
.quick-buttons {
  margin-bottom: 25px;
  text-align: center;
  animation: fadeInUp 1s ease forwards;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 500px;
}

.quick-buttons button {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  padding: 10px 18px;
  border-radius: 50px;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.quick-buttons button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* ===== Weather Card ===== */
.weather-card {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  padding: 30px;
  border-radius: 25px;
  text-align: center;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.5s ease;
}

.weather-card.show {
  opacity: 1;
  transform: translateY(0);
}

.weather-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.weather-icon img {
  width: 130px;
  height: 130px;
}

.temp {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 10px 0;
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 25px;
  text-align: left;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(5px);
}

/* ===== Forecast ===== */
.forecast {
  margin-top: 25px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.forecast-day {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  min-width: 90px;
  transition: 0.3s;
}

.forecast-day:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* ===== Loading Spinner ===== */
.loading {
  display: none;
  text-align: center;
  margin: 20px 0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto;
}

/* ===== Footer ===== */
footer {
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--text-lighter);
  text-align: center;
  padding: 20px;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ===== Animations ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .weather-card {
    width: 90%;
    padding: 25px 20px;
  }
  .details {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 2.2rem;
  }
}
