/* ClasiClip Video Ad Player Styles - Single Ad (home-v2 style)
   ============================================================
   Adjust these variables to change the player appearance:
*/
:root {
  --vad-width: 200px;
  --vad-height: 286px;
  --vad-radius: 16px;
  --vad-cta-color: #13368d;
}

/* Card container */
.co-vad-card {
  position: relative;
  width: var(--vad-width);
  min-width: var(--vad-width);
  height: var(--vad-height);
  overflow: hidden;
  border: 1px solid #e2e1e1;
  border-radius: var(--vad-radius);
  background: #101319;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  isolation: isolate;
  cursor: pointer;
}

/* Background video */
.co-vad-video {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Gradient scrim over video */
.co-vad-scrim {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 13, 0.28) 0%, rgba(5, 8, 13, 0.02) 42%, rgba(5, 8, 13, 0.86) 100%);
  pointer-events: none;
}

/* Tap-to-play/pause layer */
.co-vad-stage {
  position: absolute;
  z-index: 1;
  inset: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Top bar */
.co-vad-topbar {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* VIDEO pill */
.co-vad-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(7, 11, 16, 0.54);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.co-vad-pill i {
  font-size: 9px;
}

/* Icon-only pill (no "VIDEO" text) */
.co-vad-pill-icon {
  width: 28px;
  min-width: 28px;
  padding: 0;
  justify-content: center;
}

.co-vad-pill-icon i {
  font-size: 12px;
}

/* Right-side action rail (mute, menu) */
.co-vad-actions {
  position: absolute;
  z-index: 6;
  top: 10px;
  right: 9px;
  display: grid;
  gap: 8px;
}

.co-vad-control {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(18, 30, 47, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #202a38;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(11, 18, 29, 0.16);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
}

.co-vad-control:hover {
  background: #fff;
}

/* Bottom overlay: seller + title + cta + progress */
.co-vad-bottom {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 9px;
  left: 10px;
  display: grid;
  gap: 6px;
}

.co-vad-seller {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.co-vad-seller i {
  flex: 0 0 auto;
  font-size: 13px;
}

.co-vad-seller strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.co-vad-title {
  overflow: hidden;
  margin: 0;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Full-width action CTA */
.co-vad-cta {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--vad-cta-color);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.co-vad-cta:hover {
  background: #fff;
}

/* Progress bar */
.co-vad-progress {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.co-vad-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width 120ms linear;
}

/* Mobile: reduce card size so the video isn't too tall */
@media (max-width: 640px) {
  :root {
    --vad-width: 200px;
    --vad-height: 260px;
  }
}

/* ============================================================
   Expanded video modal (opens on tap, plays with sound)
   ============================================================ */
.co-vad-modal {
  position: fixed;
  z-index: 99999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.co-vad-modal-dialog {
  position: relative;
  width: auto;
  max-width: 480px;
  height: 86vh;
  max-height: 86vh;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.co-vad-modal-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
  cursor: pointer;
}

.co-vad-modal-close,
.co-vad-modal-sound {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
}

/* Both controls grouped top-right, pushed down below the browser bar.
   Base offset guarantees visibility even when safe-area inset is 0. */
.co-vad-modal-close {
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  right: 16px;
  font-size: 24px;
  font-weight: 800;
  background: #101319;
}

.co-vad-modal-sound {
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  right: 74px;
  font-size: 22px;
  background: #13368d;
}

.co-vad-modal-close:active,
.co-vad-modal-sound:active {
  transform: scale(0.94);
}

@media (max-width: 640px) {
  .co-vad-modal {
    padding: 0;
  }
  .co-vad-modal-dialog {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
  }
}

/* ============================================================
   Reels-style vertical feed (scroll-snap). Opens from a rail card and
   lets the viewer scroll through all rail videos.
   ============================================================ */
.co-vad-feed-modal {
  padding: 0;
  display: block;
}

.co-vad-feed {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.co-vad-feed::-webkit-scrollbar { display: none; } /* WebKit */

.co-vad-feed-slide {
  position: relative;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* On desktop, center a 9:16 video with dark letterbox around it. */
.co-vad-feed-slide video.co-vad-modal-video {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
}

@media (max-width: 640px) {
  .co-vad-feed-slide video.co-vad-modal-video {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
}

/* Bottom overlay inside each feed slide: caption + CTA */
.co-vad-feed-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 20px) 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}
@media (min-width: 641px) {
  /* Keep the overlay aligned with the centered 9:16 video on desktop. */
  .co-vad-feed-bottom {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(100%, calc(86vh * 9 / 16));
  }
}

/* Rail title icon (SVG logo replacing the old Font Awesome video icon) */
.rail-icon-img {
  height: 1.5em;
  width: auto;
  vertical-align: middle;
  display: inline-block;
}
