/* ============================================================
   STYLE.CSS — Inventaire Manga / Anime / Film
   ============================================================ */

/* ============================================================
   1. VARIABLES GLOBALES (Custom Properties)
   ============================================================ */
:root {
  --accent: #c084fc;
  --accent-2: #a855f7;
  --accent-glow: 0 0 24px rgba(168, 85, 247, 0.6);

  --bg: #050505;
  --bg-2: #111111;
  --card: #161616;
  --card-hover: #1e1e1e;
  --border: #3b1f5e;
  --border-strong: #c084fc;

  --text: #ffffff;
  --text-muted: #d1d1d1;
  --text-dim: #a1a1a1;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.8);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, 
*::before, 
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(168, 85, 247, 0.12), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(192, 132, 252, 0.10), transparent 60%),
    var(--bg);
}

h1, 
h2, 
h3, 
p { 
  color: var(--text); 
  text-decoration: none; 
  margin: 0; 
}

a { 
  color: var(--text); 
  text-decoration: none; 
}

/* ============================================================
   3. CLASSES UTILITAIRES (Marges, Alignements)
   ============================================================ */
.mt-40 { 
  margin-top: 40px; 
}

.mb-25 { 
  margin-bottom: 25px; 
}

.text-center { 
  text-align: center; 
}

.flex-between { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.pointer { 
  cursor: pointer; 
}

/* ============================================================
   4. ACCESSIBILITÉ : FOCUS VISIBLE
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

button:focus-visible,
.btn-filter:focus-visible,
.card:focus-visible { 
  outline-offset: 2px; 
}

/* ============================================================
   5. NAVIGATION PRINCIPALE
   ============================================================ */
.main-nav {
  background-color: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  width: 100%;
}

.main-nav a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s var(--ease), text-shadow 0.2s var(--ease);
}

.main-nav a:hover { 
  color: var(--text); 
  text-shadow: var(--accent-glow); 
}

.main-nav a.active { 
  color: var(--accent); 
  text-shadow: var(--accent-glow); 
}

/* ============================================================
   6. EN-TÊTES DE PAGES ET FOOTER GLOBAL
   ============================================================ */
.page-header { 
  padding: 20px 0; 
  margin-top: 15px; 
  text-align: center; 
}

.page-title { 
  color: white; 
  border-left: 4px solid var(--accent); 
  padding-left: 10px; 
  margin: 0; 
}

.page-subtitle { 
  color: var(--text-muted); 
  margin-top: 10px; 
}

.title-with-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: white; 
  margin: 0;
}

.header-logo {
  height: 45px; 
  width: auto;
  object-fit: contain;
}

.site-footer {
  margin-top: 60px; 
  padding: 30px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-2); 
  text-align: center;
  font-size: 0.85em; 
  color: var(--text-dim);
}

.site-footer p { 
  margin-bottom: 10px; 
}

.footer-link { 
  color: var(--accent); 
  text-decoration: none; 
  font-weight: 600; 
  transition: text-decoration 0.2s; 
}

.footer-link:hover { 
  text-decoration: underline; 
}

/* ============================================================
   7. CONTENEUR CENTRÉ
   ============================================================ */
.container { 
  max-width: 1280px; 
  margin: 0 auto; 
  padding: 0 24px; 
}

/* ============================================================
   8. PAGE ACCUEIL (HERO BANNER)
   ============================================================ */
.hero-banner { 
  position: relative; 
  height: 400px; 
  width: 100%; 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: center; 
  text-align: center; 
  overflow: hidden; 
  margin-bottom: 30px; 
  padding: 20px; 
}

.hero-video { 
  position: absolute; 
  top: 50%; 
  left: 50%; 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  transform: translate(-50%, -50%); 
  z-index: 1; 
}

.hero-overlay { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background: rgba(0, 0, 0, 0.6); 
  z-index: 2; 
}

.hero-content { 
  position: relative; 
  z-index: 3; 
  max-width: 800px; 
  width: 100%; 
}

.hero-title { 
  color: white; 
  font-size: 2.5rem; 
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7); 
  margin-bottom: 10px; 
}

.hero-subtitle { 
  color: #e0e0e0; 
  font-size: 1.1rem; 
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8); 
}

.search-form-hero { 
  margin-top: 30px; 
  display: flex; 
  justify-content: center; 
  gap: 10px; 
  flex-wrap: wrap; 
}

.search-input-hero { 
  padding: 12px 20px; 
  width: 300px; 
  background: rgba(30, 30, 40, 0.85); 
  border: 1px solid var(--border); 
  border-radius: var(--radius-sm); 
  color: white; 
  backdrop-filter: blur(5px); 
  font-size: 1rem; 
  transition: border-color 0.2s; 
}

.search-input-hero:focus { 
  outline: none; 
  border-color: var(--accent); 
}

