/* CSS optimisé pour la page channel (channel.php) */

/* Structure de base */
.channel-detail-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px;
  /*background: linear-gradient(145deg, #730000, #500000);*/
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  min-height: 70vh;
}

/* Header avec logo et recherche */
.logo-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  padding: 15px;
}

.logo-header img {
  max-width: 200px;
  height: auto;
  transition: transform 0.3s ease;
}

.logo-header img:hover {
  transform: scale(1.05);
}

.nav-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  margin-bottom: 20px;
}

.nav-header .search-box {
  max-width: 600px;
  width: 100%;
  position: relative;
}

.nav-header .search-box form {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 5px;
  backdrop-filter: blur(10px);
}

.nav-header .input-search {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  padding: 12px 20px;
  font-size: 16px;
  outline: none;
}

.nav-header .input-search::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.nav-header .btn-search {
  background: #ff0000;
  border: none;
  color: white;
  padding: 12px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-header .btn-search:hover {
  background: #cc0000;
  transform: scale(1.05);
}

/* En-tête de la chaîne */
.channel-header {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.channel-banner-container {
  flex-shrink: 0;
}

.channel-banner {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ff3366;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.channel-banner:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 51, 102, 0.4);
}

.channel-info {
  flex-grow: 1;
}

.channel-info h1 {
  font-size: 2.2rem;
  margin: 0 0 15px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(135deg, #ff0000 0%, #ff4040 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.channel-stats {
  display: flex;
  gap: 20px;
  color: #fff;
  font-size: 1.1rem;
  flex-wrap: wrap;
}

.channel-stats span {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 15px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.channel-stats i {
  color: #ff3366;
}

/* Filtres */
.channel-filters {
  margin: 20px 0 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  color: #fff;
  font-weight: 500;
}

.filter-group select {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group select:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 0, 0, 0.3);
}

.filter-group select:focus {
  outline: none;
  border-color: rgba(255, 0, 0, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

.filter-group select option {
  background: #222;
  color: #fff;
}

.btn-filter {
  padding: 8px 20px;
  background: #ff3366;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-filter:hover {
  background: #ff1a4d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

/* Grille des vidéos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.video-item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  height: 100%;
}

.video-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.5);
}

.video-item a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: #fff;
}

.video-thumbnail {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

.video-icons {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
  font-size: 0.9rem;
}

.video-icons p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.video-icons i {
  color: #ff3366;
}

.video-item h2 {
  padding: 15px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination a:hover {
  background: rgba(255, 51, 102, 0.3);
  transform: translateY(-2px);
  border-color: rgba(255, 51, 102, 0.5);
}

.pagination a.active {
  background: #ff3366;
  color: #fff;
  border-color: #ff3366;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

/* Sélecteur de langue */
.language-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  font-size: 14px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: all 0.3s ease;
}

.selected-language {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  cursor: pointer;
  color: #fff;
  transition: all 0.3s ease;
}

.selected-language:hover {
  background: rgba(255, 255, 255, 0.1);
}

.flag-emoji {
  font-size: 18px;
  margin-right: 8px;
}

.lang-name {
  margin-right: 8px;
}

.selected-language .fa-chevron-down {
  transition: transform 0.3s ease;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.language-selector.active .fa-chevron-down {
  transform: rotate(180deg);
}

.languages-dropdown {
  max-height: 0;
  overflow: hidden;
  list-style: none;
  margin: 0;
  padding: 0;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.7);
}

.languages-dropdown.show {
  max-height: 350px;
  overflow-y: auto;
}

.languages-dropdown li {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.languages-dropdown a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s ease;
}

.languages-dropdown a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .channel-detail-page {
    padding: 20px 15px;
  }

  .channel-info h1 {
    font-size: 1.8rem;
  }

  .channel-stats {
    font-size: 1rem;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .channel-header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .channel-info h1 {
    font-size: 1.6rem;
    justify-content: center;
  }

  .channel-stats {
    justify-content: center;
    flex-wrap: wrap;
  }

  .filters-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }

  .language-selector {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .channel-detail-page {
    padding: 15px 10px;
  }

  .channel-banner {
    width: 120px;
    height: 120px;
  }

  .channel-info h1 {
    font-size: 1.4rem;
  }

  .channel-stats {
    font-size: 0.9rem;
  }

  .channel-stats span {
    padding: 6px 12px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-item h2 {
    font-size: 0.95rem;
    padding: 12px;
  }

  .pagination a,
  .pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

/* Optimisations d'accessibilité */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (prefers-contrast: high) {
  .channel-banner {
    border: 4px solid #fff;
  }

  .channel-info h1 {
    -webkit-text-fill-color: #fff;
    text-shadow: 0 0 2px #000;
  }

  .btn-filter,
  .pagination a.active {
    border: 2px solid #fff;
  }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  .video-item {
    background: rgba(0, 0, 0, 0.5);
  }

  .channel-header {
    background: rgba(0, 0, 0, 0.4);
  }
}
