/* ============================================================
   🌤 WEATHERICA — MAIN STYLESHEET
   Clean structure · Glassmorphism · Responsive
   ============================================================ */

/* ------------------------------------------------------------
   1. RESET & BASE
------------------------------------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Poppins', Arial, sans-serif;
  background: linear-gradient(to right, #00264d, #0052cc);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.container {
  max-width: 980px;
  width: 96%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: fadeIn 1.2s ease-in-out;
  position: relative;
}

/* ------------------------------------------------------------
   2. HEADER + NAV
------------------------------------------------------------ */
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1 {
  font-size: 2.4rem;
  color: #ffd700;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}

/* Favorites Button */
.btn-favs {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  padding: 8px 12px;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.btn-favs:hover {
  background: rgba(255, 255, 255, 0.1);
}

.fav-badge {
  background: #ff7b7b;
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.75rem;
}

/* ------------------------------------------------------------
   3. LOCATION INPUT + AUTOCOMPLETE
------------------------------------------------------------ */
.location-input {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 18px 0 8px 0;
  gap: 12px;
  position: relative;
}

.location-input input {
  padding: 12px 16px;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  outline: none;
  width: 70%;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.22s ease;
}

.location-input input:focus {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45),
              0 0 10px rgba(255, 215, 0, 0.08);
}

.location-input button {
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, #4f4f5b, #e98574);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.location-input button:hover {
  transform: translateY(-3px);
}

/* Suggestions Dropdown */
.suggestions-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 8px);
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 1200;
  width: 70%;
  max-height: 320px;
  overflow-y: auto;
}

.wa-suggestion {
  padding: 10px 14px;
  cursor: pointer;
  color: #ffd700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease;
}

.wa-suggestion:hover,
.wa-suggestion.selected {
  background: rgba(255, 215, 0, 0.12);
}

/* ------------------------------------------------------------
   4. DAILY FORECAST
------------------------------------------------------------ */
.weather-display {
  margin-top: 16px;
  min-height: 120px;
}

.wa-daily {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(180deg,
              rgba(255, 255, 255, 0.02),
              rgba(255, 255, 255, 0.01));
}

.wa-header { text-align: left; }

.wa-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.wa-title-row h3 {
  color: #ffd700;
  font-size: 1.1rem;
}

.wa-date {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-top: 6px;
}

.wa-body {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.wa-icon {
  width: 110px;
  height: 110px;
}

.wa-info { text-align: left; }

.wa-desc { font-weight: 600; margin-bottom: 6px; }

.wa-temps {
  color: #ffd700;
  font-weight: 700;
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.wa-feels { color: rgba(255, 255, 255, 0.9); }

/* Daily metrics */
.wa-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.wa-metric {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.metric-icon { font-size: 1.1rem; margin-bottom: 4px; }
.metric-label { font-size: 0.85rem; color: rgba(255,255,255,0.8); }
.metric-value { font-weight: 700; color: #fff; }

/* ------------------------------------------------------------
   5. HOURLY FORECAST
------------------------------------------------------------ */
.hourly-forecast {
  margin-top: 18px;
  text-align: left;
}

.wa-hourly-title {
  font-size: 1rem;
  color: #ffd700;
  margin: 6px 6px 12px 6px;
  font-weight: 700;
}

.wa-hourly-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.wa-hour-card {
  min-width: 96px;
  max-width: 110px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  flex: 0 0 auto;
  scroll-snap-align: start;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease, background 0.18s ease;
}

.wa-hour-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.06);
}

.hour-time {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 6px;
}

.hour-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
}

.hour-temp {
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 4px;
}

.hour-precip {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.wa-hourly-scroll::-webkit-scrollbar { height: 8px; }
.wa-hourly-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

/* ------------------------------------------------------------
   6. WEEKLY FORECAST
------------------------------------------------------------ */
.weekly-forecast, .wa-weekly-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
}

.wa-day-card {
  width: 120px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.22s, background 0.22s, box-shadow 0.22s;
  cursor: pointer;
}

.wa-day-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.wa-day-date { font-weight: 700; color: #ffd700; margin-bottom: 6px; }
.wa-day-icon { width: 56px; height: 56px; margin-bottom: 6px; }
.wa-day-desc { font-size: 0.85rem; margin-bottom: 6px; }

/* ------------------------------------------------------------
   7. FAVORITES PANEL (ЗАКЛАДКИ)
------------------------------------------------------------ */
.favorites-panel {
  position: fixed;
  right: 18px;
  top: 18px;
  width: 320px;
  max-width: calc(100% - 40px);
  background: rgba(10, 10, 10, 0.9);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  z-index: 1500;
  overflow: hidden;
  transform: translateY(-20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.favorites-panel.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.favorites-panel-inner { padding: 12px; }

.fav-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fav-panel-header h3 {
  color: #ffd700;
  font-size: 1rem;
}

.fav-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.favorites-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow: auto;
}

.wa-favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.fav-load-btn {
  border: none;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s ease;
}

.fav-load-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------
   8. SYSTEM STATES
------------------------------------------------------------ */
.wa-loading {
  text-align: center;
  padding: 18px 0;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top: 4px solid #ffd700;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 1s linear infinite;
  margin: 8px auto;
}

.wa-error {
  color: #ff7777;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px;
}

/* ------------------------------------------------------------
   9. FOOTER
------------------------------------------------------------ */
footer {
  position: fixed;
  bottom: 12px;
  font-size: 0.9rem;
  color: #ccc;
  left: 50%;
  transform: translateX(-50%);
}

footer a {
  color: #ffd700;
  text-decoration: none;
}

/* ------------------------------------------------------------
   10. ANIMATIONS
------------------------------------------------------------ */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(.98); }
  to   { opacity: 1; transform: scale(1); }
}

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

/* ------------------------------------------------------------
   11. RESPONSIVE DESIGN
------------------------------------------------------------ */
@media (max-width: 920px) {
  .wa-daily { grid-template-columns: 1fr; }
  .wa-metrics { grid-template-columns: repeat(2, 1fr); }
  .location-input input { width: 66%; }
  .suggestions-container { width: 86%; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .location-input { flex-direction: column; gap: 10px; }
  .location-input input { width: 100%; }
  .wa-hour-card { min-width: 86px; max-width: 92px; padding: 8px; }
  .wa-metrics { grid-template-columns: 1fr; }
  .favorites-panel { width: 92%; left: 4%; right: 4%; top: 60px; }
}

@media (max-width: 420px) {
  .wa-hour-card { min-width: 76px; max-width: 80px; font-size: 0.88rem; }
  .wa-icon { width: 88px; height: 88px; }
}
