/* === ENCRALYS – Avatar poster + lien zoom === */

/* Dimensions et forme du poster */
#item-header-avatar img.encralys-poster-avatar {
  width: 230px !important;
  height: 345px !important;
  object-fit: cover !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 22px !important;
}

/* Conteneur avatar */
#item-header-avatar,
#item-header-avatar .avatar {
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
}

/* Responsive (mobile) */
@media (max-width: 480px) {
  #item-header-avatar img.encralys-poster-avatar {
    width: 184px !important;
    height: 276px !important;
  }
}

/* Supprimer les boutons caméra + overlay BuddyBoss */
#item-header-avatar .link-change-profile-image,
#item-header-avatar .link-change-overlay {
  display: none !important;
}

/* S’assurer que le lien cliquable fonctionne */
#item-header-avatar a.encralys-open-full {
  display: inline-block;
}

/* Ombre du poster */
body.groups.single-item #item-header-avatar img.encralys-poster-avatar {
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

/* === ENCRALYS – Mode cinéma : cover panoramique === */

#header-cover-image {
  height: 400px !important;
  overflow: hidden;
  position: relative;
}

#header-cover-image .header-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: brightness(0.9);
}

/* === ENCRALYS – Flairs + TMDB box === */

#encralys-tmdb-box {
  margin: 18px 0 8px;
  background: #f8f8f9;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
}

#encralys-tmdb-box h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

#encralys-tmdb-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

#encralys-tmdb-results {
  margin-top: 8px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

#encralys-tmdb-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#encralys-tmdb-results li {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

#encralys-tmdb-results li:hover {
  background: #f8fafc;
}

#encralys-tmdb-none {
  color: #6b7280;
  font-size: 13px;
  padding: 6px 2px;
}

/* Barre de flairs sous le titre du groupe */
#item-header-content .encralys-flairs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .35rem 0 0;
}
/* ENCRALYS – Rééquilibrer l’espacement des flairs sous le header */
#item-header-content .encralys-meta-row {
  margin-top: -30px !important;   /* teste 10 / 14 / 18 px selon ton goût */
}


/* Pour éviter que le bloc d’actions ne pousse trop vers les flairs */
body.single-item.groups #item-header-content .group-actions-absolute {
  margin-bottom: 0 !important;
}

.encralys-flair {
  display: inline-flex;
  align-items: center;
  padding: .18rem .5rem;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  border: 1px solid var(--bb-border, #e5e7eb);
  background: var(--bb-surface, #fff);
  color: var(--bb-text, #111827);
}

.encralys-flair--year  { background:#f5f3ff; border-color:#e9d5ff; color:#7c3aed; }
.encralys-flair--genre { background:#eef6ff; border-color:#dbeafe; color:#1d4ed8; }
.encralys-flair--type  { background:#ecfdf5; border-color:#d1fae5; color:#047857; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .encralys-flair {
    border-color:#333;
    background:#1f1f1f;
    color:#ddd;
  }
  .encralys-flair--year  { background:#241a35; border-color:#6d28d9; color:#e9d5ff; }
  .encralys-flair--genre { background:#13233b; border-color:#1e3a8a; color:#c3dafe; }
  .encralys-flair--type  { background:#0f2a20; border-color:#065f46; color:#a7f3d0; }
}

/* Cast (liens acteur) */
.encralys-cast {
  margin-top: 12px;
  color: var(--bb-text, #111827);
}
.encralys-cast .encralys-cast-link {
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.encralys-cast .encralys-cast-link:hover {
  opacity:.85;
}

/* Réduit la largeur de la description et la centre */
#item-header-content .group-description {
  max-width: 500px;
  margin: 0 auto;
  text-align: justify;
}

/* ====== ENCRALYS – Popup bande-annonce centrée ====== */

#encralys-trailer-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#encralys-trailer-modal.is-open {
  display: flex;
}

.encralys-trailer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1;
}

.encralys-trailer-dialog {
  position: relative;
  z-index: 2;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  width: 80vw;
  max-width: 960px;
  height: 45vw;
  max-height: 540px;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}

.encralys-trailer-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 28px;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 3;
  transition: transform 0.2s ease;
}
.encralys-trailer-close:hover {
  transform: scale(1.2);
}

.encralys-trailer-iframe-wrap {
  width: 100%;
  height: 100%;
}
.encralys-trailer-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* === ENCRALYS – Watchlist / Vu profil === */

.encralys-watchlist-wrapper {
  padding: 16px 0 8px;
}

.encralys-watchlist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.encralys-watchlist-title-main {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}
.encralys-watchlist-count {
  font-size: 13px;
  opacity: 0.7;
}

.encralys-watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
}

/* Carte */
.encralys-watchlist-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: visible;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}

.encralys-watchlist-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.16);
}

/* Image */
.encralys-watchlist-card img {
  border-radius: 12px 12px 0 0;
  display: block;
}

/* Titre sous le poster */
.encralys-watchlist-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  display: block;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  max-height: none !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  margin-bottom: 4px;
  border-radius: 0 0 12px 12px;
  margin-left: 10px;
}

