/**
 * Стили для отображения фото/видео игры
 * Компоненты для страницы детального просмотра игры
 */

/* Hero изображение игры */
.game-media-hero {
  width: 100%;
  margin-bottom: 32px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(10, 10, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-media-hero__image {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

/* Секции медиа */
.game-media-section {
  margin-bottom: 48px;
}

.game-media-section__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #fff;
  font-family: 'Manrope', sans-serif;
}

/* Сетка медиа */
.game-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

@media (max-width: 768px) {
  .game-media-section {
    margin-bottom: 32px;
  }

  .game-media-section__title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .game-media-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }

  .game-media-hero {
    margin-bottom: 24px;
    border-radius: 12px;
  }

  .game-media-hero__image {
    max-height: 400px;
  }
}

@media (max-width: 480px) {
  .game-media-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .game-media-section__title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .game-media-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Элемент медиа */
.game-media-item {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(10, 10, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.game-media-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.game-media-item--primary {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 9;
}

.game-media-item__image,
.game-media-item__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-media-item__image--loaded {
  opacity: 1;
  transition: opacity 0.3s;
}

.game-media-item__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  padding: 16px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-media-item:hover .game-media-item__overlay {
  opacity: 1;
}

.game-media-item__type {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(74, 168, 255, 0.3);
  color: #4aa8ff;
}

.game-media-item--video .game-media-item__type {
  background: rgba(216, 25, 80, 0.3);
  color: #d81950;
}

.game-media-item__play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #050510;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-left: auto;
  transition: transform 0.3s;
}

.game-media-item:hover .game-media-item__play-icon {
  transform: scale(1.1);
}

/* Пустое состояние */
.game-media-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #9aa0d0);
}

.game-media-empty__icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.game-media-empty__text {
  font-size: 16px;
  color: var(--text-muted, #9aa0d0);
}

/* Ошибка загрузки */
.game-media-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #9aa0d0);
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 12px;
}

/* Модальное окно для медиа */
.vs-modal__content--media {
  max-width: 90vw;
  max-height: 90vh;
  padding: 20px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-media-modal__content {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-media-modal__content img,
.game-media-modal__content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-media-modal__content video {
  width: 100%;
}

/* Адаптивные стили для модального окна медиа */
@media (max-width: 768px) {
  .vs-modal__content--media {
    padding: 12px;
    max-width: 95vw;
    max-height: 85vh;
  }

  .game-media-modal__content {
    max-width: 100%;
  }

  .game-media-modal__content img,
  .game-media-modal__content video {
    max-height: 75vh;
  }
}

@media (max-width: 480px) {
  .vs-modal__content--media {
    padding: 8px;
    max-width: 100vw;
    max-height: 90vh;
  }

  .game-media-modal__content img,
  .game-media-modal__content video {
    max-height: 70vh;
  }
}

/* Анимация появления */
@keyframes gameMediaFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.game-media-item {
  animation: gameMediaFadeIn 0.4s ease-out;
}

.game-media-item:nth-child(1) {
  animation-delay: 0.1s;
}

.game-media-item:nth-child(2) {
  animation-delay: 0.15s;
}

.game-media-item:nth-child(3) {
  animation-delay: 0.2s;
}

.game-media-item:nth-child(4) {
  animation-delay: 0.25s;
}

/* Скелетон загрузки */
.game-media-item--loading {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
