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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #05060a;
  color: #f5f5f5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #222;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  background: #070812;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.1rem;
}

.accent {
  color: #16a4ff;
}

nav.nav {
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
}

nav.nav a {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #ccc;
}

nav.nav a.active,
nav.nav a:hover {
  border-color: #16a4ff;
  color: #f5f5f5;
}

/* Form de recherche */

#search-form {
  display: flex;
  gap: 0.5rem;
}

#search-input {
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #333;
  background: #0e1018;
  color: #fff;
  min-width: 200px;
}

#search-input:focus {
  outline: none;
  border-color: #16a4ff;
}

.btn {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #333;
  background: #10121d;
  color: #f5f5f5;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

main {
  padding: 1rem 1.5rem 3.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

#status {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: #aaa;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.card {
  background: #0c0f1a;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #151827;
  display: block;
}

.card-body {
  padding: 0.6rem 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.meta {
  font-size: 0.8rem;
  color: #aaa;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
}

.rating {
  font-weight: 600;
}

.overview {
  font-size: 0.78rem;
  color: #c5c5c5;
  margin-top: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pagination */

#pagination {
  margin-top: 1.5rem;
  display: none; /* affiché en JS si nécessaire */
  justify-content: center;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: #ccc;
}

#pagination button {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #333;
  background: #10121d;
  color: #f5f5f5;
  cursor: pointer;
  min-width: 70px;
}

#pagination button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Détail */

.detail-card {
  background: #0c0f1a;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.detail-poster {
  flex: 0 0 220px;
}

.detail-poster img,
.detail-poster-placeholder {
  width: 100%;
  border-radius: 0.75rem;
  background: #151827;
}

.detail-main {
  flex: 1 1 260px;
  min-width: 0;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.detail-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #bbb;
  margin-bottom: 0.5rem;
}

.detail-tagline {
  font-size: 0.9rem;
  font-style: italic;
  color: #ccc;
  margin-bottom: 0.5rem;
}

.detail-meta {
  font-size: 0.85rem;
  color: #ccc;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-overview {
  font-size: 0.9rem;
  color: #ddd;
  margin-top: 0.6rem;
}

.detail-links {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Footer */

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 1.5rem;
  border-top: 1px solid #111;
  background: rgba(5, 6, 10, 0.96);
  font-size: 0.75rem;
  color: #888;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
}

/* Responsive */

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  nav.nav {
    order: 3;
  }

  #search-form {
    width: 100%;
  }

  #search-input {
    flex: 1;
    width: 100%;
  }

  main {
    padding-inline: 1rem;
  }

  footer {
    font-size: 0.7rem;
    padding-inline: 1rem;
  }

  .detail-header {
    flex-direction: column;
  }

  .detail-poster {
    max-width: 260px;
  }
}
