/* General styles */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

h1 {
  text-align: center;
  margin-bottom: 0;
}

/* Search box styles */
.search-box {
  margin: 1rem auto; /* Center the search box horizontally */
  display: flex;
  justify-content: center;
  align-items: center; /* Ensure vertical alignment */
  gap: 0.5rem;
  width: fit-content; /* Adjust width to fit content */
}

.search-box input {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  width: 300px;
  height: auto; /* Ensures consistent height */
}

.search-box .clear-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 0.5rem;
  display: none;
}

.search-box .clear-btn.active {
  display: inline;
}

.search-box button {
  margin-left: 0.5rem;
}

.suggestion-box {
  display: none; /* Initially hidden */
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  max-height: 200px;
  overflow-y: auto;
  width: 300px;
  z-index: 1000;
  margin-top: 0.5rem; /* Adjusted for spacing below search box */
  left: 50%; /* Center align with h1 */
  transform: translateX(-50%); /* Center align with h1 */
}

.suggestion-box.visible {
  display: block; /* Visible when active */
}

.suggestion-item {
  padding: 0.5rem;
  cursor: pointer;
}

.suggestion-item:hover {
  background-color: #f0f0f0;
}

/* Grid styles */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.card {
  background: white;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card img {
  max-width: 100%;
  height: auto;
}

.card .id {
  font-size: 0.75rem;
  color: #666;
}

/* Loading styles */
.loading {
  display: none;
  text-align: center;
  margin: 2rem 0;
}

.loading.active {
  display: block;
}

/* Button styles */
button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Load More button styles */
.load-more-btn {
  display: block;
  margin: 1rem auto; /* Center the button horizontally */
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--accent, #007bff);
  color: white;
  cursor: pointer;
  text-align: center;
}

.load-more-btn:hover {
  background: var(--accent-hover, #0056b3);
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.detail-card {
  background: white;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-width: 300px;
}