/* État vide */
.encralys-watchlist-empty {
  padding: 24px 16px;
  border-radius: 12px;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
  text-align: center;
}

.encralys-watchlist-empty-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

/* ===== ENCRALYS – Alignement actions header ===== */

/* Réduit l’espace entre “Réalisé par …” et les actions */
#item-header-content .encralys-group-director {
  margin-bottom: 4px !important;  /* mets 0 si tu veux tout coller */
}

/* Conteneur : Organisateur + cloche + colonne des boutons bleus */
body.single-item.groups #item-header-content .group-actions-absolute {
  position: relative !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;

  /* 🔹 remonte TOUT le bloc (Organisateur + cloche + colonne) */
  margin-top: -18px !important;  /* joue avec -14 / -20 / -22 selon ton goût */
}

/* Colonne bleue (Bande-annonce / Watchlist / Déjà vu) */
body.single-item.groups #item-header-content .group-actions-absolute .encralys-trailer-action {
  position: absolute !important;
  right: 0 !important;
  top: calc(100% - 80px) !important;  /* plus petit = plus proche d’Organisateur */
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 10px !important;
}

/* Largeur & style homogènes des 3 boutons bleus */
body.single-item.groups #item-header-content .encralys-trailer-action .button,
body.single-item.groups #item-header-content .encralys-trailer-action .encralys-btn-seen {
  width: 200px !important;
  max-width: 100% !important;
  text-align: center !important;
  border-radius: 999px !important;
}
/* ENCRALYS – Remonter uniquement "Organisateur" + cloche */
body.single-item.groups #item-header-content .group-actions-absolute
  > .bp-generic-meta.groups-meta.action:not(.encralys-trailer-action) {
  margin-top: -150px !important;  /* essaye -8, -10, -12 selon le rendu */
}
/* === ENCRALYS – Bouton "Suivre le groupe" (aligné verticalement avec les autres) === */

/* Conteneur global du bouton + cloche */
body.single-item.groups #item-header-content .group-actions-absolute {
  position: relative !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important; /* ✅ centré verticalement */
  gap: 12px !important;
  margin-top: 40px !important; /* 🔹 remonté depuis 25px → 10px */
}

/* Bouton "Rejoindre le groupe" (état non membre) */
body.single-item.groups #item-header-content .group-actions-absolute .group-button.join-group {
  background: #3b5bff !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  transition: background 0.2s ease, transform 0.2s ease;
  width: 200px !important;
  max-width: 100% !important;
  font-size: 12px !important;
  line-height: 1 !important;
  margin-right: 0 !important;
}

/* Hover */
body.single-item.groups #item-header-content .group-actions-absolute .group-button.join-group:hover {
  background: #5f78ff !important;
  transform: translateY(-1px);
}

/* États "Membre" / "Quitter le groupe" / "Organisateur" */
body.single-item.groups #item-header-content .group-actions-absolute .group-button.leave-group,
body.single-item.groups #item-header-content .group-actions-absolute .group-button.organizer {
  background: #3b5bff !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  transition: background 0.2s ease, transform 0.2s ease;
  width: 200px !important;
  max-width: 100% !important;
  font-size: 12px !important;
  line-height: 1 !important;
  margin-right: -15px !important; /* 🔹 léger décalage à droite */
}