.btn-search-hero { 
  background: #7c3aed; 
  color: white; 
  border: none; 
  padding: 12px 24px; 
  border-radius: var(--radius-sm); 
  cursor: pointer; 
  font-weight: 600; 
  transition: background 0.2s, transform 0.2s; 
}

.btn-search-hero:hover { 
  background: #6d28d9; 
  transform: translateY(-2px); 
}

.main-accueil { 
  display: flex; 
  flex-direction: column; 
  gap: 40px; 
  margin-bottom: 60px; 
}

/* ============================================================
   9. BARRE DE CONTRÔLES (Filtres Explorer)
   ============================================================ */
.controls {
  background: rgba(17, 17, 17, 0.85);
  backdrop-filter: blur(14px); 
  -webkit-backdrop-filter: blur(14px);
  padding: 18px 22px; 
  border-radius: var(--radius-lg);
  border: 1px solid var(--border); 
  box-shadow: var(--shadow-md);
  max-width: fit-content; 
  margin: 0 auto 32px auto; 
  position: sticky; 
  top: 16px; 
  z-index: 20;
}

.form-flex { 
  display: flex; 
  flex-wrap: wrap; 
  align-items: center; 
  justify-content: center; 
  gap: 14px; 
}

.filter-group { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
}

/* ============================================================
   10. FORMULAIRES & PAGE D'AJOUT
   ============================================================ */
input[type="text"], 
select {
  padding: 11px 18px; 
  border-radius: 999px; 
  border: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.85); 
  color: var(--text);
  font: inherit; 
  font-size: 0.875rem; 
  outline: none; 
  min-width: 220px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

input[type="text"]::placeholder { 
  color: var(--text-dim); 
}

input[type="text"]:hover, 
select:hover { 
  border-color: var(--accent); 
}

input[type="text"]:focus-visible, 
select:focus-visible {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
  background: rgba(0, 0, 0, 1);
}

select {
  cursor: pointer; 
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2394a3b8' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat; 
  background-position: right 16px center; 
  padding-right: 38px;
}

.main-form-wrapper { 
  padding: 30px 20px; 
  max-width: 600px; 
  margin: 30px auto 0 auto; 
}

.form-add { 
  background: var(--bg-2); 
  border: 1px solid var(--border); 
  padding: 25px; 
  border-radius: var(--radius); 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
}

.form-input { 
  width: 100%; 
  padding: 12px; 
  background: var(--bg); 
  border: 1px solid var(--border); 
  border-radius: var(--radius-sm); 
  color: white; 
  font-family: inherit; 
  font-size: 1rem; 
  transition: border-color 0.2s; 
}

.form-input:focus { 
  outline: none; 
  border-color: var(--accent); 
}

.grid-2-cols { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 15px; 
}

.checkbox-label-main { 
  color: white; 
  display: block; 
  margin-bottom: 10px; 
  font-weight: bold; 
}

.checkbox-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 10px; 
  background: var(--bg); 
  padding: 10px; 
  border: 1px solid var(--border); 
  border-radius: var(--radius-sm); 
  max-height: 150px; 
  overflow-y: auto; 
}

.checkbox-grid-single { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 10px; 
  background: var(--bg); 
  padding: 10px; 
  border: 1px solid var(--border); 
  border-radius: var(--radius-sm); 
}

.checkbox-item { 
  color: white; 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  cursor: pointer; 
}

.btn-submit { 
  background: var(--accent); 
  color: white; 
  border: none; 
  padding: 15px; 
  border-radius: var(--radius-sm); 
  cursor: pointer; 
  font-weight: bold; 
  width: 100%; 
  font-size: 1.05rem; 
  transition: background 0.2s; 
}

.btn-submit:hover { 
  background: var(--accent-2); 
}

.btn-logout { 
  background: transparent; 
  color: #ef4444; 
  border: 1px solid #ef4444; 
  padding: 8px 12px; 
  border-radius: var(--radius-sm); 
  cursor: pointer; 
  font-weight: bold; 
  transition: 0.2s; 
}

.btn-logout:hover { 
  background: #ef4444; 
  color: white; 
}

/* ============================================================
   11. BOUTONS FILTRES (Si existants)
   ============================================================ */
.btn-filter {
  padding: 9px 18px; 
  border-radius: 999px; 
  border: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.85); 
  color: var(--text);
  font-size: 0.8125rem; 
  font-weight: 600; 
  letter-spacing: 0.2px;
  cursor: pointer; 
  text-decoration: none; 
  transition: all 0.25s var(--ease);
}

.btn-filter:hover { 
  border-color: var(--accent); 
  color: #fff; 
  transform: translateY(-1px); 
}

.btn-filter.active { 
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); 
  border-color: transparent; 
  color: #fff; 
  box-shadow: var(--accent-glow); 
}

