/* =============================================
   Kuaförim App - Video Feed Styles (TikTok)
   ============================================= */

/* Feed container - fullscreen snap scroll */
.feed-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.feed-scroll {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Feed tabs (For You / Takip) */
.feed-tabs {
  position: absolute;
  top: calc(var(--safe-top) + 8px);
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  z-index: var(--z-sticky);
  padding: var(--space-sm) 0;
}

.feed-tabs .feed-tab {
  font-size: var(--font-md);
  font-weight: var(--font-weight-bold);
  color: rgba(255,255,255,0.6);
  padding: var(--space-xs) var(--space-sm);
  position: relative;
  transition: color var(--transition-fast);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.feed-tabs .feed-tab.active {
  color: #fff;
}

.feed-tabs .feed-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
}

/* Single video item */
.video-item {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
}

/* Video element */
.video-item video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: 100%;
  object-fit: cover;
}

/* Video poster/thumbnail */
.video-item .video-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: opacity var(--transition-normal);
}

.video-item .video-poster.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Play/Pause overlay */
.video-item .play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 5;
  font-size: 60px;
  color: rgba(255,255,255,0.8);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.video-item .play-overlay.show {
  transform: translate(-50%, -50%) scale(1);
  animation: playPulse 0.5s ease forwards;
}

@keyframes playPulse {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Video gradient overlays */
.video-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.video-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 250px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

/* Video info (bottom left) */
.video-info {
  position: absolute;
  bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 16px);
  left: 0;
  width: calc(100% - 70px);
  padding: 0 var(--space-md);
  z-index: 10;
}

.video-info .user-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.video-info .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid #fff;
  object-fit: cover;
  flex-shrink: 0;
}

.video-info .user-name {
  font-size: var(--font-md);
  font-weight: var(--font-weight-bold);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.video-info .follow-btn {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 2px 10px;
  font-size: var(--font-xs);
  font-weight: var(--font-weight-bold);
  margin-left: var(--space-xs);
  transition: all var(--transition-fast);
}

.video-info .follow-btn.following {
  background: rgba(255,255,255,0.2);
}

.video-info .video-desc {
  font-size: var(--font-sm);
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-sm);
  cursor: pointer;
}

.video-info .video-desc.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.video-info .video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.video-info .video-tags .tag {
  font-size: var(--font-xs);
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Music ticker */
.video-info .music-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  overflow: hidden;
}

.video-info .music-bar i {
  font-size: 14px;
  flex-shrink: 0;
}

.video-info .music-bar .music-name {
  font-size: var(--font-xs);
  white-space: nowrap;
  animation: musicScroll 8s linear infinite;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

@keyframes musicScroll {
  0%, 10% { transform: translateX(0); }
  90%, 100% { transform: translateX(-50%); }
}

/* Action sidebar (right) */
.video-actions {
  position: absolute;
  right: var(--space-sm);
  bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  z-index: 10;
}

.video-actions .action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.video-actions .action-btn .action-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
  transition: transform var(--transition-fast);
}

.video-actions .action-btn:active .action-icon {
  transform: scale(1.3);
}

.video-actions .action-btn .action-count {
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  font-weight: var(--font-weight-medium);
}

.video-actions .action-btn.liked .action-icon {
  color: var(--danger);
}

/* Profile disc (spinning album) */
.video-actions .profile-disc {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-dark);
  overflow: hidden;
  animation: discSpin 3s linear infinite;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

.video-actions .profile-disc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes discSpin {
  to { transform: rotate(360deg); }
}

.video-actions .profile-disc.paused {
  animation-play-state: paused;
}

/* Video progress bar - seekable */
.video-progress {
  position: absolute;
  bottom: calc(var(--tabbar-height) + var(--safe-bottom));
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.15);
  z-index: 15;
  cursor: pointer;
  transition: height 0.15s ease;
}

.video-progress:hover,
.video-progress.seeking {
  height: 8px;
}

.video-progress .progress-bar {
  height: 100%;
  background: #fff;
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
  pointer-events: none;
}

.video-progress .progress-thumb {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  pointer-events: none;
  transition: transform 0.15s ease;
}

.video-progress:hover .progress-thumb,
.video-progress.seeking .progress-thumb {
  transform: translateY(-50%) scale(1);
}

/* Time display */
.video-time-display {
  position: absolute;
  bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 8px);
  left: var(--space-md);
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  z-index: 15;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* Mute button (top right) */
.mute-btn {
  position: absolute;
  top: calc(var(--safe-top) + 60px);
  right: var(--space-md);
  z-index: 12;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.mute-btn i {
  color: #fff;
  font-size: 14px;
}

.mute-btn:active {
  transform: scale(0.9);
  background: rgba(0,0,0,0.6);
}

/* Volume indicator (center) */
.volume-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 20;
  width: 60px;
  height: 60px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.volume-indicator i {
  color: #fff;
  font-size: 24px;
}

.volume-indicator.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: volumePop 0.8s ease forwards;
}

@keyframes volumePop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  20% { transform: translate(-50%, -50%) scale(1.1); }
  40% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Speed indicator */
.speed-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.speed-indicator.show {
  opacity: 1;
}

/* Verified badge */
.verified-badge {
  color: var(--primary) !important;
  font-size: 12px !important;
  margin-left: 4px;
}

/* Action button heartbeat animation */
@keyframes heartBeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1); }
  75% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.video-actions .action-icon.heart-beat {
  animation: heartBeat 0.6s ease;
}

/* Double tap like animation */
.double-tap-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) scale(0);
  font-size: 100px;
  color: var(--danger);
  z-index: 20;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.double-tap-heart.show {
  animation: doubleTapHeart 0.8s ease forwards;
}

@keyframes doubleTapHeart {
  0% { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  15% { transform: translate(-50%,-50%) scale(1.3); }
  30% { transform: translate(-50%,-50%) scale(1); }
  70% { opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}

/* Loading spinner */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  z-index: 3;
}

.video-loading .spinner-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}
