/**
 * Videos & Playlists Styles
 * Styles pour l'affichage des vidéos et playlists YouTube
 *
 * @author Claude Sonnet 4.5
 * @date 3 Janvier 2026
 */

/* =====================================================
   GRILLES DE VIDÉOS
   ===================================================== */

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

@media (max-width: 768px) {
  .videos-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* =====================================================
   CARTE VIDÉO
   ===================================================== */

.video-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* Ratio 16:9 */
  background: #000;
  overflow: hidden;
}

.video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(255, 0, 0, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.video-card:hover .video-play-overlay {
  opacity: 1;
}

.video-views {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.video-info {
  padding: 1rem;
}

.video-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-description {
  font-size: 0.875rem;
  color: #666;
  margin: 0 0 0.75rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: #999;
}

.video-category {
  background: #f0f0f0;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
  color: #666;
}

.video-date {
  color: #999;
}

/* =====================================================
   GRILLE DE PLAYLISTS
   ===================================================== */

.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

@media (max-width: 768px) {
  .playlists-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* =====================================================
   CARTE PLAYLIST
   ===================================================== */

.playlist-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.playlist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.playlist-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  overflow: hidden;
}

.playlist-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.playlist-card:hover .playlist-thumbnail img {
  transform: scale(1.05);
}

.playlist-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.playlist-card:hover .playlist-overlay {
  opacity: 1;
}

.playlist-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.playlist-play-icon {
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.playlist-card:hover .playlist-play-icon {
  opacity: 1;
  transform: scale(1);
}

.playlist-info {
  padding: 1rem;
}

.playlist-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-description {
  font-size: 0.875rem;
  color: #666;
  margin: 0 0 0.75rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: #999;
}

/* =====================================================
   MODAL VIDÉO
   ===================================================== */

.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.video-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  z-index: 10000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.video-player-wrapper {
  position: relative;
  padding-top: 56.25%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* Pour les vidéos uploadées (HTML5 video), pas de padding-top */
.video-player-wrapper:has(video) {
  padding-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-player-wrapper video {
  width: 100%;
  height: auto;
  max-height: 80vh;
  border-radius: 8px;
}

/* =====================================================
   DÉTAIL PLAYLIST
   ===================================================== */

.playlist-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.playlist-header {
  margin-bottom: 2rem;
}

.playlist-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 1rem;
}

.playlist-description-full {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.playlist-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: #999;
}

.playlist-videos-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.playlist-video-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.playlist-video-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(4px);
}

.playlist-video-index {
  font-size: 1.25rem;
  font-weight: 600;
  color: #999;
  min-width: 40px;
  text-align: center;
}

.playlist-video-thumbnail {
  position: relative;
  width: 160px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.playlist-video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-video-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  display: flex;
  align-items: center;
}

.playlist-video-info {
  flex: 1;
  min-width: 0;
}

.playlist-video-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.25rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-video-meta {
  font-size: 0.875rem;
  color: #999;
  margin: 0;
}

@media (max-width: 768px) {
  .playlist-video-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .playlist-video-thumbnail {
    width: 100%;
    height: auto;
    padding-top: 56.25%;
  }

  .playlist-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
  }

  .playlist-video-index {
    min-width: auto;
  }
}

/* =====================================================
   ÉTATS VIDES & CHARGEMENT
   ===================================================== */

.loading-spinner {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
  font-size: 1rem;
}

.no-videos,
.no-playlists {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
  font-size: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
}

.error-message {
  text-align: center;
  padding: 2rem 1rem;
  color: #dc2626;
  font-size: 1rem;
  background: #fee;
  border-radius: 8px;
  border: 1px solid #fcc;
}

/* =====================================================
   SECTION VIDÉO MISE EN AVANT
   ===================================================== */

.featured-video-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  padding: 3rem 0;
  margin: 2rem 0;
  border-radius: 12px;
}

.featured-video-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.featured-video-title {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  text-align: center;
}

.featured-video-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 992px) {
  .featured-video-content {
    grid-template-columns: 1fr;
  }
}

.featured-video-player {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.featured-video-info {
  color: #fff;
}

.featured-video-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
  line-height: 1.4;
}

.featured-video-info p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 1.5rem;
}

.featured-video-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ff0000;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.featured-video-cta:hover {
  background: #cc0000;
}
