/* =========================
   RESET & BASE
========================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", system-ui, sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #ffffff;
}

/* =========================
   WRAPPER
========================= */
.wrapper {
  max-width: 900px;
  margin: auto;
  padding: 1.5rem;
}

/* =========================
   HEADER
========================= */
.app-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.app-header h1 {
  font-size: 2rem;
  letter-spacing: 1px;
}

.tagline {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* =========================
   TABS
========================= */
.tab-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.tabs {
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.tabs:hover {
  background: rgba(255, 255, 255, 0.3);
}

.tabs.current-tab {
  background: #00f5d4;
  color: #000;
  font-weight: 600;
}

/* =========================
   FAVORITES
========================= */
.favorites {
  margin: 1rem auto;
  text-align: center;
}

.favorites h3 {
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.favorite-list {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
}

.favorite-list li {
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.favorite-list li:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* =========================
   MAIN CONTAINER
========================= */
.weather-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* =========================
   COMMON SUB CONTAINER
========================= */
.sub-container {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
}

.sub-container.active {
  display: flex;
}

/* =========================
   LOCATION PERMISSION
========================= */
.location-container img {
  width: 100px;
}

.location-container h2 {
  font-size: 1.5rem;
}

.location-container p {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* =========================
   BUTTON
========================= */
.btn {
  background: #00f5d4;
  border: none;
  color: #000;
  padding: 10px 26px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.btn:hover {
  transform: scale(1.05);
}

.icon-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.save-btn {
  background: #ffd166;
}

/* =========================
   SEARCH FORM
========================= */
.form-container {
  display: none;
  gap: 10px;
  max-width: 500px;
  margin: auto;
}

.form-container.active {
  display: flex;
}

.form-container input {
  flex: 1;
  border: none;
  outline: none;
  height: 45px;
  padding: 0 18px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.form-container input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* =========================
   LOADER
========================= */
.loading-container img {
  width: 110px;
}

.loading-container p {
  letter-spacing: 2px;
  opacity: 0.8;
}

/* =========================
   WEATHER INFO
========================= */
.weather-info img[weatherIcon] {
  width: 90px;
}

.location-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-title h2 {
  font-size: 2rem;
  font-weight: 600;
}

.location-title img {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}

.weather-info p[weatherDescr] {
  font-size: 1.3rem;
  opacity: 0.85;
}

.weather-info h3[weatherTemp] {
  font-size: 3rem;
  font-weight: 700;
}

/* =========================
   WEATHER STATS CARDS
========================= */
.cards-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.5rem;
}

.card {
  width: 150px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
}

.card img {
  width: 40px;
  margin-bottom: 0.5rem;
}

.card span {
  font-size: 0.85rem;
  opacity: 0.8;
}

.card strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 0.3rem;
}

/* =========================
   FORECAST
========================= */
.forecast-container {
  display: none;
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 16px;
}

.forecast-container.active {
  display: block;
}

.forecast-container h3 {
  text-align: center;
  margin-bottom: 1.2rem;
}

.forecast-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.forecast-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.forecast-card:hover {
  transform: translateY(-6px);
}

.forecast-card .day {
  font-size: 0.9rem;
  font-weight: 600;
}

.forecast-card img {
  width: 50px;
}

.forecast-card .temp {
  font-weight: bold;
  margin-top: 0.3rem;
}

.forecast-card .desc {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* =========================
   ERROR
========================= */
.error {
  display: none;
  text-align: center;
  color: #ff6b6b;
  font-size: 1.1rem;
}

.error.active {
  display: block;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .cards-container {
    gap: 0.8rem;
  }

  .card {
    width: 130px;
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.6rem;
  }

  .weather-info h3[weatherTemp] {
    font-size: 2.5rem;
  }

  .forecast-container {
    padding: 1rem;
  }
}