/* Hover neutre */
body.single-item.groups #item-header-content .group-actions-absolute .group-button.leave-group:hover {
  background: #e5e7eb !important;
}

/* Colonne des boutons bleus (Bande-annonce / Watchlist / Vu) */
body.single-item.groups #item-header-content .group-actions-absolute .encralys-trailer-action {
  position: absolute !important;
  right: 0 !important;
  top: calc(100% - 50px) !important; /* rapproche la colonne du bouton principal */
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 8px !important;
}

/* Largeur uniforme pour tous les boutons */
body.single-item.groups #item-header-content .group-actions-absolute .encralys-trailer-action .button,
body.single-item.groups #item-header-content .group-actions-absolute .encralys-trailer-action .encralys-btn-seen {
  width: 200px !important;
  max-width: 100% !important;
  text-align: center !important;
  border-radius: 999px !important;
}

/* Supprime le bouton cloche (désabonnement / notification) */
body.single-item.groups #item-header-content .group-actions-absolute .group-subscription {
  display: none !important;
}
/* ====== ENCRALYS – Popup "Ajouter à une liste" ====== */

#encralys-list-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#encralys-list-modal.is-open {
  display: flex;
}

.encralys-list-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55); /* fond sombre */
  z-index: 1;
}

.encralys-list-dialog {
  position: relative;
  z-index: 2;
  background: #f9fafb;
  border-radius: 18px;
  width: 90vw;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
}

.encralys-list-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, color .15s ease;
}
.encralys-list-close:hover {
  transform: scale(1.15);
  color: #111827;
}

.encralys-list-inner h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

/* Bouton "Créer une nouvelle liste" */
.encralys-list-create-toggle {
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #e5edff;
  color: #1d4ed8;
  text-align: center;
}

/* Formulaire de création */
.encralys-list-create-form {
  margin-top: 10px;
  display: none; /* basculé en JS */
  gap: 8px;
  align-items: center;
}

.encralys-list-name-input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

.encralys-list-create-form .button {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: #3b5bff;
  color: #fff;
  cursor: pointer;
}

/* Liste des listes */
.encralys-list-list-wrapper {
  margin-top: 16px;
  max-height: 300px;
  overflow: auto;
}

.encralys-list-empty {
  margin: 0 0 8px;
  font-size: 13px;
  color: #6b7280;
}

.encralys-list-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.encralys-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.encralys-list-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.encralys-list-add-btn {
  border-radius: 999px;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #3b5bff;
  color: #fff;
  white-space: nowrap;
}

.encralys-list-add-btn:hover {
  background: #5f78ff;
}

/* Mobile */
@media (max-width: 480px) {
  .encralys-list-dialog {
    width: 92vw;
    max-width: none;
    padding: 16px 16px 14px;
  }

  .encralys-list-inner h3 {
    font-size: 16px;
  }
}
/* ================================
   ENCRALYS – Bouton Bande-annonce (style sobre gris mat)
   ================================ */

button.encralys-trailer-button {
  background: #2a2a2a !important; /* gris foncé mat */
  border: 1px solid #404040 !important;
  color: #e0e0e0 !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  font-weight: 500;
  border-radius: 10px !important;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  width: 20px !important;
  min-width: 20px !important;
  text-align: center;
}

/* Survol : éclaircissement doux */
button.encralys-trailer-button:hover {
  background: #3a3a3a !important;
  border-color: #555 !important;
  transform: translateY(-1px);
}

/* Clic : légère contraction */
button.encralys-trailer-button:active {
  transform: scale(0.97);
  background: #333 !important;
}

/* Alignement du conteneur sous les flairs */
.encralys-trailer-under-flairs {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

/* Centré sur mobile */
@media (max-width: 768px) {
  .encralys-trailer-under-flairs {
    justify-content: center;
  }
}