/* ============================================================
   12. GRILLE D'ŒUVRES
   ============================================================ */
.grid { 
  display: grid; 
  grid-template-columns: repeat(5, 1fr); 
  gap: 24px; 
  max-width: 1650px;
  margin: 0 auto;
}

.empty-results { color: white; text-align: center; grid-column: 1/-1; padding: 40px 0; }

@media (width <= 1200px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* ============================================================
   13. CONTAINER QUERY
   ============================================================ */
.card-container { 
  container-type: inline-size; 
}

@container (max-width: 300px) {
  .title { 
    font-size: 0.875rem; 
  }
  .genres-list, 
  .format-badge { 
    font-size: 0.625rem; 
  }
  .format-badge { 
    padding: 4px 8px; 
  }
  .sub { 
    font-size: 0.6875rem; 
  }
}

/* ============================================================
   14. CARTES
   ============================================================ */
.card {
  animation: fadeInUp 0.4s var(--ease) both;
  animation-delay: calc(var(--index, 0) * 0.05s);
  background: var(--card); 
  border-radius: var(--radius);
  border: 1px solid var(--border); 
  overflow: hidden;
  display: flex; 
  flex-direction: column;
  transition: transform 0.35s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  will-change: transform; 
  container-type: inline-size; 
}

.card:hover {
  transform: translateY(-6px); 
  border-color: var(--accent);
  box-shadow: 
    0 0 12px rgba(192, 132, 252, 0.6), 
    0 0 24px rgba(168, 85, 247, 0.5), 
    0 0 36px rgba(139, 92, 246, 0.4), 
    var(--shadow-lg);
}

/* ============================================================
   15. BOÎTE IMAGE
   ============================================================ */
.img-box { 
  width: 100%; 
  aspect-ratio: 2 / 3; 
  background: #000; 
  border-bottom: 1px solid var(--border); 
  overflow: hidden; 
  position: relative; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}

.img-box::after { 
  content: ""; 
  position: absolute; 
  inset: 0; 
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.8)); 
  pointer-events: none; 
}

.img-box img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease); 
}

.card:hover .img-box img { 
  transform: scale(1.06); 
  filter: saturate(1.2) contrast(1.1); 
}

/* ============================================================
   16. BADGES DE FORMAT
   ============================================================ */
.format-badge { 
  position: absolute; 
  top: 12px; 
  right: 12px; 
  padding: 6px 12px; 
  border-radius: 4px; 
  font-size: 0.6875rem; 
  font-weight: 800; 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  z-index: 2; 
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6); 
}

.badge-manga { 
  background: #ffffff; 
  color: #000000; 
  border: 2px solid #000000; 
}

.badge-serie { 
  background: linear-gradient(135deg, #4483e7, #448fff); 
  color: #ffffff; 
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); 
  border: none; 
}

.badge-film { 
  background: linear-gradient(135deg, #f97316, #ea580c); 
  color: #ffffff; 
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); 
  border: none; 
}

/* ============================================================
   17. CONTENU TEXTE DES CARTES
   ============================================================ */
.content { 
  padding: 18px 18px 20px; 
  flex-grow: 1; 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
}

.title { 
  font-size: 1.0625rem; 
  font-weight: 700; 
  color: #fff; 
  line-height: 1.3; 
  display: -webkit-box; 
  -webkit-line-clamp: 2; 
  -webkit-box-orient: vertical; 
  overflow: hidden; 
}

.genres-list { 
  color: var(--accent); 
  font-size: 0.6875rem; 
  font-weight: 700; 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  display: block; 
}

.sub { 
  font-size: 0.8125rem; 
  color: var(--text-muted); 
  font-style: italic; 
  line-height: 1.5; 
  display: -webkit-box; 
  -webkit-line-clamp: 3; 
  -webkit-box-orient: vertical; 
  overflow: hidden; 
}

.card-tech-details { 
  margin: 8px 0; 
  font-size: 0.9em; 
  color: var(--text-muted); 
}

.card-location { 
  color: var(--text-dim); 
  font-size: 0.85em; 
  display: block; 
  margin-top: auto; 
}

/* ============================================================
   18. BANNIÈRES PARALLAX
   ============================================================ */
.section-parallax-banner { 
  position: relative; 
  height: 200px; 
  width: 100%; 
  overflow: hidden; 
  border-radius: var(--radius); 
  border: 1px solid var(--border-strong); 
  box-shadow: var(--shadow-md); 
  margin: 35px 0 25px 0; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  text-align: center; 
  background-attachment: fixed; 
  background-position: center; 
  background-repeat: no-repeat; 
  background-size: cover; 
}

.banner-manga { 
  background-image: url('https://webinventory.belkedah.projetsmmichamps.fr/IMAGES/banniere_manga_bg.jpg'); 
}

