/* FOND GLOBAL */
html,
body {
  background: #000;
}

/* Force texte lisible dans les panneaux overlay */
.reel-comments-panel,
.reel-comments-panel *,
.reel-share-panel,
.reel-share-panel *,
.reel-options-panel,
.reel-options-panel *,
.reel-profile-card,
.reel-profile-card * {
  color: #ffffff !important;
}

.reels-body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden; /* on gère le scroll sur le wrapper */
}

/* SHELL global : 100vh */
.reels-shell {
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  background: radial-gradient(circle at top, #222 0, #000 55%); /* noir moderne */
  position: relative;
}

/* SCROLL vertical : 1 écran = 1 section */
.reels-scroll {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}

/* Masquer scrollbar moche */
.reels-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.reels-scroll {
  scrollbar-width: none;
}

/* Chaque écran = 100vh */
.reel-screen {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: black;
}

/* FRAME DESKTOP : reproduit le centre Instagram desktop (téléphone) */
.reels-desktop-frame {
  width: 430px;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

/* REEL (aspect 9:16) */
.reel {
  position: relative;
  width: 100%;
  max-width: 430px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
}

/* Vidéo full container */
.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gradients lisibilité */
.reel-gradient-top,
.reel-gradient-bottom {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
}

.reel-gradient-top {
  top: 0;
  height: 25%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
}

.reel-gradient-bottom {
  bottom: 0;
  height: 35%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

/* HEADER */
.reel-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.reel-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid #fff;
  object-fit: cover;
}

.reel-user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reel-username-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}

.reel-follow-btn {
  padding: 2px 10px;
  font-size: 0.75rem;
  border-radius: 999px;
  border: none;
  background: #0095f6;
  color: #fff;
}

.reel-follow-btn:hover {
  background: #0586de;
}

/* état "Suivi" */
.reel-follow-btn.is-following {
  background: #262626;
  color: #fff;
}

.reel-more-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  padding: 2px 4px;
}

/* ACTIONS DROITE */
.reel-actions {
  position: absolute;
  right: 10px;
  bottom: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 2;

  .vote-widget-wrapper {
    display: none;
  }
}

.reel-icon-btn {
  border: none;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 1.4rem;
  padding: 0;
}

.reel-icon-btn .reel-count {
  font-size: 0.75rem;
  color: #fff; /* PAS de gris invisible */
}

.reel-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid #fff;
  object-fit: cover;
}

/* LIKE actif */
.reel-like.is-active i {
  color: #ff2d55;
}

/* BOOKMARK actif */
.reel-bookmark-btn.is-bookmarked i {
  font-weight: 700;
}

/* FOOTER */
.reel-footer {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100% - 55px);
}

.reel-caption {
  display: flex;
  flex-direction: column;
  gap: 4px;

  max-width: 85%;
  pointer-events: auto;
}

.reel-caption-username {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
}

.reel-caption-text {
  font-size: 0.85rem;
  line-height: 1.3;
  opacity: 0.95;

  display: -webkit-box;
  -webkit-line-clamp: 3;   /* comme Insta */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reel-caption-username {
  font-weight: 600;
  color: #fff;
}

.reel-caption-text {
  color: #fff;
}

.reel-music {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #fff;
  opacity: 0.9;
}

.reel-music i {
  font-size: 0.9rem;
}

/* BARRE BAS : volume + progress */
.reel-bottom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.reel-progress {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.reel-progress-bar {
  height: 100%;
  width: 0;
  background: #fff;
  transition: width 0.1s linear;
}

.reel-bottom-bar .reel-icon-btn {
  font-size: 1.1rem;
}

/* OVERLAY PLAY/PAUSE */
.reel-play-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 999px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 2;
}

/* Affiché quand en pause */
.reel.is-paused .reel-play-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Overlay sombre quand un panneau est ouvert */
.reel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.2s ease;
}

.reel.has-open-panel .reel-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Panneaux latéraux (comments & share) */
/* Panneaux commentaires & share – LARGE (social desktop) */
.reel-comments-panel,
.reel-share-panel {
  position: absolute;
  top: 0;
  right: 0;

  width: 60%;
  max-width: 520px;
  min-width: 420px;

  height: 100%;
  background: #0f0f0f;
  border-left: 1px solid #262626;

  padding: 14px 18px;
  z-index: 4;

  transform: translateX(100%);
  transition: transform 0.25s ease-out;

  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.reel-comments-panel.is-open,
.reel-share-panel.is-open {
  transform: translateX(0);
}

.reel-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 10px;
}

