/**
 * NextVideo — Base Styles
 *
 * @package DiviEssential
 * @since ??
 */

/* ── Container ───────────────────────────────────────────── */
.dnxte-next-video-container {
  position: relative;
  width: 100%;
}

/* ── Video Wrapper ───────────────────────────────────────── */
.dnxte-next-video__wrapper {
  position: relative;
  overflow: hidden;
  line-height: 0;
}

.dnxte-next-video__video {
  display: block;
  width: 100%;
  height: auto;
}

.dnxte-next-video__placeholder {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ── Embed (iframe) ──────────────────────────────────────── */
.dnxte-next-video__embed-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.dnxte-next-video__iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Overlay ─────────────────────────────────────────────── */
.dnxte-next-video__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.dnxte-next-video__overlay-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dnxte-next-video__overlay.dnxte-next-video__overlay--hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Play Button ─────────────────────────────────────────── */
.dnxte-next-video__play-btn {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: transparent;
  padding: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.dnxte-next-video__play-btn:hover {
  transform: scale(1.1);
}

/* Circle play icon */
.dnxte-play-btn--circle {
  width: 72px;
  height: 72px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  backdrop-filter: blur(4px);
}

.dnxte-play-icon--circle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dnxte-play-icon--circle svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  margin-left: 4px;
}

/* Rounded square play icon */
.dnxte-play-btn--rounded {
  width: 64px;
  height: 64px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.dnxte-play-icon--rounded svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
  margin-left: 3px;
}

/* Minimal play icon (no background) */
.dnxte-play-btn--minimal {
  background: none;
}

.dnxte-play-icon--minimal svg {
  width: 48px;
  height: 48px;
  fill: #ffffff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

/* Custom icon */
.dnxte-next-video__play-icon-custom {
  max-width: 72px;
  max-height: 72px;
  width: auto;
  height: auto;
}

/* ── Lightbox ────────────────────────────────────────────── */
.dnxte-next-video__lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  animation: dnxteVideoFadeIn 0.3s ease;
}

.dnxte-next-video__lightbox.dnxte-lightbox--active {
  display: flex;
}

@keyframes dnxteVideoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dnxte-next-video__lightbox-inner {
  width: 90%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  position: relative;
}

.dnxte-next-video__lightbox-inner video,
.dnxte-next-video__lightbox-inner iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.dnxte-next-video__lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  z-index: 5;
  transition: background 0.2s;
}

.dnxte-next-video__lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.dnxte-next-video__lightbox-trigger {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 2;
}

/* ── Sticky PiP ──────────────────────────────────────────── */
.dnxte-next-video__sticky {
  display: none;
  position: fixed;
  z-index: 99999;
  width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.dnxte-next-video__sticky.dnxte-sticky--active {
  display: block;
}

.dnxte-next-video__sticky video,
.dnxte-next-video__sticky iframe {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
}

/* Sticky positions */
.dnxte-sticky--bottom_right {
  bottom: 20px;
  right: 20px;
}

.dnxte-sticky--bottom_left {
  bottom: 20px;
  left: 20px;
}

.dnxte-sticky--top_right {
  top: 20px;
  right: 20px;
}

.dnxte-sticky--top_left {
  top: 20px;
  left: 20px;
}

.dnxte-next-video__sticky-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  z-index: 5;
  transition: background 0.2s;
}

.dnxte-next-video__sticky-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* ── Schema (hidden) ─────────────────────────────────────── */
.dnxte-next-video__schema {
  display: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .dnxte-next-video__sticky {
    width: 240px;
  }

  .dnxte-next-video__lightbox-inner {
    width: 95%;
  }

  .dnxte-play-btn--circle {
    width: 56px;
    height: 56px;
  }

  .dnxte-play-icon--circle svg {
    width: 22px;
    height: 22px;
  }
}
