/* ─────────────────────────────────────────────
   Skycast — Clean Minimalist Stylesheet
   ───────────────────────────────────────────── */

/* ── Design Tokens ── */
:root {
  --bg:         #f5f5f5;
  --white:      #ffffff;
  --border:     #e0e0e0;
  --accent:     #2563eb;
  --accent-hover: #1d4ed8;
  --text-1:     #111111;
  --text-2:     #555555;
  --text-3:     #999999;
  --error:      #dc2626;
  --font:       'Inter', sans-serif;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 2px 12px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
}

.logo-icon {
  font-size: 1.2rem;
}

.header-tag {
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ── Main Layout ── */
.main {
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}

/* ── Search Section ── */
.search-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.search-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.search-headline {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-1);
  margin-bottom: 2rem;
}

.search-headline em {
  font-style: normal;
  color: var(--text-2);
}

/* ── Search Form ── */
.search-form {
  width: 100%;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  gap: 0.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}

.city-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.4rem 0;
}

.city-input::placeholder {
  color: var(--text-3);
}

.submit-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.2rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.submit-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.submit-btn:active {
  transform: translateY(0);
}

.btn-arrow {
  width: 14px;
  height: 14px;
}

.error-msg {
  color: var(--error);
  font-size: 0.82rem;
  margin-top: 0.6rem;
  text-align: left;
  min-height: 1.2em;
}

/* ── Result Section ── */
.result-section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.result-section.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Weather Card ── */
.weather-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Card Header ── */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-location {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-city {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
}

.card-country {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

.card-time {
  font-size: 0.75rem;
  color: var(--text-3);
  text-align: right;
}

/* ── Card Body ── */
.card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 1.5rem;
  gap: 1rem;
}

.card-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.weather-icon-wrap {
  width: 64px;
  height: 64px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  line-height: 1;
}

.card-condition {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
}

.card-right {
  text-align: right;
}

.temp-display {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-bottom: 0.3rem;
}

.temp-value {
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-1);
}

.temp-units {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.4rem;
}

.unit-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}

.unit-btn.active,
.unit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}

.temp-feel {
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.1rem 0.5rem;
  border-right: 1px solid var(--border);
  transition: background var(--transition);
}

.stat-item:last-child {
  border-right: none;
}

.stat-item:hover {
  background: var(--bg);
}

.stat-icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  font-weight: 600;
}

.stat-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
}

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .header { padding: 0.9rem 1rem; }
  .header-tag { display: none; }
  .main { padding: 2rem 1rem 4rem; }
  .search-headline { font-size: 1.7rem; }
  .input-wrap { flex-wrap: wrap; }
  .city-input { width: 100%; order: 2; }
  .input-icon { order: 1; }
  .submit-btn { width: 100%; justify-content: center; order: 3; }
  .card-header, .card-body { padding: 1.1rem; }
  .card-city { font-size: 1.25rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(3) { border-top: 1px solid var(--border); }
  .stat-item:nth-child(4) { border-top: 1px solid var(--border); border-right: none; }
}