 /* ===========================================
   Direct (style YouTube)
   =========================================== */

/* Conteneur principal qui gère la disposition */
.direct-container {
  display: flex;
  flex-direction: column; /* Mobile-first : une seule colonne */
  background-color: var(--bg-secondary); /* Fond de page depuis main.css */
  padding: var(--space-lg); /* Espace en haut/bas sur mobile */
}

/* Colonne de gauche : vidéo et suggestions */
.main-content {
  flex: 1; /* Prend tout l'espace disponible */
  min-width: 0; /* Correction pour le 'flex-shrink' */
}

/* Colonne de droite : publicités */
.sidebar-ads {
  flex-shrink: 0;
  width: 100%; /* Pleine largeur sur mobile */
  margin-top: var(--space-xl);
}

/* Layout pour écrans larges (Desktop) */
@media (min-width: 992px) {
  .direct-container {
    flex-direction: row; /* Passage en 2 colonnes */
    padding: var(--space-xl);
    gap: var(--space-xl); /* Espace entre les 2 colonnes */
  }

  .main-content {
    /* Prend tout l'espace moins la sidebar */
    width: calc(100% - 320px - var(--space-xl));
  }

  .sidebar-ads {
    width: 320px; /* Largeur fixe pour la colonne de pub */
    margin-top: 0;

    /* Bonus: Rendre la sidebar "collante" */
    position: sticky;
    top: 90px; /* Hauteur de navbar + ribbon (à ajuster) */
    height: calc(100vh - 90px);
    overflow-y: auto; /* Permet aux pubs de défiler */
  }
   
  /* Scrollbar customisée pour la sidebar */
  .sidebar-ads::-webkit-scrollbar { width: 6px; }
  .sidebar-ads::-webkit-scrollbar-track { background: var(--bg-tertiary); }
  .sidebar-ads::-webkit-scrollbar-thumb { background: var(--border-dark); }
}

/* ===========================================
   LECTEUR VIDÉO
   =========================================== */

.main-video-player {
  /* Le 16:9 est géré par la classe Bootstrap "ratio" */
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
}

.main-video-player iframe,
.main-video-player video {
  width: 100%;
  height: 100%;
}

.main-video-info {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-xl);
}

.main-video-info .video-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.main-video-info .video-category {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color); /* Utilise la variable ! */
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.main-video-info .video-description {
  font-size: 1rem;
  color: var(--text-muted); /* Utilise la variable ! */
  line-height: 1.6;
}

/* ===========================================
   LISTE "AUTRES VIDÉOS" (Suggestions)
   =========================================== */

.other-videos-list h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.horizontal-scroll {
  display: flex;
  overflow-x: auto;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  
  /* Scrollbar customisée */
  scrollbar-width: thin;
  scrollbar-color: var(--border-dark) var(--bg-secondary);
}

.horizontal-scroll::-webkit-scrollbar { height: 8px; }
.horizontal-scroll::-webkit-scrollbar-track { background: var(--bg-tertiary); border-radius: 4px; }
.horizontal-scroll::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 4px; }
.horizontal-scroll::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

.video-thumb-card {
  /* On hérite des styles de .card de main.css */
  flex: 0 0 220px; /* Largeur fixe */
  cursor: pointer;
  border: 1px solid var(--border-color);
  /* L'animation de .card:hover de main.css s'applique déjà */
}

.video-thumb-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.video-thumb-card .card-body {
  padding: var(--space-sm);
}

.video-thumb-card .card-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  /* Limiter le texte à 2 lignes */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================================
   SIDEBAR PUBLICITAIRE
   =========================================== */

.pub-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
  background: var(--bg-primary);
}

.pub-slide {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.pub-slide.banniere { height: 150px; }
.pub-slide.interstitiel { height: 300px; }

.pub-item {
  display: none;
  cursor: pointer;
  height: 100%;
  width: 100%;
}

.pub-item.active {
  display: block;
  animation: fadeIn 0.5s ease; /* Joli fondu */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pub-item .img-container {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-secondary);
  overflow: hidden;
}

.pub-item .img-container img {
  height: 100%;
  width: 100%;
  object-fit: cover; /* Remplit l'espace */
}

/* Optionnel: si tu préfères que l'image ne soit pas coupée */
/*
.pub-slide.banniere .img-container img { object-fit: contain; }
.pub-slide.interstitiel .img-container img { object-fit: contain; }
*/

.pub-title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px;
  text-align: center;
  font-size: 0.9rem;
  transform: translateY(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.pub-item:hover .pub-title-overlay {
  transform: translateY(0);
  opacity: 1;
}

.pub-navigation {
  /* Positionne les flèches en bas au centre */
  position: absolute;
  bottom: var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}