:root {
  --jn-primary: #666666;
  --jn-secondary: #FEA376;
  --jn-testiary: #FEEDDF;
  --bb-primary-color: #666666 !important;
  --bb-primary-button-background-regular: #666666 !important;
  --bb-primary-button-border-regular: #666666 !important;
  --bb-primary-button-background-hover: #555555 !important;
  --bb-primary-button-border-hover: #555555 !important;
}

.d-none {
  display: none !important;
}

.bb-sfwd-aside .site-content .container {
  max-width: 1200px;
}

.rsc-container {
  margin: 30px 0;
  overflow: visible;
  height: fit-content;
}
#page, #content, .container {
  overflow: visible;
}

/* .rsc-container figure {
    border: 1px solid #eee;
    padding: 8px;
    border-radius: 5px;
  } */
.rsc-container figure figcaption {
  background-color: #eee;
  color: #5e5e5e;
  font-style: italic;
  padding: 8px;
  font-size: 12px;
  line-height: 14px;
  text-align: center;
  margin-bottom: 0 !important;
}
.rsc-container .back-btn {
  color: #000;
  font-weight: 500;
}
.rsc-container .back-btn svg {
  vertical-align: sub;
}
.rsc-container .back-btn > span:nth-child(2) {
  padding-left: 5px;
}

.rsc-content {
  display: flex;
  /* flex-wrap: wrap; */
  gap: 20px;
  width: 100%;
}

.rsc-lesson-content {
  background-color: white !important;
  border-radius: 20px !important;
  padding: 15px;
  margin-bottom: 20px;
  word-break: break-word;
}
.rsc-course-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888888;
  margin-bottom: 10px;
}
.rsc-course-author>img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  background-color: #eee;
  border-radius: 50%;
}
.rsc-course-author>div>div {
  line-height: 18px;
}

.rsc-content > div:first-child {
  width: 65%;
}
.rsc-content > div:last-child {
  width: 35%;
}

.rsc-content > div:first-child > h4 {
  margin-bottom: 10px;
  margin-top: 10px;
  font-weight: 500;
}

.rsc-content .chapter-category > h5 {
  border: 1px solid var(--jn-secondary);
  color: var(--jn-secondary);
  padding: 5px 12px;
  border-radius: 30px;
  margin: 0;
  margin-bottom: 20px;
  width: fit-content;
}
.rsc-content iframe, .rsc-content video {
  width: 100% !important;
  height: 350px;
  margin: 10px 0 !important;
  border-radius: 12px;
  background-color: #eaeaea;
}
.rsc-content .wp-block-image a[href="https://staging.rgnr.xyz/nos-abonnements/"], 
.rsc-content .wp-block-image a[href="https://staging.rgnr.xyz/nos-abonnements"] {
  display: none !important;
}

