/* ============================================
   CRITICAL: Prevent body scroll on mobile
============================================ */
body.vivu-modal-open {
  position: fixed !important;
  overflow: hidden !important;
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: none !important;
}

/* ============================================
   Modal overlay - fullscreen
============================================ */
.vivu-tiktok-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 2147483647 !important;
  background: #000 !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

.vivu-app-container {
  position: relative !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
  background: #000 !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

/* ============================================
   Feed container - MUST allow vertical touch
============================================ */
.vivu-feed {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
  background: #000 !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important; /* CRITICAL: Allow vertical touch gestures */
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* ============================================
   Video item - fullscreen
============================================ */
.vivu-video-item {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
  background: #000 !important;
  touch-action: pan-y !important; /* CRITICAL: Allow vertical touch */
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* ============================================
   Video player - fullscreen cover
============================================ */
.vivu-video-player {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  background: #000 !important;
  border: none !important;
  pointer-events: none !important; /* Don't block touch events */
}

/* ============================================
   Overlay text
============================================ */
.vivu-overlay {
  position: absolute !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  padding: 14px 14px 24px !important;
  z-index: 900000 !important;
  color: #fff !important;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0)) !important;
  pointer-events: none !important;
}

.vivu-overlay h2,
.vivu-overlay h3 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #fff !important;
}

/* ============================================
   Close button
============================================ */
.vivu-close {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 12px) !important;
  right: 14px !important;
  z-index: 2147483647 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.20) !important;
  background: rgba(0,0,0,.45) !important;
  color: #fff !important;
  font-size: 26px !important;
  line-height: 40px !important;
  text-align: center !important;
  backdrop-filter: blur(12px) !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  transform: translate3d(0,0,0) !important;
  touch-action: manipulation !important; /* CRITICAL: Allow button tap */
}

/* ============================================
   Sound toggle
============================================ */
.vivu-sound-toggle {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 12px) !important;
  right: 64px !important;
  z-index: 2147483647 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.20) !important;
  background: rgba(0,0,0,.45) !important;
  backdrop-filter: blur(12px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  transform: translate3d(0,0,0) !important;
  touch-action: manipulation !important; /* CRITICAL: Allow button tap */
}

.vivu-sound-toggle svg {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
}

.vivu-sound-toggle.muted {
  color: #ff4d4f !important;
}

.vivu-sound-toggle.unmuted {
  color: #2ecc71 !important;
}

/* ============================================
   Action buttons
============================================ */
.vivu-actions {
  position: fixed !important;
  right: 14px !important;
  bottom: calc(env(safe-area-inset-bottom) + 90px) !important;
  z-index: 2147483647 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  pointer-events: auto !important;
  transform: translate3d(0,0,0) !important;
  touch-action: manipulation !important; /* CRITICAL: Allow button taps */
}

.vivu-action-btn {
  width: 48px !important;
  height: 48px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  background: rgba(0,0,0,.35) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer !important;
  touch-action: manipulation !important; /* CRITICAL: Allow button tap */
}

.vivu-action-btn svg {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  pointer-events: none !important;
}

.vivu-action-count {
  position: absolute !important;
  bottom: -8px !important;
  right: -6px !important;
  min-width: 20px !important;
  height: 18px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  line-height: 18px !important;
  background: rgba(255,255,255,.15) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: #fff !important;
  font-weight: 600 !important;
  pointer-events: none !important;
}

/* LIKE active */
.vivu-action-btn.like.is-on {
  color: #ff2d55 !important;
  border-color: rgba(255,45,85,.55) !important;
  box-shadow: 0 0 0 2px rgba(255,45,85,.12), 0 10px 30px rgba(255,45,85,.16) !important;
}

/* FAVORITE active */
.vivu-action-btn.fav.is-on {
  color: #f5c542 !important;
  border-color: rgba(245,197,66,.65) !important;
  box-shadow: 0 0 0 2px rgba(245,197,66,.12), 0 10px 35px rgba(245,197,66,.18) !important;
}

/* Shine animation */
.vivu-action-btn.fav.is-on::before {
  content: "" !important;
  position: absolute !important;
  inset: -20px !important;
  background: linear-gradient(120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.10) 35%,
    rgba(255,255,255,0.35) 50%,
    rgba(255,255,255,0.10) 65%,
    rgba(255,255,255,0) 100%) !important;
  transform: translateX(-120%) rotate(10deg) !important;
  animation: vivuShine 1.6s ease-in-out infinite !important;
  pointer-events: none !important;
}

@keyframes vivuShine {
  0%   { transform: translateX(-120%) rotate(10deg); opacity: 0; }
  15%  { opacity: 0.8; }
  50%  { opacity: 1; }
  85%  { opacity: 0.6; }
  100% { transform: translateX(120%) rotate(10deg); opacity: 0; }
}

/* ============================================
   Comment sheet
============================================ */
.vivu-comment-sheet {
  position: fixed !important;
  left: 12px !important;
  right: 12px !important;
  bottom: calc(env(safe-area-inset-bottom) + 12px) !important;
  z-index: 2147483647 !important;
  background: rgba(14,14,14,.92) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 16px !important;
  padding: 10px !important;
  backdrop-filter: blur(14px) !important;
  transform: translate3d(0,0,0) !important;
  touch-action: manipulation !important;
}

.vivu-comment-row {
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
}

.vivu-comment-input {
  flex: 1 !important;
  height: 40px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(0,0,0,.35) !important;
  color: #fff !important;
  padding: 0 12px !important;
  outline: none !important;
  font-size: 14px !important;
  touch-action: manipulation !important;
}

.vivu-comment-send {
  height: 40px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(46,204,113,.40) !important;
  background: rgba(46,204,113,.16) !important;
  color: #2ecc71 !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-size: 14px !important;
  touch-action: manipulation !important;
}

.vivu-comment-close {
  height: 40px !important;
  padding: 0 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  cursor: pointer !important;
  font-size: 14px !important;
  touch-action: manipulation !important;
}

/* ============================================
   FAB button
============================================ */
#vivu-fab-main {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  width: 56px !important;
  height: 56px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #007AFF 0%, #FF0050 100%) !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
  cursor: pointer !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-size: 24px !important;
  transition: transform 0.2s ease !important;
  touch-action: manipulation !important;
}

#vivu-fab-main:hover {
  transform: scale(1.1) !important;
}

#vivu-fab-main:active {
  transform: scale(0.95) !important;
}
/* ✅ CRITICAL FIXES - ADD THESE */
.vivu-video-player,
.vivu-video-player iframe {
  pointer-events: none !important;      /* Video doesn't block touches */
  touch-action: pan-y !important;       /* Allow swipe through video */
}

/* YouTube endscreen HIDE */
.vivu-video-player iframe {
  width: 100vw !important;
  height: 100vh !important;
}

/* Ensure buttons clickable */
.vivu-action-btn,
.vivu-close,
.vivu-sound-toggle,
#vivu-fab-main {
  pointer-events: auto !important;      /* Buttons override video */
  z-index: 9999 !important;            /* Above everything */
  touch-action: manipulation !important;
}

/* Swipe gesture area */
.vivu-feed::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: all;
  touch-action: pan-y;
}