.reel-panel-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
}

.reel-panel-body {
  flex: 1;
  overflow-y: auto;
}

/* Comment items */
.reel-comment-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.reel-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
}

.reel-comment-meta {
    font-size: 0.7rem;
    color: #e5e5e5; /* ou #fff si tu veux full blanc */
}
  
/* Share panel */
.reel-share-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.reel-share-item {
  padding: 6px 8px;
  background: #121212;
  border-radius: 8px;
}

.reel-share-link-label {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #e5e5e5; /* ou #fff */
}  

.reel-share-link {
  font-size: 0.75rem;
  padding: 6px 8px;
  background: #121212;
  border-radius: 8px;
  word-break: break-all;
}

/* Options panel (3 points) */
.reel-options-panel {
  position: absolute;
  top: 46px;
  right: 16px;
  background: #1a1a1a;
  border-radius: 12px;
  padding: 8px 0;
  z-index: 5;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: none;
}

.reel-options-panel.is-open {
  display: block;
}

.reel-options-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reel-options-panel li {
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.reel-options-panel li:hover {
  background: #262626;
}

/* Profile card */
.reel-profile-card {
  position: absolute;
  top: 56px;
  left: 12px;
  background: #1a1a1a;
  border-radius: 14px;
  padding: 10px 12px;
  z-index: 5;
  width: 260px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: none;
  font-size: 0.85rem;
}

.reel-profile-card.is-open {
  display: block;
}

.reel-profile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.reel-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
}

.reel-profile-username {
  font-weight: 600;
}

.reel-profile-name {
    font-size: 0.8rem;
    color: #e5e5e5; /* ou #fff */
}  

.reel-profile-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.reel-profile-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
}

.reel-profile-stats strong {
  font-size: 0.85rem;
}

.reel-profile-btn {
  width: 100%;
  border-radius: 8px;
  border: none;
  padding: 6px 0;
  font-size: 0.8rem;
  background: #0095f6;
  color: #fff;
}

/* HOVER desktop : léger zoom */
@media (hover: hover) and (pointer: fine) {
  .reel:hover .reel-video {
    transform: scale(1.02);
    transition: transform 0.2s ease-out;
  }
}

/* Flèches navigation desktop */
.reels-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: none; /* affiché seulement sur desktop */
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  z-index: 10;
}

.reels-arrow-left {
  left: 20px;
}

.reels-arrow-right {
  right: 20px;
}

.reels-arrow:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- MOBILE : mode "app" Insta --- */
@media (max-width: 768px) {
  .reels-shell {
    background: #000;
  }

  .reels-scroll {
    width: 100%;
  }

  .reels-desktop-frame {
    width: 100%;
    max-width: 100%;
  }

  .reel {
    max-width: 100%;
    border-radius: 0; /* comme l’app */
  }

  .reel-header {
    top: 16px;
  }

  .reel-actions {
    right: 10px;
    bottom: 120px;
  }

  .reel-footer {
    left: 10px;
    right: 10px;
    bottom: 16px;
  }

  /* panneaux mobile = en bas plein largeur si tu veux adapter plus tard */
}


/* =========================
   SHARE PANEL – SOCIAL STYLE
   ========================= */

   .reel-share-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 360px;
    min-width: 300px;
    height: 100%;
    background: #0f0f0f;
    border-left: 1px solid #262626;
    padding: 14px;
    z-index: 4;
  
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
  
    display: flex;
    flex-direction: column;
  }
  
  .reel-share-panel.is-open {
    transform: translateX(0);
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.8);
  }
  
  .reel-share-panel .reel-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  
  /* Actions rapides */
  .reel-share-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  
  .reel-share-action {
    background: #121212;
    border: none;
    border-radius: 14px;
    padding: 10px 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
  }
  
  .reel-share-action i {
    font-size: 1.4rem;
  }
  
  /* Liste utilisateurs */
  .reel-share-users {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .reel-share-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 10px;
    background: #121212;
  }
  
  .reel-share-user img {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
  }
  
  .reel-share-user span {
    font-size: 0.8rem;
  }
  
  /* Lien copy */
  .reel-share-link {
    display: flex;
    gap: 6px;
    background: #121212;
    padding: 6px;
    border-radius: 999px;
  }
  
  .reel-share-link input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.75rem;
  }
  
  .reel-share-copy {
    background: #0095f6;
    border: none;
    border-radius: 999px;
    color: #fff;
    width: 32px;
    height: 32px;
  }
  
  

  /* =========================
   COMMENTS PANEL – SOCIAL
   ========================= */

