/* ============================================
   Swipe Page — Chamet-level glassmorphism
   TikTok-style vertical snap scroll
   ============================================ */

/* ── 1. Container ── */
.swipe-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  background: #000;
}

/* ── 2. Feed ── */
.swipe-feed {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.swipe-feed::-webkit-scrollbar { display: none; }

/* ── 3. Item ── */
.swipe-item {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

/* ── 4. Video / Poster ── */
.swipe-item video,
.swipe-item .swipe-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}
.swipe-poster {
  z-index: 1;
}
.swipe-poster-fallback {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1;
  background: linear-gradient(135deg, #1a1025, #2d1f3d);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  line-height: 1.4;
}

/* ── 5. Verify overlay — blur applied directly to video via JS, not backdrop-filter ── */
.swipe-verify-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  box-sizing: border-box;
}
/* Blur applied inline via JS: video.style.filter = 'blur(20px)'; video.style.transform = 'scale(1.1)' */

.swipe-verify-play {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.swipe-verify-play:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.22);
}
.swipe-verify-play svg {
  width: 32px; height: 32px;
  fill: #fff;
  margin-left: 4px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.swipe-verify-text {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.swipe-verify-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ── 6. Right side action buttons ── */
.swipe-actions {
  position: absolute;
  right: 10px;
  bottom: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 20;
}

.swipe-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.swipe-author-name {
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-bottom: 4px;
  max-width: 60px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swipe-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.swipe-action-btn .icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.swipe-action-btn:hover .icon-circle {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
}
.swipe-action-btn:active .icon-circle {
  background: rgba(255, 107, 0, 0.3);
  border-color: rgba(255, 107, 0, 0.4);
}

.swipe-action-btn svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.swipe-action-btn .action-count {
  font-size: 11px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ── 7. Bottom video info ── */
.swipe-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 70px;
  padding: 40px 14px 24px;
  margin-bottom: 60px;
  z-index: 20;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
  pointer-events: none;
}

.swipe-info .swipe-title {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.4;
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.swipe-tags {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ── 7b. Preview countdown pill ── */
.swipe-countdown {
  position: absolute;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #ff6b35;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 107, 53, 0.3);
  pointer-events: none;
}

/* ── 7c. Like button active state ── */
.swipe-action-btn .icon-circle {
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

/* ── 7d. Comment & Share Panels — TikTok bottom sheet ── */
.comment-panel-overlay,
.share-panel-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.comment-panel-overlay.active,
.share-panel-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Comment panel — bottom sheet, 55vh */
.comment-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 201;
  height: 55vh;
  max-height: 55vh;
  border-radius: 16px 16px 0 0;
  background: rgba(20, 16, 31, 0.97);
  -webkit-backdrop-filter: blur(32px);
  backdrop-filter: blur(32px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 0;
}
.comment-panel-overlay.active .comment-panel {
  transform: translateY(0);
}

.comment-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.comment-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.comment-panel-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comment-panel-close svg {
  width: 14px; height: 14px;
  fill: rgba(255, 255, 255, 0.5);
}

/* Comments list — scrollable, hidden scrollbar */
.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0));
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.comments-list::-webkit-scrollbar { display: none; }

.comment-panel .comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.comment-panel .comment-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.comment-panel .comment-body {
  flex: 1;
  min-width: 0;
}
.comment-panel .comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.comment-panel .comment-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}
.comment-panel .comment-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
}
.comment-panel .comment-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 18px;
}
.comment-panel .comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
}

/* Comment input bar */
.comment-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.comment-input-field {
  flex: 1;
  height: 36px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 14px;
  font-size: 13px;
  color: #fff;
  outline: none;
  font-family: inherit;
}
.comment-input-field::placeholder { color: rgba(255, 255, 255, 0.3); }
.comment-send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.2);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: #ff6b35;
  cursor: pointer;
  flex-shrink: 0;
}

/* Share panel — bottom sheet */
.share-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 201;
  border-radius: 16px 16px 0 0;
  background: rgba(20, 16, 31, 0.97);
  -webkit-backdrop-filter: blur(32px);
  backdrop-filter: blur(32px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0));
}
.share-panel-overlay.active .share-panel {
  transform: translateY(0);
}
.share-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 16px;
}
.share-options {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}
.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  background: none;
}
.share-option-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.share-option-icon:active { transform: scale(0.9); }
.share-option-icon svg { width: 24px; height: 24px; fill: #fff; }
.share-option-icon.copy-link { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); }
.share-option-icon.whatsapp { background: #25D366; }
.share-option-icon.telegram { background: #0088cc; }
.share-option-icon.more { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); }
.share-option-label { font-size: 11px; color: rgba(255, 255, 255, 0.6); }
.share-panel-cancel {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

/* ── 8. Swipe guide animation ── */
.swipe-guide {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  animation: guideOut 0.5s ease 3s forwards;
}
.swipe-guide-hand {
  width: 40px; height: 40px;
  animation: swipeUp 1.2s ease-in-out infinite;
}
.swipe-guide-hand svg {
  width: 100%; height: 100%;
  fill: rgba(255, 255, 255, 0.7);
}
.swipe-guide-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

@keyframes swipeUp {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(-30px); opacity: 1; }
}
@keyframes guideOut {
  to { opacity: 0; visibility: hidden; }
}

/* ── 9. Top bar ── */
.swipe-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top, 0));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
}

.swipe-back-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.swipe-back-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.swipe-back-btn:active {
  background: rgba(255, 255, 255, 0.25);
}
.swipe-back-btn svg {
  width: 20px; height: 20px;
  fill: #fff;
}

.swipe-top-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ── Desktop: centered portrait mode (TikTok web style) ── */
.swipe-container {
  max-width: 430px;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  width: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.swipe-container .bottom-nav {
  max-width: 430px;
  left: 50%;
  transform: translateX(-50%);
}
/* Overlay covers the 430px column */
.comment-panel-overlay,
.share-panel-overlay {
  max-width: 430px;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
}
/* Panels: full width within overlay, slide from bottom */
.comment-panel,
.share-panel {
  max-width: 430px;
  width: 100%;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) translateY(100%);
}
.comment-panel-overlay.active .comment-panel,
.share-panel-overlay.active .share-panel {
  transform: translateX(-50%) translateY(0);
}

/* Black background behind the centered column */
html:has(.swipe-container) body {
  background: #000;
}
@media (max-width: 430px) {
  .swipe-container {
    max-width: 100%;
    border-left: none;
    border-right: none;
  }
}
