/* Gallery Styles - Identical to proimobil.md */

/* Main Gallery Container */
.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Main Media - 16:9 aspect ratio */
.gallery-main-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-main-media::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 50px;
  background-image: url("/assets/images/logo-admin.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.5;
  pointer-events: none;
  z-index: 2;
  filter: brightness(0) invert(1); /* Делаем логотип белым для лучшей видимости */
}

.gallery-main-media img,
.gallery-main-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  cursor: default !important;
}

/* Thumbnails Row - Fixed 4-column grid */
.gallery-thumbnails-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  height: 72px; /* Fixed height on mobile */
}

@media (min-width: 768px) {
  .gallery-thumbnails-row {
    height: 96px; /* Taller on desktop */
  }
}

/* Thumbnail - Fixed size, equal width */
.gallery-thumbnail {
  border: none;
  padding: 0;
  background: #000; /* Black placeholder */
  cursor: pointer;
  border-radius: 6px;
  opacity: 0.85;
  transition: opacity 0.2s ease-in-out, border-color 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-thumbnail.loading {
  background: #000; /* Black placeholder while loading */
}

.gallery-thumbnail:hover {
  opacity: 1;
}

.gallery-thumbnail.active {
  opacity: 1;
  /* Red border for active thumbnail */
  border: 2px solid #dc3545;
  padding: 0;
}

.gallery-thumbnail img,
.gallery-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  background: #000; /* Black background for placeholder */
  cursor: default !important;
}

/* Fullscreen Overlay */
.gallery-fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
}

.gallery-fullscreen-overlay > div {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  overflow: hidden;
  background: #000;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-fullscreen-overlay > div::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 100px;
  max-width: 30vw;
  max-height: 10vh;
  background-image: url("/assets/images/logo-admin.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.5;
  pointer-events: none;
  z-index: 10;
  filter: brightness(0) invert(1); /* Делаем логотип белым для лучшей видимости */
}

.gallery-fullscreen-overlay img,
.gallery-fullscreen-overlay video {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  cursor: default !important;
  display: block;
}

/* Fullscreen buttons - center icons */
.gallery-fullscreen-overlay button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.gallery-fullscreen-overlay button::before,
.gallery-fullscreen-overlay button::after {
  content: none !important;
}

/* Media video class for main gallery */
.media-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  background: #000;
}

