* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(to bottom, #eef4ff, #f8fbff);
  color: #1f2937;
  min-height: 100vh;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  padding: 3.5rem 0 3rem;
  text-align: center;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.18);
}

.site-header h1 {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.subtitle {
  margin: 0.8rem auto 0.4rem;
  max-width: 680px;
  font-size: 1.05rem;
  color: #e0e7ff;
}

.header-note {
  margin: 0;
  font-size: 0.95rem;
  color: #dbeafe;
}

.search-section {
  margin: 2rem 0 1rem;
}

.search-form {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-form input {
  flex: 1;
  min-width: 240px;
  padding: 1rem 1.1rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  background: white;
}

.search-form input:focus {
  outline: 3px solid rgba(124, 58, 237, 0.25);
}

.search-form button,
.genre-btn,
.small-btn {
  padding: 1rem 1.4rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-form button:hover,
.genre-btn:hover,
.small-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.25);
}

.search-form button:focus,
.genre-btn:focus,
.small-btn:focus {
  outline: 3px solid rgba(37, 99, 235, 0.25);
}

.clear-btn,
.small-btn {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.section-title {
  margin: 1.5rem 0 1rem;
  font-size: 1.35rem;
  color: #1f2937;
}

.genre-buttons {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.genre-btn {
  padding: 0.8rem 1.1rem;
  font-size: 0.95rem;
  white-space: nowrap;
}

.status-section {
  min-height: 4.5rem;
  margin-bottom: 1rem;
}

.status-message {
  font-weight: 600;
  font-size: 1rem;
  color: #374151;
  text-align: center;
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid #dbeafe;
  border-top: 5px solid #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1rem auto;
}

.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.featured-section {
  margin-bottom: 2rem;
}

.featured-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.4rem;
  background: white;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.featured-image {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  background: #e5e7eb;
}

.featured-placeholder {
  min-height: 420px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  color: #3730a3;
  font-weight: 600;
}

.featured-content {
  padding: 1.4rem 1.4rem 1.4rem 0;
}

.featured-content h3 {
  margin-top: 0;
  margin-bottom: 0.7rem;
  font-size: 1.8rem;
}

.featured-summary {
  line-height: 1.7;
  color: #4b5563;
  margin-top: 1rem;
}

.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.favorites-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.4rem;
  padding-bottom: 2rem;
}

.empty-favorites {
  background: white;
  padding: 1rem;
  border-radius: 16px;
  color: #6b7280;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.14);
}

.card img {
  width: 100%;
  height: 390px;
  object-fit: cover;
  background: #e5e7eb;
}

.empty-image {
  width: 100%;
  height: 390px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  color: #3730a3;
  font-weight: 600;
  font-size: 1rem;
}

.card-content {
  padding: 1.1rem;
}

.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.meta {
  margin: 0.35rem 0;
  font-size: 0.95rem;
  color: #374151;
}

.badges {
  margin: 0.55rem 0 0.9rem;
}

.badge {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  padding: 0.35rem 0.65rem;
  margin: 0.2rem 0.25rem 0 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}

.summary {
  margin-top: 0.9rem;
  line-height: 1.6;
  font-size: 0.95rem;
  color: #4b5563;
}

.card a,
.featured-card a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.card a:hover,
.featured-card a:hover {
  text-decoration: underline;
}

.card-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.action-btn {
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  background: #eef2ff;
  color: #4338ca;
}

.action-btn:hover {
  background: #dbeafe;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: #6b7280;
  font-size: 0.95rem;
}

.sr-only {
  position: absolute;
  left: -9999px;
}

@media (max-width: 850px) {
  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-content {
    padding: 1.2rem;
  }

  .featured-image,
  .featured-placeholder {
    min-height: 340px;
  }
}

@media (max-width: 700px) {
  .site-header {
    padding: 2.7rem 0 2.4rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 0.98rem;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form button,
  .search-form input {
    width: 100%;
  }

  .genre-buttons {
    justify-content: center;
  }

  .section-title,
  .status-message {
    text-align: center;
  }

  .card img,
  .empty-image {
    height: 340px;
  }
}