@import url("https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700&display=swap");

:root {
  --bg:      #fff9f0;
  --surface: #ffffff;
  --border:  #f0e0c8;
  --accent:  #ff6b6b;
  --yellow:  #ffd93d;
  --green:   #6bcb77;
  --blue:    #4d96ff;
  --text:    #3d2c1e;
  --muted:   #a08060;
  --radius:  12px;
}

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

body {
  font-family: "Nunito", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  background: var(--accent);
  padding: 0 32px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08);
}

.logo {
  font-family: "Fredoka One", cursive;
  font-size: 1.6rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.03em;
}

nav ul { list-style: none; display: flex; gap: 8px; }

nav ul li a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 99px;
  transition: background 0.2s, color 0.2s;
}

nav ul li a:hover { background: rgba(255,255,255,0.2); color: #fff; }
nav ul li a.active { background: #fff; color: var(--accent); }

/* MAIN */
main {
  flex: 1;
  padding: 40px 32px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* HERO */
.hero {
  border-radius: 20px;
  background: linear-gradient(135deg, #ffe0e0 0%, #fff4cc 100%);
  border: 3px solid var(--yellow);
  padding: 60px 40px;
  text-align: center;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "stars";
  font-size: 0;
}

.hero-deco {
  position: absolute;
  font-size: 3rem;
  opacity: 0.18;
  pointer-events: none;
}
.hero-deco:nth-child(1) { top: 10px;  left: 20px;  transform: rotate(-15deg); }
.hero-deco:nth-child(2) { top: 15px;  right: 30px; transform: rotate(12deg); }
.hero-deco:nth-child(3) { bottom: 10px; left: 40px; transform: rotate(8deg); }
.hero-deco:nth-child(4) { bottom: 10px; right: 20px; transform: rotate(-10deg); }

.hero h1 {
  font-family: "Fredoka One", cursive;
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 10px;
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 28px;
  animation: popIn 0.5s 0.1s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* BOUTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 12px 26px;
  border-radius: 99px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  font-family: "Nunito", sans-serif;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: popIn 0.5s 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 rgba(0,0,0,0.12);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.btn-retour {
  background: var(--surface);
  color: var(--muted);
  border: 2px solid var(--border);
  box-shadow: 0 3px 0 var(--border);
  margin-bottom: 24px;
  animation: none;
  font-size: 0.9rem;
}

.btn-retour:hover {
  background: var(--bg);
  color: var(--text);
  transform: translateX(-3px);
  box-shadow: 0 3px 0 var(--border);
}

/* LISTING */
.listing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.listing-title {
  font-family: "Fredoka One", cursive;
  font-size: 2rem;
  color: var(--text);
}

.badge-count {
  background: var(--yellow);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 99px;
  margin-left: 10px;
  vertical-align: middle;
}

/* TABLE — desktop */
.table-wrap {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 0 var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

thead { background: var(--yellow); }

th {
  padding: 13px 16px;
  text-align: left;
  font-family: "Fredoka One", cursive;
  font-size: 0.88rem;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-top: 2px solid var(--border);
}

tbody tr { transition: background 0.15s; }
tbody tr:hover td { background: #fff8ee; }

.td-id { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.td-titre { font-weight: 700; font-size: 0.95rem; color: var(--accent); }
.td-annee { font-weight: 700; color: var(--blue); }
.film-thumb {
  width: 110px;
  height: 75px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.film-thumb:hover { transform: scale(1.08); }

/* FILM CARDS — mobile */
.film-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.film-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 3px 0 var(--border);
  transition: transform 0.15s, border-color 0.15s;
}

.film-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.film-card-thumb {
  width: 80px;
  min-width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.film-card-info { flex: 1; }

.film-card-titre {
  font-family: "Fredoka One", cursive;
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.film-card-meta {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
}

.film-card-meta strong { color: var(--text); }

.studio-badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* SEARCH FORM */
.search-box {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--border);
  padding: 36px 40px;
  max-width: 520px;
  margin: 0 auto;
}

.search-title {
  font-family: "Fredoka One", cursive;
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.search-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.error-message {
  background: #fff0f0;
  border: 2px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.search-form label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text);
}

.search-form input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 3px solid var(--border);
  border-radius: 12px;
  font-family: "Nunito", sans-serif;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.search-form input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,107,107,0.12);
}

.search-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-search {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: "Nunito", sans-serif;
}

/* SEARCH RESULTS */
.search-results-header {
  margin-bottom: 20px;
}

.search-query {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.no-result {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 16px;
}

.no-result span { font-size: 3rem; display: block; margin-bottom: 12px; }
.no-result p { color: var(--muted); font-size: 1rem; }

.search-bottom-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

/* FOOTER */
footer {
  background: var(--accent);
  text-align: center;
  padding: 16px 32px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  box-shadow: 0 -4px 0 rgba(0,0,0,0.06);
}

/* RESPONSIVE 576px */
@media (max-width: 576px) {
  header { flex-direction: column; height: auto; padding: 14px 20px; gap: 10px; }
  nav ul { flex-wrap: wrap; justify-content: center; gap: 6px; }
  main { padding: 24px 16px; }
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 2.2rem; }
  .listing-header { flex-direction: column; align-items: flex-start; }
  .film-cards { grid-template-columns: 1fr; }
}
