* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #e8f4fd;
  color: #333;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #1e90ff;
  color: white;
  padding: 1rem;
  text-align: center;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s;
}

nav a:hover {
  background: rgba(255,255,255,0.2);
}

main {
  max-width: 800px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}

.search-section {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.search-section input,
.search-section select {
  flex: 1;
  min-width: 120px;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.search-section button {
  padding: 0.6rem 1.2rem;
  background: #1e90ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.search-section button:hover {
  background: #0070d2;
}

.weather-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.weather-card h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.weather-card img {
  width: 80px;
  max-width: 100%;
  margin: 0 auto;
}

.weather-card p {
  font-size: 1.1rem;
  margin: 0.4rem 0;
}

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

.forecast-card {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.forecast-card img {
  max-width: 100%;
  margin: 0 auto;
}

.forecast-card p {
  margin: 0.2rem 0;
  font-size: 0.95rem;
}

.about-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  line-height: 1.8;
}

.about-section p {
  margin-bottom: 0.8rem;
}

.about-section a {
  color: #1e90ff;
}

#loading {
  text-align: center;
  font-size: 1.2rem;
  color: #1e90ff;
  padding: 2rem;
}

#error {
  text-align: center;
  color: #c0392b;
  font-size: 1.1rem;
  background: #fdecea;
  border-radius: 8px;
  padding: 1rem;
}

#empty {
  text-align: center;
  color: #888;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 1rem;
  font-size: 1rem;
}

.hidden {
  display: none !important;
}

footer {
  text-align: center;
  padding: 1rem;
  background: #1e90ff;
  color: white;
  margin-top: auto;
}

/* === Tablet === */
@media (max-width: 900px) {
  main {
    padding: 0 0.8rem;
  }
}

/* === Mobile === */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.3rem;
  }

  nav {
    gap: 0.4rem;
    font-size: 0.9rem;
  }

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

  .weather-card h2 {
    font-size: 1.4rem;
  }

  .search-section input,
  .search-section select,
  .search-section button {
    width: 100%;
    flex: none;
  }
}
