/* ===== Short Video Page — TikTok Style ===== */

.sv-page {
  position: relative;
  width: 375px;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

/* ===== Top Nav ===== */
.sv-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 48px 14px 12px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 70%, transparent 100%);
  pointer-events: none;
}

.sv-tabs {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 28px;
  pointer-events: auto;
}

.sv-tab {
  position: relative;
  font-size: 16px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  cursor: pointer;
  padding-bottom: 6px;
  transition: color 0.25s, font-size 0.25s;
  white-space: nowrap;
}

.sv-tab.active {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}

.sv-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2.5px;
  background: #fff;
  border-radius: 10px;
}

.sv-search-btn {
  position: absolute;
  right: 14px;
  top: 48px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}
.sv-search-btn:active { opacity: 0.6; }

/* ===== Video Slide Container ===== */
.sv-track {
  width: 100%;
  height: 100%;
  position: relative;
  will-change: transform;
  touch-action: none;
}

.sv-track.animating {
  transition: transform 0.38s cubic-bezier(0.23, 1, 0.32, 1);
}

.sv-slide {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.sv-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Center Play Button */
.sv-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.3s;
  pointer-events: none;
}

.sv-slide.paused .sv-play-btn {
  opacity: 0.75;
  pointer-events: auto;
}

/* ===== Right Action Bar ===== */
.sv-actions {
  position: absolute;
  right: 10px;
  bottom: 180px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sv-avatar-wrap {
  position: relative;
  margin-bottom: 4px;
  cursor: pointer;
}

.sv-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  display: block;
}

.sv-avatar-follow {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: var(--pink, #FF4D94);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sv-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.12s;
}
.sv-action:active { transform: scale(0.8); }

.sv-action svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.sv-action span {
  font-size: 11px;
  color: #fff;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.sv-fullscreen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 2px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.sv-fullscreen-btn:active { opacity: 0.5; }

/* ===== Bottom Info Area ===== */
.sv-bottom-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 60px;
  z-index: 15;
  padding: 0 64px 0 14px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sv-author {
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.sv-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sv-tag {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Paywall Pill — below tags, inside bottom area flow */
.sv-paywall-pill {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.15s;
}
.sv-paywall-pill:active { transform: scale(0.95); }

.sv-paywall-pill.vip-pill {
  background: linear-gradient(135deg, #FF4D94, #FF7EB3);
  box-shadow: 0 2px 12px rgba(255,77,148,0.4);
}

.sv-paywall-pill.coins-pill {
  background: linear-gradient(135deg, #F4D562, #E6A817);
  color: #1a1a1a;
  box-shadow: 0 2px 12px rgba(244,213,98,0.4);
}

/* ===== Paywall Overlay ===== */
.sv-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.sv-overlay.show { display: flex; }

.sv-overlay-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.sv-overlay-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 24px;
  padding: 0 30px;
}

.sv-overlay-btns {
  display: flex;
  gap: 14px;
}

.sv-overlay-btn {
  min-width: 130px;
  height: 40px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: transform 0.15s;
}
.sv-overlay-btn:active { transform: scale(0.95); }

.sv-overlay-btn.btn-primary {
  background: linear-gradient(135deg, #FF4D94, #FF7EB3);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,77,148,0.35);
}

.sv-overlay-btn.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
}

/* ===== Bottom TabBar ===== */
.sv-tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 30;
}

.sv-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  transition: color 0.2s;
  position: relative;
}

.sv-tab-item svg { width: 22px; height: 22px; }

.sv-tab-item span {
  font-size: 10px;
  white-space: nowrap;
  font-weight: 500;
}

.sv-tab-item.tab-active {
  color: var(--pink, #FF4D94);
}

.sv-tab-item.tab-active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: linear-gradient(135deg, #FF4D94, #FF7EB3);
  border-radius: 2px;
}

.sv-tab-item:active { opacity: 0.7; }

/* ===== Slide transition ===== */
.sv-slide-enter-up {
  animation: slideInUp 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.sv-slide-enter-down {
  animation: slideInDown 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes slideInUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes slideInDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}


/* === Mobile Short Video Performance === */
@media (max-width: 768px) {
  .sv-page {
    contain: layout style paint;
    overflow: hidden;
  }
  .sv-track {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
  }
  .sv-slide {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    will-change: transform;
  }
  .sv-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(0);
  }
  .sv-cover {
    transform: translateZ(0);
  }
  .sv-right-bar {
    transform: translateZ(0);
    will-change: transform;
  }
  .sv-bottom {
    transform: translateZ(0);
  }
  /* Larger touch targets */
  .sv-action {
    min-width: 44px;
    min-height: 44px;
    padding: 6px;
  }
  .sv-progress {
    height: 8px;
    touch-action: none;
  }
}
