/* Meg Video Lightbox PRO — padrão premium Apple/Stripe-like */

.meg-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

.meg-modal.is-open {
  display: flex;
}

.meg-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.meg-modal__card {
  position: relative;
  width: min(420px, calc(100vw - 24px));
  max-height: min(780px, calc(100vh - 24px));
  aspect-ratio: 9 / 16;
  margin: 12px auto;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(16, 18, 24, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  cursor: default;
}

.meg-modal__close,
.meg-modal__skip {
  position: absolute;
  z-index: 10;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, opacity 0.2s;
}

.meg-modal__close {
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meg-modal__close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.meg-modal__skip {
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.meg-modal__skip:hover {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.meg-player {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  background: #000;
}

.meg-player__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* Watermark pill — cobre HeyGen */
.meg-watermark {
  position: absolute;
  right: 19px;
  bottom: 15px;
  z-index: 4;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.meg-watermark img {
  display: block;
  width: 156px;
  height: auto;
}

/* Play overlay — estado READY */
.meg-play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 6;
  border: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.18);
  transition: background 0.2s;
}

.meg-play:hover {
  background: rgba(0, 0, 0, 0.25);
}

.meg-play.is-hidden {
  display: none !important;
}

.meg-play__ring {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meg-play__icon {
  width: 0;
  height: 0;
  margin-left: 6px;
  border-style: solid;
  border-width: 16px 0 16px 28px;
  border-color: transparent transparent transparent #fff;
}

.meg-play__text {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 8px 14px;
  border-radius: 999px;
}

/* Controles */
.meg-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 7;
  display: grid;
  grid-template-columns: 44px 44px auto 1fr 44px 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.meg-btn {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.meg-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.meg-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

/* Ícones via CSS */
.meg-ic {
  display: block;
  width: 22px;
  height: 22px;
  position: relative;
}

.meg-ic--play::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent currentColor;
}

.meg-ic--pause::before,
.meg-ic--pause::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  background: currentColor;
  border-radius: 2px;
}

.meg-ic--pause::before { left: 4px; }
.meg-ic--pause::after { right: 4px; }

.meg-ic--rewind::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 12px 7px 0;
  border-color: transparent currentColor transparent transparent;
}

.meg-ic--rewind::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 12px 7px 0;
  border-color: transparent currentColor transparent transparent;
}

.meg-ic--volume::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 10px;
  background: currentColor;
  clip-path: polygon(0 50%, 100% 20%, 100% 80%);
}

.meg-ic--volume::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
}

.meg-ic--volume.meg-ic--muted::before {
  clip-path: polygon(0 0, 100% 100%, 0 100%, 100% 0);
  width: 10px;
  height: 10px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.meg-ic--volume.meg-ic--muted::after {
  display: none;
}

.meg-ic--fullscreen::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.meg-time {
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  opacity: 0.92;
  white-space: nowrap;
}

.meg-time__sep {
  opacity: 0.6;
  margin: 0 4px;
}

.meg-seek {
  width: 100%;
  min-width: 0;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.meg-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #78BE20;
  cursor: pointer;
  transition: transform 0.15s;
}

.meg-seek::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.meg-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #78BE20;
  cursor: pointer;
  border: none;
}

/* CTA final */
.meg-cta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 75px;
  z-index: 8;
  display: flex;
  justify-content: center;
}

.meg-cta__btn {
  width: 100%;
  max-width: 320px;
  border: 0;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  background: #78BE20;
  color: #fff;
  box-shadow: 0 4px 14px rgba(120, 190, 32, 0.35);
  transition: background 0.2s, transform 0.15s;
}

.meg-cta__btn:hover {
  background: #6aa91c;
  transform: translateY(-1px);
}

/* Mobile */
@media (max-width: 420px) {
  .meg-watermark img {
    width: 120px;
  }

  .meg-watermark {
    right: 12px;
    bottom: 12px;
    padding: 6px 8px;
  }

  .meg-controls {
    grid-template-columns: 42px 42px auto 1fr 42px 42px;
    gap: 6px;
    padding: 8px 10px;
  }

  .meg-btn {
    min-width: 42px;
    min-height: 42px;
    width: 42px;
    height: 42px;
  }

  .meg-play__ring {
    width: 80px;
    height: 80px;
  }

  .meg-play__icon {
    border-width: 14px 0 14px 24px;
    margin-left: 4px;
  }
}