.reel-comments-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 360px;
  min-width: 300px;
  height: 100%;
  background: #0f0f0f;
  border-left: 1px solid #262626;
  padding: 14px;
  z-index: 4;

  transform: translateX(100%);
  transition: transform 0.25s ease-out;

  display: flex;
  flex-direction: column;
}

.reel-comments-panel.is-open {
  transform: translateX(0);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.8);
  display: block;

  .alert-wrapper {
    display: none !important;
  }
}

.reel-comments-panel .reel-panel-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Comment item */
.reel-comment-item {
  display: flex;
  gap: 10px;
}

.reel-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
}

.reel-comment-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reel-comment-header {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.8rem;
}

.reel-comment-time {
  font-size: 0.7rem;
  color: #bdbdbd;
}

.reel-comment-text {
  font-size: 0.85rem;
  line-height: 1.35;
}

.reel-comment-actions {
  display: flex;
  gap: 12px;
  font-size: 0.7rem;
  color: #bdbdbd;
}

.reel-comment-actions span {
  cursor: pointer;
}

.reel-comment-actions span:hover {
  text-decoration: underline;
}

/* Input */
.reel-comment-input {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #262626;
}

.reel-comment-input input {
  flex: 1;
  background: #121212;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: #fff;
}

.reel-comment-input button {
  border: none;
  background: transparent;
  color: #0095f6;
  font-weight: 600;
  font-size: 0.8rem;
}

/* =========================
   WATCH ON PLATFORM
   ========================= */

   .reel-watch-on {
    margin-top: 4px;
  }
  
  .reel-watch-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition: background 0.15s ease, transform 0.15s ease;
  }
  
  .reel-watch-link i {
    font-size: 1rem;
  }
  
  /* Hover desktop */
  @media (hover: hover) and (pointer: fine) {
    .reel-watch-link:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: translateY(-1px);
    }
  }
  
  /* Platform colors (subtil, moderne) */
  .reel-watch-link .bi-youtube {
    color: #ff0000;
  }

  .reel-watch-link .bi-instagram {
    color: #e1306c;
  }

  .reel-watch-link .bi-tiktok {
    color: #69c9d0;
  }

  .reel-watch-link .bi-facebook {
    color: #1877f2;
  }

  .reel-profile-btn {
    display: inline-block;
    text-align: center;
    text-decoration: none;
  
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
  
    background: #0095f6;
    color: #fff;
  
    border-radius: 8px;
    border: none;
  
    padding: 6px 0;
    font-size: 0.8rem;
    font-weight: 600;
  }
  
  .reel-profile-btn:hover {
    background: #0586de;
  }


  /* Reel comments (Drupal) */
.reel-comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.reel-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.reel-comment-body {
  flex: 1;
}

.reel-comment-header {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.8rem;
}

.reel-comment-author {
  font-weight: 600;
}

.reel-comment-time {
  opacity: 0.6;
  font-size: 0.7rem;
}

.reel-comment-text {
  font-size: 0.85rem;
  line-height: 1.3;
}

/* ===== COMMENTS FORM : REELS STYLE ===== */

/* Conteneur global */
.reel-comments-panel .comment-wrapper {
  background: #000;
  padding: 12px;
  height: 450px;
}

/* Supprimer titres Drupal moches */
.reel-comments-panel h2 {
  display: none;
}

/* CKEditor : réduire */
.reel-comments-panel .ck-editor__top,
.reel-comments-panel .ck-toolbar,
.reel-comments-panel .js-filter-wrapper,
.reel-comments-panel .filter-guidelines {
  display: none !important;
}

