/* ================= Base Styles (already good) ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #f5faff;
  color: #333;
  line-height: 1.5;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  padding: 20px 0;
  text-align: center;
}

/* Header */
header h1 {
  font-size: 2.2rem;
  color: #0077b6;
}

header p {
  font-size: 1rem;
  margin: 5px 0;
  color: #555;
}

.data-source {
  font-size: 0.9rem;
  color: #666;
}

.data-source a {
  text-decoration: none;
  color: #0096c7;
  font-weight: bold;
}

/* Search Box */
.search-box {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap; /* makes it stack on small screens */
}

.search-box input {
  padding: 10px 15px;
  width: 300px;
  max-width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  font-size: 1rem;
}

.search-box button {
  padding: 10px 20px;
  border: none;
  background: #0077b6;
  color: #fff;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.search-box button:hover {
  background: #0096c7;
}

/* Results Section */
.results {
  margin-top: 20px;
  text-align: left;
}

.results h2 {
  margin-bottom: 15px;
  color: #444;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

/* Individual Card */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s;
  text-align: center;
}

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

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card h3 {
  margin: 10px 0;
  font-size: 1.1rem;
  color: #222;
}

.card .tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  font-size: 0.85rem;
  background: #caf0f8;
  color: #0077b6;
  border-radius: 20px;
}

.view {
  margin-bottom: 10px;
  font-size: 15px;
  color: #0077b6;
  font-weight: 500;
  cursor: pointer;
}

/* ================= RESPONSIVE BREAKPOINTS ================= */

/* For tablets */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  .search-box input {
    width: 250px;
  }

  .card img {
    height: 140px;
  }
}

/* For small mobile screens */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 0.9rem;
  }

  .search-box {
    flex-direction: column;
    align-items: center;
  }

  .search-box input,
  .search-box button {
    width: 100%;
    max-width: 100%;
  }

  .card-grid {
    grid-template-columns: 1fr; /* one card per row */
  }

  .card img {
    height: 120px;
  }

  .card h3 {
    font-size: 1rem;
  }

  .view {
    font-size: 14px;
  }
}
