/**
 * Галерея VERSUS Arena (public/arena), совместимо с js/arena-gallery.js
 */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 24px;
  }

  .gallery-item {
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
  }

  .gallery-item__overlay {
    padding: 12px;
    opacity: 1;
  }

  .gallery-item__type {
    font-size: 11px;
    padding: 3px 10px;
  }
}

.gallery-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;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.gallery-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item:hover .gallery-item__image {
  transform: scale(1.05);
}

.gallery-item__image--loaded {
  opacity: 1;
}

.gallery-item__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(216, 25, 80, 0.2), rgba(74, 168, 255, 0.2));
  color: var(--text-muted, #9aa0d0);
  font-size: 48px;
}

.gallery-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;
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__type {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.gallery-item__type--photo {
  background: rgba(74, 168, 255, 0.3);
  color: #4aa8ff;
}

.gallery-item__type--video {
  background: rgba(216, 25, 80, 0.3);
  color: #d81950;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 20px;
  background: rgba(10, 10, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.gallery-filter-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: var(--text-main, #f4f4ff);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
}

.gallery-filter-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.gallery-filter-btn--active {
  background: linear-gradient(135deg, var(--accent-red, #d81950), var(--accent-blue, #4aa8ff));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 168, 255, 0.3);
}

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #9aa0d0);
  display: none;
}

.gallery-empty__icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.gallery-empty h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: var(--text-main, #f4f4ff);
}

.gallery-empty p {
  margin: 0;
  font-size: 14px;
}

.gallery-lightbox {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox__media {
  width: 100%;
  max-width: 1200px;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.gallery-lightbox__media img,
.gallery-lightbox__media video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox__media video {
  width: 100%;
}

.gallery-lightbox__info {
  text-align: center;
  color: #fff;
  padding: 0 20px;
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 20px;
}

.gallery-lightbox__prev,
.gallery-lightbox__next {
  pointer-events: all;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  font-size: 0;
}

.gallery-lightbox__prev:hover,
.gallery-lightbox__next:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

@keyframes galleryFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gallery-item {
  animation: galleryFadeIn 0.3s ease-out;
}
