/* ==========================
   Weather App
========================== */

.weather-app {
  margin-top: 3rem;
  padding: 1.25rem;
  border: 1px solid rgba(128, 160, 255, 0.22);
  border-radius: 1.5rem;
  background: linear-gradient(145deg, rgba(24, 34, 68, 0.92), rgba(20, 24, 48, 0.92)), rgba(15, 23, 42, 0.8);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.28);
}

.weather-app-header {
  display: grid;
  gap: 0.75rem;
}

.weather-app-eyebrow {
  margin: 0;
  color: var(--color-accent, #7fa2ff);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.weather-app-header h2 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1;
}

.weather-app-header p {
  max-width: 38rem;
  margin: 0;
  color: rgba(238, 245, 255, 0.72);
  font-size: 1rem;
  line-height: 1.7;
}

/* ==========================
   Weather Form
========================== */

.weather-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.weather-search-row {
  display: grid;
  gap: 0.75rem;
}

.weather-input-wrap {
  position: relative;
}

.weather-search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  color: rgba(238, 245, 255, 0.5);
  font-size: 1.5rem;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.weather-input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1rem 0 2.75rem;
  border: 1px solid rgba(128, 160, 255, 0.24);
  border-radius: 1rem;
  background: rgba(6, 12, 28, 0.72);
  color: #f8fbff;
  font: inherit;
}

.weather-input::placeholder {
  color: rgba(238, 245, 255, 0.42);
}

.weather-input:focus {
  outline: none;
  border-color: rgba(127, 162, 255, 0.78);
  box-shadow: 0 0 0 0.2rem rgba(127, 162, 255, 0.16);
}

.weather-button {
  min-height: 3.25rem;
  padding: 0 1.15rem;
  border: 1px solid rgba(127, 162, 255, 0.42);
  border-radius: 1rem;
  background: rgba(127, 162, 255, 0.18);
  color: #dbe7ff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.weather-button:hover {
  background: rgba(127, 162, 255, 0.26);
}

.weather-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

/* ==========================
   Weather Status
========================== */

.weather-status {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(128, 160, 255, 0.18);
  border-radius: 1rem;
  background: rgba(6, 12, 28, 0.42);
  color: rgba(238, 245, 255, 0.68);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================
   Weather Status States
========================== */

.weather-status.is-error {
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(127, 29, 29, 0.22);
  color: rgba(255, 226, 226, 0.9);
}

.weather-status.is-loading {
  border-color: rgba(127, 162, 255, 0.35);
  background: rgba(127, 162, 255, 0.12);
  color: rgba(219, 231, 255, 0.92);
}

.weather-status.is-success {
  border-color: rgba(80, 220, 150, 0.32);
  background: rgba(20, 120, 75, 0.16);
  color: rgba(220, 255, 238, 0.92);
}

/* ==========================
   Weather Result
========================== */

.weather-result {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(128, 160, 255, 0.22);
  border-radius: 1.25rem;
  background: radial-gradient(circle at top right, rgba(127, 162, 255, 0.18), transparent 14rem), rgba(8, 16, 36, 0.72);
}

.weather-result-main {
  display: grid;
  gap: 1rem;
}

.weather-location {
  margin: 0;
  color: #f8fbff;
  font-size: 1.25rem;
  font-weight: 800;
}

.weather-condition {
  margin: 0.35rem 0 0;
  color: rgba(238, 245, 255, 0.68);
  font-size: 0.95rem;
}

.weather-temp {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(3rem, 16vw, 5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

/* ==========================
   Weather Details
========================== */

.weather-details {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.weather-detail-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid rgba(128, 160, 255, 0.16);
  border-radius: 1rem;
  background: rgba(6, 12, 28, 0.48);
}

.weather-detail-card span {
  color: rgba(238, 245, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weather-detail-card strong {
  color: #f8fbff;
  font-size: 1.15rem;
  line-height: 1.2;
}

/* ==========================
   Learning Note
========================== */

.weather-learning-note {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(128, 160, 255, 0.12);
  border-radius: 1rem;
  background: rgba(6, 12, 28, 0.22);
}

.weather-learning-note h3 {
  margin: 0;
  color: rgba(248, 251, 255, 0.88);
  font-size: 0.95rem;
}

.weather-learning-note p {
  margin: 0.4rem 0 0;
  color: rgba(238, 245, 255, 0.58);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ==========================
   Responsive Design
========================== */

@media (min-width: 768px) {
  /* Weather App */
  .weather-app {
    margin-top: 4rem;
    padding: 2rem;
  }

  /* Weather Form */
  .weather-form {
    margin-top: 2rem;
  }

  .weather-search-row {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .weather-button {
    min-width: 10rem;
  }

  /* Weather Result */
  .weather-result {
    padding: 1.5rem;
  }

  .weather-result-main {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .weather-temp {
    text-align: right;
  }

  /* Weather Details */
  .weather-details {
    grid-template-columns: repeat(3, 1fr);
  }
}
