@import url("./font/font.css");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", "Vazirmatn", sans-serif;
}

body {
  min-height: 100vh;
  padding: 28px;
  color: #efeaff;
  background: radial-gradient(ellipse at center, #1b1430 0%, #120e1e 70%);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: #efeaff;
}

.logo img {
  width: 30px;
  height: 30px;
}

.btn,
.search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border: none;
  padding: 12px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
  transition: background 0.2s;
}

.btn:hover,
.search-btn:hover {
  background: linear-gradient(135deg, #9d70ff, #7c3aed);
}

/* ---------- Hero card ---------- */
.hero {
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.16), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 24px;
  padding: 30px 34px;
  backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.hero-left h2 {
  font-size: 30px;
  font-weight: 600;
}

.location {
  font-size: 14px;
  color: #9d92c4;
  margin-top: 4px;
}

.hero-left .sub {
  color: #9d92c4;
  font-size: 14px;
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot-separator {
  color: #8f84b8;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
  font-size: 14px;
  font-weight: 600;
}

.hero-right {
  text-align: center;
}

.hero .temp {
  font-size: 72px;
  font-weight: 600;
  letter-spacing: -4px;
  line-height: 1;
  background: linear-gradient(180deg, #fff, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hi-lo {
  margin-top: 10px;
  color: #9d92c4;
  font-size: 15px;
  display: flex;
  gap: 14px;
  justify-content: center;
}

.description-image {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 10px 25px rgba(167, 139, 250, 0.35));
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
  min-width: 0;
}

.stat {
  min-width: 0;
}

.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.static-icon {
  width: 26px;
  height: 26px;
  opacity: 0.9;
}

.stat .v {
  font-size: 20px;
  font-weight: 600;
  margin-top: 8px;
}

.stat .k {
  color: #8f84b8;
  font-size: 12px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* combined sunrise / sunset card */
.sun-stat {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 8px;
  min-width: 0;
}

.stat-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.part-divider {
  width: 1px;
  align-self: stretch;
  margin-bottom: 4px;
  background: rgba(167, 139, 250, 0.25);
}

/* ---------- 7-day forecast ---------- */
.forecast {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 22px;
  padding: 20px 24px;
}

.forecast h3 {
  font-size: 12px;
  color: #8f84b8;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.days {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.day {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.day p {
  font-size: 14px;
  color: #9d92c4;
}

/* day name (first p in .day) */
.day p:nth-of-type(1) {
  width: 70px;
  font-weight: 600;
  color: #efeaff;
  text-align: left;
}

.day img {
  width: 42px;
  height: 42px;
  margin: 0 4px;
}

/* max temp rendered as 2nd p in .day */
.day p:nth-of-type(2) {
  font-size: 18px;
  font-weight: 700;
  color: #e7ecf5;
}

/* min temp rendered as 3rd p in .day */
.day p:nth-of-type(3) {
  font-size: 14px;
  color: #8f84b8;
}

/* ---------- Modal ---------- */
#modal {
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 22px;
  margin-inline: auto;
  margin-top:20px;
  padding: 0;
  width: 440px;
  max-width: 90vw;
  color: #efeaff;
  background: linear-gradient(160deg, #1d1430, #150f24);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

#modal::backdrop {
  background: rgba(10, 6, 18, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  padding: 28px;
}

.modal-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #c4b5fd;
  margin-bottom: 18px;
}

.modal-content form {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}

.search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 12px;
  padding: 11px 14px;
  color: #efeaff;
  font-size: 14px;
  outline: none;
}

.search-input::placeholder {
  color: #7a6f99;
}

.search-input:focus {
  border-color: rgba(167, 139, 250, 0.6);
}

#close-modal {
  background: transparent;
  border: none;
  color: #8f84b8;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 2px;
}

#close-modal:hover {
  color: #efeaff;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    gap: 14px;
  }

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

  .hero-left .sub {
    justify-content: center;
  }

  .description-image {
    order: -1;
    width: 90px;
    height: 90px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .days {
    /* grid-template-columns: repeat(2, 1fr); */
  }

  /* .day {
    flex-direction: column;
    gap: 6px;
    padding: 14px 6px;
  } */

  .day p:nth-of-type(1) {
    width: auto;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #9d92c4;
  }

  .day img {
    width: 36px;
    height: 36px;
    margin: 2px;
  }

  .day p:nth-of-type(2) {
    font-size: 15px;
    font-weight: 600;
  }

  .day p:nth-of-type(3) {
    font-size: 12px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .days {
    grid-template-columns: 1fr;
  }
}