.rsc-title-ctn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  margin-top: 20px;

}
.rsc-title-ctn h4 {
  margin: 0 !important;
}
.rsc-cats {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.rsc-cats .rsc-cats-single {
  background-color: #666666;
  padding: 2px 8px;
  color: white;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
}

.rsc-title-ctn .rsc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
/* SEULEMENT les 3 boutons d'action (favoris/lire+tard/partager) — PAS le bouton commentaire */
.rsc-title-ctn .rsc-actions .rgnr-rsc-act {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #eef3f1;
  color: #1a3a36;
  border: 1px solid #dde6e3;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s, border-color .15s;
}
.rsc-title-ctn .rsc-actions .rgnr-rsc-act:hover {
  background: #1a3a36;
  color: #fff;
  border-color: #1a3a36;
}
.rsc-title-ctn .rsc-actions .rgnr-rsc-act.is-active {
  background: #fea376;
  color: #fff;
  border-color: #fea376;
}
.rsc-title-ctn .rsc-actions .rgnr-rsc-act .rgnr-rsc-icon {
  display: inline-flex;
  line-height: 0;
}

.rsc-title-ctn .rsc-actions [data-rgnr-tip]::after {
  content: attr(data-rgnr-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.rsc-title-ctn .rsc-actions [data-rgnr-tip]:hover::after {
  opacity: 1;
  visibility: visible;
}

.rsc-btn-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}
.rsc-btn-group svg {
  vertical-align: middle;
}

.rsc-playlist-container {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid var(--bb-content-border-color);
  border-radius: var(--bb-block-radius);
  margin-bottom: 20px;
  margin-top: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Style spécifique pour la zone du titre des packs de vidéos */
.pack-header {
  border-radius: 10px 10px 0 0;
  padding: 15px 20px;
  margin: -1px -1px 0 -1px;
}
.rsc-playlist-content {
  height: 350px;
  overflow: auto;
  transition: .3s;
}

/* Hauteur augmentée pour les packs de vidéos */
.rsc-playlist-container[style*="min-height:683px"] .rsc-playlist-content {
  height: 650px;
}
.rsc-playlist-content.hidden {
  height: 0px !important;
  padding: 0 !important;
  overflow: hidden;
}

/* Animation pour masquer/afficher le contenu de la sidebar */
.rsc-playlist-container.collapsed {
  transition: all 0.3s ease;
}

/* La barre de titre reste toujours visible */

/* Seul le contenu se masque */
.rsc-playlist-container.collapsed .rsc-playlist-content {
  height: 0px !important;
  padding: 0 !important;
  overflow: hidden;
  transition: all 0.3s ease;
}

.rsc-playlist-title {
  font-size: 16px;
  font-weight: bold;
  color: #ffffff;
  background-color: rgba(31, 30, 30, 1);
  padding: 10px;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rsc-playlist-title button, .rsc-playlist-title button:focus {
  margin: 0;
  padding: 2px;
  height: auto;
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
  transform-origin: 50% 50%;
  transition: .3s;
}
.rsc-playlist-title button.unfocused {
  transform: rotateZ(180deg);
}
.rsc-playlist-section {
  margin-bottom: 15px;
}
.rsc-playlist-section>a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #000;
  padding: 10px;
  border-radius: 8px;
  transition: .3s;
}
.rsc-playlist-section>a:hover, .rsc-playlist-section>a.active,
.rsc-playlist-section>button:hover, .rsc-playlist-section>button.active {
  background-color: rgba(254, 237, 223, 1);
}
.rsc-playlist-section>a img,
.rsc-playlist-section>button img {
  width: 150px;
  height: auto;
  border-radius: 10px;
}

.rsc-playlist-section>button {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #000;
  padding: 10px;
  border-radius: 8px;
  transition: .3s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.rsc-playlist-section>button h5 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  /* Limitation à 4 lignes maximum */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: calc(1.4em * 4); /* 4 lignes */
}

.rsc-playlist-section>button p {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: #999999;
}
.rsc-playlist-section>a h5 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  /* Limitation à 4 lignes maximum */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: calc(1.4em * 4); /* 4 lignes */
}
.rsc-playlist-section>a p {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: #999999;
}

.rsc-playlist-section-title {
  font-size: 14px;
  font-weight: bold;
  color: #333333;
  margin-bottom: 10px;
}

/* Boutons d'achat des packs */
.pack-purchase-buttons {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pack-purchase-buttons .btn {
  width: 100%;
  padding: 18px 24px;
  border: none;
  border-radius: 100px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.2;
  min-height: 60px;
}

.btn-buy-pack {
  background-color: #FEA376;
  color: white;
  border: none;
}

.btn-buy-pack:hover {
  background-color: #FD9A67;
  transform: translateY(-1px);
}

.btn-subscribe {
  background-color: white;
  color: #333;
  border: 2px solid #FEA376 !important;
}

.btn-subscribe:hover {
  background-color: white !important;
  color: #333 !important;
  border: 2px solid #FEA376 !important;
}

/* Boutons dans l'overlay vidéo */
.video-locked-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  align-items: center;
  width: 100%;
}

.video-locked-buttons .btn {
  width: auto;
  max-width: 280px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 25px;
  transition: all 0.3s ease;
  min-width: 200px;
}

.video-locked-buttons .btn-buy-pack {
  background-color: #FEA376;
  color: white;
  border: none;
}

.video-locked-buttons .btn-buy-pack:hover {
  background-color: #FD9A67;
  transform: translateY(-1px);
}

.video-locked-buttons .btn-subscribe {
  background-color: white;
  color: #333;
  border: 2px solid #FEA376;
}

.video-locked-buttons .btn-subscribe:hover {
  background-color: white !important;
  color: #333 !important;
  border: 2px solid #FEA376 !important;
}

/* Styles pour l'overlay vidéo verrouillée */
.video-locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-radius: 12px;
}

.video-locked-overlay h3 {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px 0;
  line-height: 1.3;
}

/* Responsive mobile pour l'overlay vidéo */
@media (max-width: 768px) {
  .video-locked-overlay {
    padding: 15px;
  }
  
  .video-locked-overlay h3 {
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.2;
  }
  
  .video-locked-buttons {
    gap: 10px;
    margin-top: 15px;
  }
  
  .video-locked-buttons .btn {
    max-width: 240px;
    padding: 10px 20px;
    font-size: 12px;
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  .video-locked-overlay {
    padding: 12px;
  }
  
  .video-locked-overlay h3 {
    font-size: 12px;
    margin-bottom: 12px;
  }
  
  .video-locked-buttons .btn {
    max-width: 200px;
    padding: 8px 16px;
    font-size: 11px;
    min-width: 160px;
  }
}

.btn-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.btn-subtitle {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.9;
  line-height: 1.2;
}

.btn-price {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}


.relatives-resources {
  margin-bottom: 20px;
  padding-top: 8px;
}
.relatives-resources .rr-header {
  position: relative;
  padding-bottom: 8px;
  border-bottom: 2px solid #EAEAEA;
}
.relatives-resources .rr-header::after {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background-color: #2C6955;
  content: "";
}
.relatives-resources .rr-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #2C6961;
  text-transform: uppercase;
  margin: 0;
}
.relatives-resources .rr-body {
  padding: 20px 0;
}
.relatives-resources .rr-single {
  display: block;
  width: 100%;
  color: black;
  text-transform: none;
  margin-bottom: 60px;
}
.relatives-resources .rr-single .rrs-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  transition: .5s;
}
.relatives-resources .rr-single .rsc-cats {
  margin-top: 10px;
  margin-bottom: 10px;
}
.relatives-resources .rr-single .rsc-course-author {
  align-items: flex-start;
}
.relatives-resources .rr-single .rsc-course-author h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.notes-block {
  max-width: 100% !important;
}

