/**
 * Styles pour l'intégration YouTube
 * Gainde Sportif - Chaîne UCE-lOkEy2p0gQTeN_66fquQ
 */

/* Header de chaîne YouTube */
.youtube-channel-header {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  color: white;
  padding: var(--space-8) var(--space-4);
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
}

.channel-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.channel-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: var(--shadow-lg);
}

.channel-details h2 {
  margin: 0 0 var(--space-2) 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.channel-subscribers {
  margin: 0 0 var(--space-3) 0;
  font-size: 1rem;
  opacity: 0.9;
}

.channel-description {
  margin: 0 0 var(--space-3) 0;
  line-height: 1.5;
  opacity: 0.8;
}

.channel-stats {
  display: flex;
  gap: var(--space-6);
  font-size: 0.875rem;
}

.channel-stats .stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.channel-stats .stat strong {
  color: white;
}

.channel-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Grille de playlists */
.youtube-playlists {
  margin-top: var(--space-8);
}

.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.playlist-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.playlist-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.playlist-thumbnail {
  position: relative;
  padding-top: 56.25%; /* 16:9 aspect ratio */
}

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

.playlist-count {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
}

.playlist-info {
  padding: var(--space-4);
}

.playlist-title {
  margin: 0 0 var(--space-2) 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
}

.playlist-desc {
  margin: 0 0 var(--space-3) 0;
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.4;
}

/* Amélioration des items de streaming existants */
.streaming-item {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  margin-bottom: var(--space-4);
}

.streaming-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.streaming-item.live {
  border-left: 4px solid #ff0000;
}

.streaming-item.replay {
  border-left: 4px solid var(--primary);
}

.streaming-thumbnail {
  position: relative;
  padding-top: 56.25%;
}

.streaming-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  background: #ff0000;
  color: white;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.duration-badge {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
}

.streaming-info {
  padding: var(--space-4);
}

.streaming-title {
  margin: 0 0 var(--space-2) 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
}

.streaming-desc {
  margin: 0 0 var(--space-3) 0;
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.streaming-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.streaming-actions {
  padding: var(--space-4);
  padding-top: 0;
  display: flex;
  gap: var(--space-2);
}

/* Conteneur de chat YouTube */
.youtube-chat-container {
  margin-top: var(--space-6);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.youtube-chat-container iframe {
  border: none;
  width: 100%;
}

/* État vide */
.no-live, .no-videos {
  text-align: center;
  padding: var(--space-8);
  color: var(--gray-500);
}

.no-live p, .no-videos p {
  margin: 0 0 var(--space-4) 0;
  font-size: 1rem;
}

/* Suggestion de vidéo suivante */
.video-suggestion {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-4);
  max-width: 300px;
  z-index: var(--z-toast);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.suggestion-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.suggestion-content p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--gray-700);
  font-weight: 500;
}

.suggestion-content .btn {
  align-self: flex-start;
}

/* Lecteur YouTube amélioré */
#youtube-player {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.streaming-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-lg);
}

/* Mode plein écran */
.streaming-player-wrap.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-modal);
  background: black;
}

.streaming-player-wrap.fullscreen .streaming-aspect {
  height: 100%;
  border-radius: 0;
}

.streaming-player-wrap.fullscreen .streaming-iframe {
  height: 100%;
  border-radius: 0;
}

/* Bouton plein écran */
.fullscreen-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-normal);
}

.fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Contrôles personnalisés */
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.streaming-player-wrap:hover .custom-controls {
  opacity: 1;
}

.custom-controls .btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
}

.custom-controls .btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .channel-info {
    flex-direction: column;
    text-align: center;
  }
  
  .channel-stats {
    justify-content: center;
  }
  
  .channel-actions {
    justify-content: center;
  }
  
  .playlists-grid {
    grid-template-columns: 1fr;
  }
  
  .streaming-actions {
    flex-direction: column;
  }
  
  .streaming-actions .btn {
    width: 100%;
  }
  
  .video-suggestion {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-2);
    max-width: none;
  }
  
  .streaming-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  .youtube-channel-header {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
  }
  
  .streaming-item {
    background: var(--gray-100);
  }
  
  .playlist-card {
    background: var(--gray-100);
  }
  
  .streaming-title,
  .playlist-title {
    color: var(--gray-900);
  }
  
  .streaming-desc,
  .playlist-desc {
    color: var(--gray-600);
  }
  
  .video-suggestion {
    background: var(--gray-100);
  }
  
  .suggestion-content p {
    color: var(--gray-700);
  }
}

/* Animation de chargement */
.loading-skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-thumbnail {
  height: 180px;
  margin-bottom: var(--space-3);
}

.skeleton-title {
  height: 20px;
  margin-bottom: var(--space-2);
  width: 80%;
}

.skeleton-desc {
  height: 14px;
  margin-bottom: var(--space-1);
  width: 100%;
}

.skeleton-desc:last-child {
  width: 60%;
}
