/* NextVideoGallery Frontend Styles */

.dnxte-video-gallery-wrapper {
  width: 100%;
  position: relative;
}

/* Filter Bar */
.dnxte-video-gallery-filter-bar {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 24px;
  justify-content: center;
}

.dnxte-video-filter-layout-tabs {
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0;
}

.dnxte-video-filter-layout-tabs .dnxte-video-gallery-filter-item {
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 16px;
}

.dnxte-video-filter-layout-tabs .dnxte-video-gallery-filter-item.active {
  border-bottom-color: #2ea3f2;
}

.dnxte-video-filter-layout-pills .dnxte-video-gallery-filter-item {
  border-radius: 20px;
  padding: 6px 16px;
  border: 1px solid #ddd;
}

.dnxte-video-filter-layout-pills .dnxte-video-gallery-filter-item.active {
  border-color: #2ea3f2;
}

.dnxte-video-gallery-filter-item {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
  outline: none;
}

.dnxte-video-gallery-filter-item:hover,
.dnxte-video-gallery-filter-item.active {
  color: #2ea3f2;
}

.dnxte-video-gallery-filter-item.active {
  font-weight: 600;
}

/* Grid — layout is set dynamically by Divi style system */
.dnxte-video-gallery-grid {
  display: grid;
  gap: 20px;
}

/* Video Item */
.dnxte-video-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

a.dnxte-video-gallery-item:hover {
  text-decoration: none;
  color: inherit;
}

/* Hover: Zoom */
.dnxte-video-hover-zoom .dnxte-video-gallery-thumbnail img,
.dnxte-video-hover-zoom .dnxte-video-gallery-thumbnail > video {
  transition: transform 0.4s ease;
}

.dnxte-video-hover-zoom:hover .dnxte-video-gallery-thumbnail img,
.dnxte-video-hover-zoom:hover .dnxte-video-gallery-thumbnail > video {
  transform: scale(1.08);
}

/* Hover: Fade */
.dnxte-video-hover-fade .dnxte-video-gallery-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dnxte-video-hover-fade:hover .dnxte-video-gallery-overlay {
  opacity: 1;
}

/* Thumbnail */
.dnxte-video-gallery-thumbnail {
  position: relative;
  overflow: hidden;
  background: #000;
}

.dnxte-video-gallery-thumbnail img,
.dnxte-video-gallery-thumbnail > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Overlay */
.dnxte-video-gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease;
}

.dnxte-video-gallery-item:hover .dnxte-video-gallery-overlay {
  background: rgba(0, 0, 0, 0.5);
}

/* Play Icon */
.dnxte-video-gallery-play-icon {
  transition: transform 0.3s ease;
}

.dnxte-video-gallery-item:hover .dnxte-video-gallery-play-icon {
  transform: scale(1.1);
}

/* None: disable all hover effects */
.dnxte-video-hover-none:hover .dnxte-video-gallery-overlay {
  background: rgba(0, 0, 0, 0.3);
}

.dnxte-video-hover-none .dnxte-video-gallery-play-icon {
  transition: none;
}

.dnxte-video-hover-none:hover .dnxte-video-gallery-play-icon {
  transform: none;
}

/* Title on overlay */
.dnxte-video-gallery-title--overlay {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  margin-top: 12px;
  padding: 0 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Description on overlay */
.dnxte-video-gallery-description--overlay {
  color: #ddd;
  font-size: 12px;
  text-align: center;
  margin-top: 4px;
  padding: 0 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Caption below thumbnail */
.dnxte-video-gallery-caption {
  padding: 12px 0 0;
}

.dnxte-video-gallery-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.4;
}

.dnxte-video-gallery-description {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* Inline playing state */
.dnxte-video-playing .dnxte-video-gallery-overlay {
  display: none;
}

/* Lightbox styles */
/* Prevent module background from leaking into the lightbox wrap
   (mainClass adds the order class to .mfp-wrap, which matches the module bg rule) */
.mfp-wrap.dnxte-video-gallery-lightbox {
  background: transparent !important;
  background-color: transparent !important;
}

.dnxte-video-gallery-lightbox .mfp-content {
  max-width: 900px;
  width: 100%;
}

.dnxte-video-inline-wrapper {
  position: relative;
  width: 100%;
  line-height: 0;
}

.dnxte-video-inline-wrapper .mfp-iframe-scaler {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
  padding-top: 56.25%;
}

.dnxte-video-inline-wrapper .mfp-iframe-scaler iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

/* Close button — positioned outside the video */
.dnxte-video-gallery-lightbox .mfp-close {
  position: absolute;
  right: -44px;
  top: -44px;
  width: 44px;
  height: 44px;
  line-height: 44px;
  font-size: 28px;
  color: #fff;
  text-align: center;
  opacity: 0.85;
  padding: 0;
  cursor: pointer;
}

.dnxte-video-gallery-lightbox .mfp-close:hover {
  opacity: 1;
}

/* Navigation arrows */
.dnxte-video-gallery-lightbox .mfp-arrow {
  opacity: 0.85;
}

.dnxte-video-gallery-lightbox .mfp-arrow:hover {
  opacity: 1;
}

/* Responsive — bring close button back inside on small screens */
@media only screen and (max-width: 1024px) {
  .dnxte-video-gallery-lightbox .mfp-close {
    right: 0;
    top: -44px;
  }
}

@media only screen and (max-width: 767px) {
  .dnxte-video-gallery-lightbox .mfp-close {
    right: 0;
    top: -40px;
  }
}

.dnxte-video-gallery-lightbox .mfp-bottom-bar {
  margin-top: 8px;
}

.dnxte-video-gallery-lb-title {
  font-size: 18px;
  color: #fff;
  font-weight: 600;
  margin: 0 0 4px;
}

.dnxte-video-gallery-lb-desc {
  font-size: 14px;
  color: #ccc;
  margin: 0;
}

/* Duration badge */
.dnxte-video-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

/* Responsive */
@media only screen and (max-width: 767px) {
  .dnxte-video-gallery-filter-bar {
    gap: 4px;
  }

  .dnxte-video-gallery-filter-item {
    padding: 6px 12px;
    font-size: 13px;
  }
}
