/* Styles optimisés pour la page d'accueil */

/* Performance optimisée - réduction des recalculs de layout */
.index-page {
  margin: 0 auto;
  padding: 20px 15px;
  contain: layout style;
}

/* Bannière d'accueil optimisée */
.welcome-banner {
  text-align: center;
  padding: 60px 20px;
  background: url("/fond.webp") center/cover no-repeat;
  border-radius: 15px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.welcome-banner > * {
  position: relative;
  z-index: 1;
}

.welcome-banner img {
  max-width: 300px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.welcome-banner img:hover {
  transform: scale(1.05);
}

.welcome-banner h1 {
  font-size: 2.5rem;
  margin: 30px 0;
  background: linear-gradient(45deg, #ff0000, #ff6666);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 700;
}

/* Boîte de recherche optimisée */
.search-box {
  max-width: 500px;
  margin: 30px auto;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  backdrop-filter: blur(10px);
  padding: 5px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.search-box form {
  display: flex;
  align-items: center;
}

.search-box .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;
}

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

.search-box .input-search {
  flex: 1;
  border: none;
  background: transparent;
  color: white;
  padding: 12px 20px;
  font-size: 16px;
  outline: none;
}

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

/* Menu principal optimisé */
.menu {
  display: flex;
  justify-content: center;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  flex-wrap: wrap;
}

.menu li {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.menu li:hover {
  background: rgba(255, 0, 0, 0.2);
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(255, 0, 0, 0.3);
}

.menu li a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.menu li i {
  font-size: 1.5rem;
  color: #ff0000;
  transition: all 0.3s ease;
}

.menu li:hover i {
  color: #fff;
  transform: scale(1.2);
}

.menu li.active {
  background: rgba(255, 0, 0, 0.3);
}

/* Section performers avec défilement optimisé */
.top-performers {
  margin: 40px 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  padding: 20px;
  position: relative;
}

.performers-carousel {
  display: flex;
  animation: scroll-horizontal 60s linear infinite;
  gap: 20px;
  will-change: transform;
}

.performer-item {
  flex: 0 0 auto;
  text-align: center;
  min-width: 120px;
  transition: transform 0.3s ease;
}

.performer-item:hover {
  transform: scale(1.1);
}

.performer-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 10px;
  border: 3px solid #ff0000;
  transition: all 0.3s ease;
}

.performer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.performer-item:hover .performer-avatar {
  border-color: #fff;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.performer-item:hover .performer-avatar img {
  transform: scale(1.1);
}

.performer-item h2 {
  font-size: 0.9rem;
  margin: 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.performer-item a {
  text-decoration: none;
  color: inherit;
}

/* Section chaînes avec défilement optimisé */
.top-channels {
  margin: 40px 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  padding: 20px;
  position: relative;
}

.channels-strip {
  display: flex;
  animation: scroll-horizontal-reverse 80s linear infinite;
  gap: 25px;
  will-change: transform;
}

.channel-strip-item {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 15px;
  min-width: 200px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.channel-strip-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.1);
  border-color: #ff0000;
  box-shadow: 0 8px 20px rgba(255, 0, 0, 0.2);
}

.channel-strip-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.channel-strip-info h3 {
  font-size: 1rem;
  margin: 0 0 5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-strip-info span {
  font-size: 0.85rem;
  color: #ccc;
}

.channel-strip-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Animations de défilement */
@keyframes scroll-horizontal {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes scroll-horizontal-reverse {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

/* Filtres optimisés */
.filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 40px 0;
  flex-wrap: wrap;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
}

.filters a {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  border-radius: 25px;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 2px solid transparent;
  backdrop-filter: blur(10px);
}

.filters a:hover {
  background: rgba(255, 0, 0, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

.filters a.completed {
  background: #ff0000;
  color: #fff;
  border-color: #fff;
}

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

.video-item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateZ(0); /* Optimisation GPU */
  will-change: transform, box-shadow;
}

.video-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  border-color: #ff0000;
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

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

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

.video-icons {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px 15px 10px;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  transform: translateZ(0);
}

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

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

.video-item h2 {
  padding: 15px;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.video-item:hover h2 {
  color: #ff0000;
}

.video-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Pagination optimisée */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 40px 0;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}

.page-item {
  margin: 0;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 2px solid transparent;
}

.page-link:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: #ff0000;
  transform: translateY(-2px);
}

.page-item.active .page-link {
  background: #ff0000;
  color: #fff;
  border-color: #fff;
}

/* États de chargement */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #fff;
  font-size: 1.1rem;
}

.loading i {
  font-size: 2rem;
  color: #ff0000;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
  display: block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.no-videos {
  text-align: center;
  padding: 60px 20px;
  color: #ccc;
  font-size: 1.1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  margin: 40px 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }

  .welcome-banner h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .index-page {
    padding: 15px;
  }

  .welcome-banner {
    padding: 40px 15px;
  }

  .welcome-banner h1 {
    font-size: 1.8rem;
  }

  .welcome-banner img {
    max-width: 250px;
  }

  .menu {
    gap: 15px;
  }

  .menu li {
    width: 50px;
    height: 50px;
  }

  .menu li i {
    font-size: 1.2rem;
  }

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

  .filters {
    gap: 10px;
    padding: 15px;
  }

  .filters a {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .top-performers,
  .top-channels {
    padding: 15px;
  }

  .performer-item {
    min-width: 100px;
  }

  .channel-strip-item {
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  .welcome-banner h1 {
    font-size: 1.5rem;
  }

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

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

  .pagination {
    gap: 5px;
  }

  .page-link {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}

/* Optimisations de performance */
.video-item,
.performer-item,
.channel-strip-item {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Réduction du motion pour les utilisateurs qui le préfèrent */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .performers-carousel,
  .channels-strip {
    animation: none;
  }
}

/* Optimisation pour les écrans à haute densité */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .video-thumbnail img,
  .performer-avatar img,
  .channel-strip-item img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}
