/* Frontend Styles for Media Slider Block */

.cgb-media-slider {
  padding: 0;
  margin: 20px 0;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

.cgb-slider-container {
  width: 100%;
  position: relative;
}

/* Main Display Area */
.cgb-slider-main {
  width: 100%;
  position: relative;
  background: #000;
  margin-bottom: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cgb-slide-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  display: none;
}

.cgb-slide-wrapper.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cgb-image-container,
.cgb-video-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cgb-slide-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cgb-slide-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cgb-video-preview {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.cgb-video-preview:hover {
  opacity: 0.9;
}

.cgb-video-poster {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cgb-video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.cgb-video-placeholder {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cgb-video-placeholder svg {
  opacity: 0.6;
}

.cgb-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.3s ease;
  z-index: 5;
  display: none;
}

.cgb-video-active .cgb-play-overlay {
  display: block;
}

.cgb-video-container:hover .cgb-play-overlay {
  opacity: 1;
}

.cgb-zoom-button {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 10;
}

.cgb-zoom-button:hover {
  background: rgba(0, 0, 0, 0.8);
  box-shadow: unset;
  top: 16px;
}

.cgb-slide-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 14px;
}

/* Thumbnail Navigation */
.cgb-thumbnails-wrapper {
  position: relative;
  width: 100%;
  margin-top: 16px;
}

.cgb-thumbnails-container {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.cgb-slider-thumbnails {
  display: flex;
  gap: 10px;
  transition: transform 0.3s ease;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cgb-thumbnail {
  flex: 0 0 calc(25% - 8px);
  min-width: calc(25% - 8px);
  width: calc(25% - 8px);
  height: 120px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #f0f0f0;
  padding: 0;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .cgb-thumbnail {
    height: 80px;
  }
}

.cgb-thumbnail:hover {
  outline: 2px solid #38b54b;
  outline-offset: -2px;
  top: 0;
  box-shadow: unset;
}

.cgb-thumbnail.active {
  outline: 2px solid #38b54b;
  outline-offset: -2px;
  box-shadow: 0 0 0 2px rgba(56, 181, 75, 0.2);
}

.cgb-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cgb-thumbnail-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.cgb-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: #e0e0e0;
}

.cgb-thumbnail-video-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lightbox Styles */
.cgb-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cgb-lightbox.active {
  display: flex;
}

.cgb-lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
  cursor: default;
}

.cgb-lightbox-content img,
.cgb-lightbox-content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.cgb-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: background 0.3s ease;
}

.cgb-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.8);
  top: 20px;
  box-shadow: unset;
}

/* Thumbnail Navigation Arrows */
.cgb-thumbnail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.3s ease;
  color: white;
  font-size: 20px;
  padding: 0;
}

.cgb-thumbnail-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  top: 50%;
  box-shadow: unset;
}

.cgb-thumbnail-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cgb-thumbnail-nav-prev {
  left: 10px;
}

.cgb-thumbnail-nav-next {
  right: 10px;
}

.cgb-thumbnail-nav svg {
  width: 24px;
  height: 24px;
  fill: white;
}
