/* ==============================================================================
   TEAM FISHER — VIDÉOTHÈQUE & MÉDIATHÈQUE VIDÉOS
   Fichier dédié : assets/css/mediatheque-videos.css
   Charte graphique officielle : Bleu institutionnel, Or/accent, Typographie soignée
   ============================================================================== */

/* --- En-tête de section & Barre d'outils Vidéos --- */
.tf-videos-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.tf-videos-title-group {
  max-width: 720px;
}

.tf-videos-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tf-blue-primary, #00007f);
  background: var(--tf-blue-subtle, #e8edff);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tf-videos-channel-badge svg {
  color: #ff0000;
}

.tf-videos-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tf-videos-btn-yt {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ff0000;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.25);
}

.tf-videos-btn-yt:hover {
  background: #cc0000;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.35);
  color: #ffffff !important;
}

.tf-videos-btn-yt svg {
  flex-shrink: 0;
}

/* --- Barre de filtres secondaires Vidéos --- */
.tf-videos-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--tf-gray-50, #f8fafc);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--tf-gray-200, #e2e8f0);
  margin-bottom: 2rem;
}

.tf-videos-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tf-video-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--tf-white, #ffffff);
  border: 1px solid var(--tf-gray-200, #cbd5e1);
  color: var(--tf-gray-700, #334155);
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tf-video-tab-btn:hover {
  background: var(--tf-blue-subtle, #e8edff);
  color: var(--tf-blue-primary, #00007f);
  border-color: var(--tf-blue-primary, #00007f);
}

.tf-video-tab-btn.active {
  background: var(--tf-blue-primary, #00007f);
  color: #ffffff;
  border-color: var(--tf-blue-primary, #00007f);
  box-shadow: 0 2px 6px rgba(0, 0, 127, 0.2);
}

.tf-video-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-weight: 700;
}

.tf-video-tab-btn.active .tf-video-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.tf-videos-count-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tf-blue-primary, #00007f);
}

/* --- Grille des Vidéos --- */
.tf-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

@media (max-width: 640px) {
  .tf-videos-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* --- Carte Vidéo --- */
.tf-video-card {
  background: var(--tf-white, #ffffff);
  border: 1px solid var(--tf-gray-200, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.tf-video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 80, 0.09);
  border-color: var(--tf-blue-subtle, #c7d7ff);
}

/* Vignette & Façade */
.tf-video-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
  cursor: pointer;
}

.tf-video-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}

.tf-video-card:hover .tf-video-thumb-img {
  transform: scale(1.04);
}

.tf-video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 42px;
  background: rgba(0, 0, 127, 0.88);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  transition: all 0.25s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.tf-video-play-triangle {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 15px solid var(--tf-gold-accent, #d4af37);
  margin-left: 2px;
  transition: border-left-color 0.2s ease;
}

.tf-video-card:hover .tf-video-play-btn,
.tf-video-thumb-wrap:focus-visible .tf-video-play-btn {
  background: #ff0000;
  transform: translate(-50%, -50%) scale(1.12);
  border-color: #ffffff;
  box-shadow: 0 6px 24px rgba(255, 0, 0, 0.5);
}

.tf-video-card:hover .tf-video-play-triangle,
.tf-video-thumb-wrap:focus-visible .tf-video-play-triangle {
  border-left-color: #ffffff;
}

.tf-video-duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.82);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tf-video-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.tf-video-type-badge.type-video {
  background: rgba(0, 0, 127, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.tf-video-type-badge.type-short {
  background: rgba(220, 38, 38, 0.92);
  color: #ffffff;
}

/* Corps de la carte */
.tf-video-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.tf-video-channel-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tf-blue-primary, #00007f);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tf-video-channel-tag svg {
  color: var(--tf-gold-accent, #d4af37);
}

.tf-video-card-title {
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--tf-gray-900, #0f172a);
  margin: 0 0 0.6rem 0;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tf-video-card-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--tf-gray-600, #475569);
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tf-video-card-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: var(--tf-gray-500, #64748b);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--tf-gray-100, #f1f5f9);
}

.tf-video-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Pied de carte & Boutons d'action */
.tf-video-card-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.tf-video-btn-play {
  flex-grow: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--tf-blue-primary, #00007f);
  color: #ffffff !important;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md, 8px);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tf-video-btn-play:hover {
  background: #0000aa;
  transform: translateY(-1px);
}

.tf-video-btn-ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--tf-gray-200, #cbd5e1);
  background: var(--tf-white, #ffffff);
  color: var(--tf-gray-600, #475569);
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tf-video-btn-ext:hover {
  background: #ff0000;
  color: #ffffff;
  border-color: #ff0000;
}

/* --- Bloc Playlist Officielle des Téléversements --- */
.tf-playlist-block {
  background: linear-gradient(135deg, #0a0e27 0%, #000055 100%);
  color: #ffffff;
  border-radius: var(--radius-lg, 16px);
  padding: 2.25rem 2rem;
  margin-bottom: 3.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 80, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.tf-playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tf-playlist-title {
  color: #ffffff;
  font-size: 1.35rem;
  margin: 0 0 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tf-playlist-title svg {
  color: var(--tf-gold-accent, #d4af37);
}

.tf-playlist-desc {
  font-size: 0.92rem;
  color: #cbd5e1;
  max-width: 720px;
  margin: 0;
}

.tf-playlist-embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: #000000;
}

.tf-playlist-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.tf-playlist-facade {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
  cursor: pointer;
  color: #ffffff;
  text-align: center;
  padding: 1.5rem;
  transition: background 0.3s ease;
}

.tf-playlist-facade:hover {
  background: radial-gradient(circle at center, #334155 0%, #020617 100%);
}

.tf-playlist-facade-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #ff0000;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: 0 4px 18px rgba(255, 0, 0, 0.45);
  margin-top: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tf-playlist-facade:hover .tf-playlist-facade-btn {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(255, 0, 0, 0.6);
}

/* --- Modale de Lecture Vidéo --- */
.tf-video-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 28, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tf-video-modal-backdrop.is-open {
  display: flex;
  opacity: 1;
}

.tf-video-modal-dialog {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 920px;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.tf-video-modal-backdrop.is-open .tf-video-modal-dialog {
  transform: scale(1);
}

.tf-video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 1rem;
}

.tf-video-modal-title {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.tf-video-modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.tf-video-modal-close-btn:hover,
.tf-video-modal-close-btn:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid var(--tf-gold-accent, #d4af37);
}

.tf-video-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.tf-video-player-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.tf-video-modal-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: #020617;
  color: #ffffff;
}

.tf-video-modal-fallback.is-visible {
  display: flex;
}

.tf-video-modal-footer {
  padding: 0.85rem 1.25rem;
  background: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tf-video-modal-channel-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: #94a3b8;
}

.tf-video-modal-channel-info strong {
  color: #ffffff;
}

.tf-video-modal-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--tf-gold-accent, #d4af37);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tf-video-modal-ext-link:hover {
  color: #f1d575;
  text-decoration: underline;
}

/* Notice d'état vide */
.tf-videos-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--tf-gray-50, #f8fafc);
  border: 1px solid var(--tf-gray-200, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
}

.tf-videos-empty-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.tf-videos-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tf-gray-800, #1e293b);
  margin-bottom: 0.4rem;
}

.tf-videos-empty-text {
  font-size: 0.9rem;
  color: var(--tf-gray-600, #64748b);
  margin: 0;
}