/* Zone de texte */
.reel-comments-panel .ck-editor__editable,
.reel-comments-panel textarea {
  min-height: 80px !important;
  max-height: 120px !important;
  background: #111;
  color: #fff;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
}

/* Bouton */
.reel-comments-panel .form-actions {
  display: flex;
  justify-content: flex-end;
}

.reel-comments-panel button[type="submit"] {
  background: #0095f6;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
}

/* ==========================================
   DRUPAL COMMENTS FORM -> REELS INPUT BAR
   (A COLLER EN FIN DE FICHIER / REMPLACER TOUT)
   ========================================== */

/* 0) Le panel doit être une colonne (déjà chez toi, mais on sécurise) */
.reel-comments-panel {
  display: flex;
  flex-direction: column;
}

/* 1) La zone qui contient la liste de commentaires doit scroller,
      ET laisser la place en bas pour la barre de saisie */
.reel-comments-panel .reel-panel-body,
.reel-comments-panel .comment-wrapper {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 70px; /* espace pour la barre du bas */
}

/* 2) Cacher les titres Drupal + trucs inutiles */
.reel-comments-panel .comment-wrapper > h2,
.reel-comments-panel .comment-form__title,
.reel-comments-panel .js-form-item-comment-body-0-format,
.reel-comments-panel .js-filter-wrapper,
.reel-comments-panel .filter-guidelines,
.reel-comments-panel .ck-editor__top,
.reel-comments-panel .ck-toolbar,
.reel-comments-panel label[for^="edit-comment-body"] {
  display: none !important;
}

/* 3) Le FORM devient une BARRE FIXE EN BAS du panel */
.reel-comments-panel form.comment-comment-form {
  position: sticky;
  bottom: 0;
  z-index: 10;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  margin: 0;

  background: #0f0f0f;
  border-top: 1px solid #262626;

  position: absolute;
  width: 100%;
  left: 0px;

}

/* 4) Enlever les marges Drupal */
.reel-comments-panel .field--name-comment-body,
.reel-comments-panel .form-item-comment-body-0-value,
.reel-comments-panel .form-actions {
  margin: 0 !important;
}

/* 5) Le champ de saisie doit prendre TOUTE la largeur */
.reel-comments-panel .field--name-comment-body {
  flex: 1;
}

/* 6) Styles du "champ" : CKEditor editable ressemble à un input */
.reel-comments-panel .ck-editor,
.reel-comments-panel .ck-editor__main {
  width: 100%;
}

.reel-comments-panel .ck-editor__editable {
  min-height: 38px !important;
  max-height: 90px !important;

  width: 100%;

  background: #121212 !important;
  color: #ffffff !important;

  border: 1px solid #262626 !important;
  border-radius: 999px !important;

  padding: 9px 14px !important;

  font-size: 14px !important;
  line-height: 1.2 !important;

  overflow-y: auto !important;  /* scroll quand ça dépasse */
  box-shadow: none !important;
  outline: none !important;
}

/* Placeholder CKEditor */
.reel-comments-panel .ck-editor__editable.ck-placeholder::before {
  color: #8a8a8a !important;
}

/* 7) Scroll discret dans le champ */
.reel-comments-panel .ck-editor__editable::-webkit-scrollbar {
  width: 6px;
}
.reel-comments-panel .ck-editor__editable::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 999px;
}

/* 8) Bouton "Publier" (submit Drupal) */
.reel-comments-panel .form-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.reel-comments-panel button[type="submit"] {
  background: transparent !important;
  border: none !important;

  color: #0095f6 !important;
  font-weight: 600 !important;
  font-size: 14px !important;

  padding: 0 6px !important;
  border-radius: 999px !important;

  cursor: pointer;
  line-height: 1;
}

/* Hover */
@media (hover: hover) and (pointer: fine) {
  .reel-comments-panel button[type="submit"]:hover {
    color: #4bb3ff !important;
  }
}

/* 9) IMPORTANT : cacher l'ancien input fake si tu l'as encore dans le DOM */
.reel-comments-panel .reel-comment-input {
  /*display: none !important;*/
}  

/* --- DESKTOP LARGE : garder le "téléphone" centré et montrer les flèches --- */
@media (min-width: 992px) {
  .reels-shell {
    justify-content: center;
  }
  .reels-arrow {
    display: flex;
  }
}