/* ============================================
   VideoSwipe Standalone - Feed Styles
   垂直滑动 Feed + SEO 优化
   ============================================ */

/* Hide site chrome on the immersive video archive / home feed */
body.is-video-archive .videoswipe-header,
body.is-video-archive .videoswipe-footer {
  display: none;
}

body.is-video-archive {
  overflow: hidden;
}

/* Feed Container */
.videoswipe-feed {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background-color: var(--dark-bg);
}

/* Swiper Container */
.videoswipe-swiper {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.videoswipe-swiper-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Swiper Slide */
.videoswipe-slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--dark-bg);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Video Container */
.videoswipe-video-container {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Video Player */
.videoswipe-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
}

/* Embedded Video */
.videoswipe-embed {
  width: 100%;
  height: 100%;
}

.videoswipe-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Video Overlay */
.videoswipe-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5), transparent);
  padding: 2rem 1.5rem 1.5rem;
  z-index: 10;
  pointer-events: none;
}

.videoswipe-overlay > * {
  pointer-events: auto;
}

/* Video Info */
.videoswipe-info {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

/* Creator Avatar */
.videoswipe-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid var(--dark-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.videoswipe-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 0, 80, 0.5);
}

.videoswipe-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video Details */
.videoswipe-details {
  flex: 1;
}

.videoswipe-creator-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.videoswipe-video-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  word-break: break-word;
}

.videoswipe-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.videoswipe-tag {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--secondary);
  border: 1px solid rgba(37, 244, 238, 0.3);
  transition: all var(--transition-fast);
}

.videoswipe-tag:hover {
  background-color: rgba(37, 244, 238, 0.1);
  border-color: var(--secondary);
}

/* Video Actions */
.videoswipe-actions {
  position: absolute;
  right: 1.5rem;
  bottom: 50%;
  transform: translateY(50%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 10;
}

.videoswipe-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all var(--transition-fast);
  padding: 0.5rem;
}

.videoswipe-action-btn:hover {
  transform: scale(1.2);
  color: var(--primary);
}

.videoswipe-action-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.videoswipe-action-btn.liked .videoswipe-action-count {
  color: var(--primary);
}

/* Navigation Controls */
.videoswipe-nav-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  z-index: 10;
}

.videoswipe-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1.2rem;
}

.videoswipe-nav-btn:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Progress Indicator */
.videoswipe-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--border-color);
  z-index: 5;
}

.videoswipe-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width var(--transition-base);
}

/* Video Counter */
.videoswipe-counter {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 10;
}

/* Loading State */
.videoswipe-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}

.videoswipe-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Transitions */
.videoswipe-slide {
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.videoswipe-slide.active {
  opacity: 1;
  transform: translateY(0);
}

.videoswipe-slide.prev {
  opacity: 0;
  transform: translateY(-100%);
}

.videoswipe-slide.next {
  opacity: 0;
  transform: translateY(100%);
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.videoswipe-overlay {
  animation: slideUp var(--transition-base);
}

/* Accessibility */
.videoswipe-action-btn:focus,
.videoswipe-nav-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* HD badge */
.videoswipe-hd-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 3px 8px;
  background: rgba(255, 0, 80, 0.95);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 3px;
  z-index: 10;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Actors / models */
.videoswipe-actors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.videoswipe-actor {
  font-size: 0.8rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.videoswipe-actor:hover {
  background: var(--primary);
  color: #fff;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .videoswipe-slide,
  .videoswipe-overlay,
  .videoswipe-action-btn,
  .videoswipe-nav-btn {
    transition: none;
    animation: none;
  }
}

/* Empty state */
.videoswipe-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: var(--text-secondary);
}

/* Comment modal */
.videoswipe-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.videoswipe-modal.active {
  display: flex;
}

.videoswipe-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.videoswipe-modal-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: var(--dark-secondary);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpModal 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

@media (min-width: 768px) {
  .videoswipe-modal {
    align-items: center;
  }
  .videoswipe-modal-content {
    border-radius: var(--radius-lg);
    max-height: 80vh;
  }
}

.videoswipe-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.videoswipe-modal-header h3 {
  margin: 0;
  font-family: var(--font-display, 'Syne', system-ui, sans-serif);
  font-size: var(--vt-h3, 17px);
  font-weight: var(--vw-bold, 700);
  letter-spacing: var(--vt-tracking-tight, -0.01em);
  color: var(--text-primary);
}

.videoswipe-modal-count {
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 0.4rem;
}

.videoswipe-modal-close {
  background: transparent;
  color: var(--text-primary);
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
}

.videoswipe-modal-close:hover {
  background: var(--dark-tertiary);
  transform: none;
  box-shadow: none;
}

.videoswipe-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.videoswipe-comments-empty,
.videoswipe-comments-loading {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-tertiary);
}

.videoswipe-comment {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.videoswipe-comment:last-child {
  border-bottom: none;
}

.videoswipe-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.videoswipe-comment-body {
  flex: 1;
  min-width: 0;
}

.videoswipe-comment-author {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.videoswipe-comment-date {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.videoswipe-comment-content {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.videoswipe-comment-form {
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--dark-secondary);
}

.videoswipe-guest-fields {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.videoswipe-guest-fields input {
  flex: 1;
  margin-bottom: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.videoswipe-comment-form textarea {
  margin-bottom: 0.5rem;
  min-height: 60px;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
}

.videoswipe-comment-form button[type="submit"] {
  width: 100%;
}

/* Notifications */
.videoswipe-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-tertiary);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  font-size: 0.85rem;
  animation: fadeInUp 200ms ease-out;
}

.videoswipe-notification-success { background: var(--success); }
.videoswipe-notification-error   { background: var(--error); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Like button pulse on activate */
.videoswipe-like-btn.liked .videoswipe-action-icon {
  animation: likePulse 350ms ease-out;
}

@keyframes likePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .videoswipe-actions {
    right: 1rem;
    gap: 1rem;
  }

  .videoswipe-action-btn {
    font-size: 1.25rem;
  }

  .videoswipe-overlay {
    padding: 1.5rem 1rem 1rem;
  }

  .videoswipe-info {
    gap: 0.75rem;
  }

  .videoswipe-avatar {
    width: 40px;
    height: 40px;
  }

  .videoswipe-creator-name {
    font-size: 0.85rem;
  }

  .videoswipe-video-title {
    font-size: 0.8rem;
  }

  .videoswipe-nav-controls {
    bottom: 1rem;
  }

  .videoswipe-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .videoswipe-counter {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .videoswipe-actions {
    right: 0.75rem;
    gap: 0.75rem;
  }

  .videoswipe-action-btn {
    font-size: 1rem;
  }

  .videoswipe-overlay {
    padding: 1rem 0.75rem 0.75rem;
  }

  .videoswipe-avatar {
    width: 35px;
    height: 35px;
  }

  .videoswipe-creator-name {
    font-size: 0.8rem;
  }

  .videoswipe-video-title {
    font-size: 0.75rem;
  }

  .videoswipe-tags {
    gap: 0.25rem;
  }

  .videoswipe-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }

  .videoswipe-nav-controls {
    gap: 0.5rem;
  }

  .videoswipe-nav-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .videoswipe-counter {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}