@media screen and (max-width: 591px) {
  .rsc-btn-group {
    flex-wrap: wrap;
    flex-direction: column;
  }
  .rsc-btn-group > * {
    width: 100%;
  }
  .related-quizes {
    gap: 20px;
    flex-wrap: wrap;
  }
  .related-quizes > .rq-text {
    width: 100%;
  }
  .related-quizes > div:last-child {
    width: 100%;
  }
}
@media screen and (max-width: 993px) {
  .rsc-content {
    flex-wrap: wrap;
  }
  .rsc-content > div {
    width: 100% !important;
  }
}

@media screen and (min-width: 800px) {
  .bb-buddypanel-left.buddypanel-open
    .lms-topic-sidebar-wrapper
    .lms-topic-sidebar-data {
    left: 300px !important;
  }
}

/* Responsive mobile - ordre: Vidéo → Titre → Auteur → Contenu → Sidebar (playlist/connexes) → Commentaires */
@media (max-width: 768px) {
  /* Conteneur principal en flex */
  .rsc-content {
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* #resource-feed contient vidéo, titre, auteur, contenu, commentaires */
  .rsc-content > #resource-feed {
    display: contents !important; /* Permet aux enfants de resource-feed d'être au même niveau que sidebar-wrapper */
  }
  
  /* Ordre des éléments */
  #resource-feed > *[style*="position: relative"],
  #resource-feed > div:first-child {
    order: 1 !important; /* Vidéo */
  }
  
  #resource-feed > .rsc-title-ctn {
    order: 2 !important; /* Titre */
  }
  
  #resource-feed > .rsc-course-author {
    order: 3 !important; /* Auteur */
  }
  
  /* Le contenu vient avant la sidebar */
  #resource-feed > .rsc-lesson-content {
    order: 4 !important; /* Contenu */
  }

  /* La sidebar (playlist / vidéos connexes) vient après le contenu */
  .rsc-content > .rsc-sidebar-wrapper {
    order: 5 !important; /* Sidebar */
    width: 100% !important;
  }
  
  /* Commentaires à la toute fin */
  #resource-feed .rsc-comments-section,
  #resource-feed .rsc-comments-container,
  #resource-feed .comments-area,
  #resource-feed .comment-respond,
  #resource-feed .comment-list,
  #resource-feed [class*="comment"],
  #resource-feed #comments,
  .rsc-comments-section,
  .rsc-comments-container,
  .comments-area,
  .comment-respond,
  .comment-list,
  [class*="comment"],
  #comments,
  .comment-form,
  .comment-body,
  .comment-meta,
  .bp-feedback,
  .activity-comments,
  .activity-comments-list,
  [id*="comment"] {
    order: 6 !important; /* Commentaires */
  }
  
  /* La playlist elle-même */
  .rsc-playlist-container {
    width: 100% !important;
    margin: 20px 0 !important;
    min-height: auto !important;
  }
  
  .rsc-playlist-title {
    padding: 15px;
    font-size: 16px;
  }
  
  .rsc-playlist-video {
    margin-bottom: 15px;
  }
}

/* ========================================
   STYLES POUR LA PROGRESSION DES PACKS
   ======================================== */

.pack-progress-container {
  margin-top: 15px;
  padding: 0 20px;
}

.pack-progress-bar {
  width: 100%;
  height: 8px;
  background-color: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pack-progress-fill {
  height: 100%;
  background-color: #FEA376;
  border-radius: 4px;
  transition: width 0.5s ease-in-out, background-color 0.3s ease;
  position: relative;
}

.pack-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.pack-progress-text {
  font-size: 12px;
  color: #666;
  text-align: center;
  font-weight: 500;
  margin-top: 5px;
}

/* Animation pour les packs terminés */
.pack-progress-fill[style*="100%"] {
  animation: celebration 1s ease-in-out;
}

@keyframes celebration {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Styles pour les badges des ressources */
.rsr-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  z-index: 10;
}

.pack-locked-badge {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  background: #ff4444 !important;
  color: white !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  z-index: 10 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* Styles pour les images verrouillées */
.pack-locked {
  opacity: 0.6 !important;
  filter: grayscale(0.3) !important;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  .pack-progress-container {
    padding: 0 15px;
    margin-top: 10px;
  }
  
  .pack-progress-bar {
    height: 6px;
  }
  
  .pack-progress-text {
    font-size: 11px;
  }
  
  .rsr-badge,
  .pack-locked-badge {
    font-size: 10px;
    padding: 3px 6px;
  }
}
