/* ---------------------------------
   TF Social Mini-Film Lightbox Styles
--------------------------------- */

/* Global font lock */
.tf-social-edit,
.tf-social-edit *,
.tf-lightbox,
.tf-lightbox * {
  font-family: 'Poppins', sans-serif !important;
}

/* Force show lightbox */
.tf-lightbox.active {
  display: flex;
}

/* Container */
.tf-social-edit {
  max-width: 360px;
  margin: 5px auto;
  position: relative;
  z-index: 1;
}

/* Preview */
.tf-preview {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
}

.tf-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

/* Branding */
.tf-top-branding {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  z-index: 2;
  pointer-events: none;
}

.tf-logo-overlay {
  width: 52px;
  margin: 0;
  pointer-events: auto;
  border: none !important;
  box-shadow: none !important;
  background: none !important;
}

/* Reel Label */
.tf-reel-label {
  font-size: 20px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  line-height: 1.05;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 0;
  pointer-events: auto;
  margin-left: 5px;
  letter-spacing: -0.01em;
}

.tf-reel-label span,
.tf-reel-label br {
  margin: 0;
  padding: 0;
}

/* Subtitle */
.tf-subtitle {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 2px;
  line-height: 1.2;
  text-align: right;
  letter-spacing: 0;
}

/* Premium Play Icon */
.tf-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78px;
  height: 78px;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf-play-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -8px 16px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tf-play-ring::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.tf-play-core {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf-play-triangle {
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 19px solid rgba(255, 255, 255, 0.95);
  margin-left: 4px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

/* Gradient */
.tf-gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  z-index: 1;
}

/* Bottom Caption */
.tf-bottom-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 12px 20px 12px;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
}

.tf-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  border: 2px solid white;
}

.tf-meta {
  color: white;
  font-size: 13px;
  line-height: 1.3;
  flex: 1;
}

.tf-username {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 14px;
}

.tf-caption {
  font-weight: 400;
  opacity: 0.95;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Lightbox */
.tf-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

/* Wrapper */
.tf-video-wrapper {
  position: relative;
  width: min(90vw, 56.25vh);
  max-width: 540px;
  max-height: 90vh;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video */
.tf-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  pointer-events: none;
  appearance: none !important;
  -webkit-appearance: none !important;
  background: #000;
}

/* Lightbox caption area */
.tf-lightbox .tf-bottom-info {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  font-size: 15px;
  padding: 24px 16px 20px 16px;
  pointer-events: auto;
}

.tf-lightbox .tf-avatar {
  width: 42px;
  height: 42px;
  border: none !important;
  box-shadow: none !important;
  background: none !important;
}

.tf-lightbox .tf-username {
  font-size: 16px;
}

.tf-lightbox .tf-meta {
  font-size: 14px;
}

.tf-lightbox .tf-caption {
  font-size: 14px;
}

.tf-lightbox .tf-lightbox-story-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 0;
  color: #f4d0a1;
  font-size: 13px;
  font-weight: 600;
  line-height: inherit;
  text-decoration: none;
  pointer-events: auto;
  position: relative;
  z-index: 5;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.tf-lightbox .tf-lightbox-story-link:hover,
.tf-lightbox .tf-lightbox-story-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tf-lightbox .tf-lightbox-story-link span {
  display: inline-block;
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

.tf-lightbox .tf-lightbox-story-link:hover span,
.tf-lightbox .tf-lightbox-story-link:focus-visible span {
  transform: translate(2px, -1px);
}

/* Close Button */
.tf-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none !important;
  color: rgba(255, 255, 255, 0.75);
  border: none !important;
  font-size: 28px;
  padding: 0;
  cursor: pointer;
  z-index: 4;
  line-height: 1;
  transition: color 0.2s ease;
  outline: none !important;
  box-shadow: none !important;
  font-family: 'Poppins', sans-serif !important;
}

.tf-close-button:hover {
  color: rgba(255, 255, 255, 1);
}

.tf-close-button:focus,
.tf-close-button:focus-visible,
.tf-close-button:active {
  outline: none !important;
  box-shadow: none !important;
  background: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
  .tf-video-wrapper {
    width: min(85vw, 60vh);
    max-width: none;
    max-height: 90vh;
  }
}

@media (max-width: 768px) {
  .tf-video-wrapper {
    width: min(95vw, 70vh);
    max-width: none;
    max-height: 90vh;
  }

  .tf-lightbox .tf-lightbox-story-link {
    display: flex;
    width: fit-content;
    margin-left: 0;
    margin-top: 4px;
  }

  .tf-play-icon {
    width: 70px;
    height: 70px;
  }

  .tf-play-core {
    width: 50px;
    height: 50px;
  }

  .tf-play-triangle {
    border-top-width: 11px;
    border-bottom-width: 11px;
    border-left-width: 17px;
  }
}

/* Hide global site elements during lightbox */
body.tf-lightbox-open header,
body.tf-lightbox-open footer,
body.tf-lightbox-open .mfn-header-tmpl,
body.tf-lightbox-open .mfn-footer-tmpl,
body.tf-lightbox-open .elementor-element.elementor-element-bf36c5e,
body.tf-lightbox-open .wpsr-review-template,
body.tf-lightbox-open .wpsr-review-template-one,
body.tf-lightbox-open .wpsr-review-template-google,
body.tf-lightbox-open .btQuoteItemInput,
body.tf-lightbox-open .e-loop-item:not(:has(.tf-lightbox.active)),
body.tf-lightbox-open .elementor-swiper-button-prev,
body.tf-lightbox-open .elementor-swiper-button-next,
body.tf-lightbox-open .swiper-button-prev,
body.tf-lightbox-open .swiper-button-next,
body.tf-lightbox-open .swiper-pagination,
body.tf-lightbox-open .elementor-column.elementor-element-c92fa0d,
body.tf-lightbox-open .tf-preview {
  display: none !important;
}

/* Prevent Swiper clipping */
.swiper-slide {
  overflow: visible !important;
}

/* Hide iOS/native media overlays as much as possible */
video::-webkit-media-controls,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}
