/**
 * Стили для ленивой загрузки видео
 */

/* Контейнер для видео */
.lazy-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
}

/* Специальные стили для слайдера */
.install-slide .lazy-video-container {
  position: relative !important;
  width: 100%;
  height: 100%;
  display: block;
}

.install-slide.main .lazy-video-container {
  width: 800px;
  height: 500px;
}

.install-slide.next .lazy-video-container {
  width: 600px;
  height: 400px;
}

.install-slide .lazy-video-container img,
.install-slide .lazy-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Мобильные устройства */
@media (max-width: 900px) {
  .install-slide.main .lazy-video-container {
    width: 100%;
    max-width: 80%;
    margin: 0;
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 250px;
  }
  
  .install-slide.next .lazy-video-container {
    display: none;
  }
}

/* Poster изображение */
.lazy-video-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  transition: opacity 0.3s ease-out;
}

/* Видео элемент */
.lazy-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Состояние загрузки */
.lazy-video-container.loading-video::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lazy-video-spinner 0.8s linear infinite;
  z-index: 3;
}

@keyframes lazy-video-spinner {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Состояние успешной загрузки */
.lazy-video-container.video-loaded {
  /* Можно добавить дополнительные стили */
}

/* Состояние ошибки загрузки */
.lazy-video-container.video-error::before {
  content: '⚠';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: rgba(255, 255, 255, 0.7);
  z-index: 3;
}



/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .lazy-video-container.loading-video::after {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
  
  .lazy-video-container.video-error::before {
    font-size: 36px;
  }
  
  .lazy-video-container.video-error::after {
    font-size: 12px;
  }
}

/* Плавное появление видео */
.lazy-video-container video {
  transition: opacity 0.3s ease-in;
}

/* Оптимизация для печати */
@media print {
  .lazy-video-container {
    display: none;
  }
}

/* Поддержка prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .lazy-video-container,
  .lazy-video-container video,
  .lazy-video-poster {
    transition: none !important;
    animation: none !important;
  }
}

/* Дополнительные стили для полноэкранного видео */
.lazy-video-container.fullscreen-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Кнопка воспроизведения на poster'е (опционально) */
.lazy-video-container.with-play-button .lazy-video-poster::after {
  content: '▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.lazy-video-container.with-play-button .lazy-video-poster:hover::after {
  background-color: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
  .lazy-video-container.with-play-button .lazy-video-poster::after {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
}