.banner-serie { 
  background-image: url('https://webinventory.belkedah.projetsmmichamps.fr/IMAGES/banniere_serie_bg.jpg'); 
}

.banner-film { 
  background-image: url('https://webinventory.belkedah.projetsmmichamps.fr/IMAGES/banniere_film_bg.jpg'); 
}

.parallax-overlay { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background: rgba(5, 5, 5, 0.7); 
  z-index: 1; 
}

.parallax-content { 
  position: relative; 
  z-index: 2; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 5px; 
}

.parallax-content h2 { 
  margin: 0; 
  color: #fff; 
  font-size: 1.8rem; 
  font-weight: 800; 
  text-transform: uppercase; 
  letter-spacing: 2px; 
  text-shadow: 0px 4px 15px rgba(168, 85, 247, 0.8); 
}

/* ============================================================
   19. PAGE À PROPOS
   ============================================================ */
.main-apropos { 
  display: flex; 
  flex-direction: column; 
  gap: 40px; 
  padding: 0 10px; 
}

.about-card { 
  background: var(--bg-2); 
  border: 1px solid var(--border); 
  padding: 30px; 
  border-radius: var(--radius); 
}

.about-card-flex { 
  display: flex; 
  flex-direction: column; 
  gap: 30px; 
}

.about-header { 
  border-bottom: 2px solid var(--border); 
  padding-bottom: 15px; 
  margin-bottom: 20px; 
}

.about-h2 { 
  color: var(--accent); 
  margin: 0; 
  font-size: 1.8rem; 
}

.about-role { 
  color: var(--text-muted); 
  font-size: 1rem; 
  margin-top: 5px; 
  font-weight: 300; 
}

.about-text { 
  color: var(--text-muted); 
  margin: 0; 
  line-height: 1.7; 
}

.about-h2-line { 
  color: white; 
  border-left: 4px solid var(--accent); 
  padding-left: 12px; 
  margin: 0; 
  font-size: 1.8rem; 
}

.about-block { 
  border-bottom: 1px solid var(--border); 
  padding-bottom: 25px; 
}

.about-block:last-child { 
  border-bottom: none; 
  padding-bottom: 0; 
}

.about-h3 { 
  color: var(--accent); 
  margin: 0 0 12px 0; 
  font-size: 1.2rem; 
}

.about-p { 
  color: var(--text-muted); 
  font-size: 0.95rem; 
  margin: 0 0 8px 0; 
}

.about-p-last { 
  margin-bottom: 0; 
}

.about-list { 
  color: var(--text-muted); 
  font-size: 0.95rem; 
  padding-left: 20px; 
  margin: 0; 
  line-height: 1.6; 
}

.about-list li { 
  margin-bottom: 6px; 
}

/* ============================================================
   20. ANIMATIONS CSS
   ============================================================ */
@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* ============================================================
   21. PRÉFÉRENCES (ACCESSIBILITÉ / CONTRASTE)
   ============================================================ */
@media (prefers-contrast: high) {
  .badge-manga { 
    border: 3px solid #000000; 
    background: #ffffff; 
    color: #000000; 
  }
  
  .badge-serie { 
    background: #1e40af; 
    border: 1px solid #ffffff; 
    text-shadow: none; 
  }
  
  .badge-film { 
    background: #ea580c; 
    border: 1px solid #ffffff; 
    text-shadow: none; 
  }
  
  .card { 
    border: 2px solid var(--border-strong); 
  }
  
  .card:hover { 
    border: 2px solid var(--accent); 
  }
  
  .main-nav a { 
    font-weight: 700; 
  }
  
  .btn-filter { 
    border: 2px solid var(--accent); 
  }
}

@media (prefers-reduced-motion: reduce) {
  *, 
  *::before, 
  *::after { 
    animation-duration: 0.001ms !important; 
    transition-duration: 0.001ms !important; 
  }
  
  .card { 
    animation: none !important; 
  }
  
  .section-parallax-banner { 
    background-attachment: scroll !important; 
  }
}

/* ============================================================
   22. MEDIA QUERIES (Taille Mobile)
   ============================================================ */
@media (width <= 640px) {
  body { 
    padding: 0; 
  }
  
  .main-nav { 
    padding: 12px 16px; 
    gap: 16px; 
    flex-wrap: wrap; 
  }
  
  .main-nav a { 
    font-size: 0.6875rem; 
  }
  
  .controls { 
    padding: 16px; 
    position: static; 
  }
  
  .grid { 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 16px; 
  }
  
  input[type="text"], 
  select { 
    min-width: 0; 
    width: 100%; 
  }
  
  .form-flex > * { 
    flex: 1 1 100%; 
  }
  
  .filter-group { 
    justify-content: center; 
  }
  
  .section-parallax-banner { 
    height: 150px; 
    background-attachment: scroll; 
  }
}