/* World-Class Modern UI/UX Sidebar CSS */

/* Global Styles */
* {
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  background-color: #000;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "clig", "calt", "frac";
  text-rendering: optimizeLegibility;
}

/* Hide scrollbar utility class */
.overflow-y-auto {
  overflow-y: auto;
}

/* Desktop - hide close button and keep sidebar visible */
@media (min-width: 1024px) {
  .close-sidebar, #close-sidebar {
    display: none !important;
  }
  
  #sidebar {
    transform: translateX(0) !important;
    position: relative !important;
    width: 280px !important;
  }
  
  #sidebar-backdrop {
    display: none !important;
  }
}

/* Mobile - responsive sidebar improvements */
@media (max-width: 1023px) {
  #sidebar {
    width: 85vw !important;
    max-width: 320px !important;
    min-width: 280px !important;
  }
  
  /* Half-menu overlay style */
  #sidebar-backdrop {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(8px) !important;
  }
  
  /* Enhanced close button visibility when open */
  #close-sidebar {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }
  
  #close-sidebar:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
  }
  
  /* Hide hamburger menu when sidebar is open */
  #sidebar-toggle.sidebar-open {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.8) !important;
  }
  
  /* Smoother animations on mobile */
  #sidebar {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  }
  
  #sidebar-backdrop {
    transition: opacity 0.4s ease-out !important;
  }
  
  #sidebar-toggle {
    transition: all 0.3s ease !important;
  }
}

/* TikTok Style Sidebar */
#sidebar {
  background: #000000;
  height: 100vh;
  overflow-y: scroll;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE and Edge */
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Completely hide scrollbar for all browsers */
#sidebar::-webkit-scrollbar {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
}

#sidebar::-webkit-scrollbar-track {
  display: none !important;
  width: 0px !important;
  background: transparent !important;
}

#sidebar::-webkit-scrollbar-thumb {
  display: none !important;
  width: 0px !important;
  background: transparent !important;
}

#sidebar::-webkit-scrollbar-corner {
  display: none !important;
  background: transparent !important;
}

/* Simple Animations */
#sidebar {
  transition: transform 0.3s ease-out;
}

#sidebar-backdrop {
  transition: opacity 0.3s ease-out;
}

/* TikTok Style Menu Button */
#sidebar-toggle {
  background: transparent;
  border: none;
  transition: all 0.2s ease;
}

#sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: none;
}

/* TikTok Style Navigation Links */
.nav-link {
  position: relative;
  transition: all 0.2s ease;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: white;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ff0050;
  transform: none;
  border: none;
  box-shadow: none;
}

.nav-link.active {
  background: transparent;
  color: #ff0050;
  border: none;
  transform: none;
  box-shadow: none;
}

/* TikTok Style Active Indicator */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 24px;
  background: transparent;
  border-radius: 0 2px 2px 0;
  transform: translateY(-50%);
  transition: all 0.2s ease;
}

.nav-link.active::after {
  background: #ff0050;
}

.nav-link:hover::after {
  background: transparent;
}

/* Ensure invisible scrollbar */
#sidebar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  background: transparent !important;
}

#sidebar::-webkit-scrollbar-track {
  display: none !important;
}

#sidebar::-webkit-scrollbar-thumb {
  display: none !important;
}

/* TikTok Style Button Animations */
button {
  transition: all 0.2s ease;
  font-weight: 600;
}

button:hover {
  transform: none;
  filter: none;
  box-shadow: none;
}

button:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Premium Button Enhancements */
.bg-white\\:hover:hover {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.bg-red-500:hover,
.bg-gradient-to-r:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.bg-gradient-to-br:hover {
  /* No box shadow */
}

/* Premium Icon Background Effects */
.group:hover .bg-gradient-to-br {
  transform: scale(1.15) rotate(3deg);
}

/* Premium Micro Interactions */
.group svg {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover svg {
  transform: scale(1.2) rotate(8deg);
}

/* Modern Glow Effects - Removed */
.text-red-500, .text-red-400 {
  /* No text shadow */
}

.bg-red-500, .bg-gradient-to-r {
  /* No box shadow */
}

.border-red-500\/30,
.border-green-500\/30 {
  /* No box shadow */
}

/* Gradient Text Effects */
.bg-clip-text {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Premium Card Effects */
.backdrop-blur-sm {
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
}

.backdrop-blur-2xl {
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
}

/* Premium Micro-interactions */
@keyframes premiumFadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes premiumSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px) scale(0.85);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes premiumGlow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
}

#sidebar > div > div {
  animation: premiumFadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link {
  animation: premiumSlideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Enhanced stagger animation delays */
.nav-link:nth-child(1) { animation-delay: 0.15s; }
.nav-link:nth-child(2) { animation-delay: 0.3s; }
.nav-link:nth-child(3) { animation-delay: 0.45s; }

/* Premium glow animation */
.nav-link.active {
  animation: premiumGlow 4s ease-in-out infinite;
}

/* Loading Splash Screen Animations */
@keyframes splash-fade-out {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
  }
}

@keyframes pulse-slow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes logo-entrance {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-180deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.1) rotate(-90deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes text-slide-up {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Splash screen classes */
.splash-fade-out {
  animation: splash-fade-out 0.8s ease-out forwards;
}

.animate-pulse-slow {
  animation: pulse-slow 2s ease-in-out infinite;
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

.logo-entrance {
  animation: logo-entrance 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.text-slide-up {
  animation: text-slide-up 0.8s ease-out forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

.dots-appear {
  animation: text-slide-up 0.6s ease-out forwards;
  animation-delay: 1s;
  opacity: 0;
}

.loading-text-appear {
  animation: text-slide-up 0.6s ease-out forwards;
  animation-delay: 1.2s;
  opacity: 0;
}

/* Simple Badge Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Simple Color Definitions */
.bg-black {
  background: #000000;
}

.bg-gray-700 {
  background: #374151;
}

.bg-gray-800 {
  background: #1f2937;
}

.bg-white {
  background: #ffffff;
}

/* Simple Icon Animation */
.group:hover svg {
  transform: none;
}

/* Simple Shadows - Removed */
.shadow-sm {
  box-shadow: none;
}

.shadow {
  box-shadow: none;
}

/* Enhanced Mobile Touch Optimizations */
@media (max-width: 768px) {
  #sidebar {
    width: 100vw;
    max-width: 100vw;
  }
  
  #sidebar-toggle {
    top: 1rem;
    left: 1rem;
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
  }
  
  .nav-link {
    font-size: 1rem;
    padding: 1rem 0.75rem;
    min-height: 48px;
  }
  
  /* Touch-friendly action buttons */
  .action-button button {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
  }
  
  /* Touch-friendly follow button */
  .follow-button {
    min-height: 48px;
    padding: 12px 16px;
  }
  
  
  /* Touch-friendly close button */
  #close-sidebar {
    min-width: 48px;
    min-height: 48px;
  }
}

@media (max-width: 640px) {
  #sidebar {
    width: 100vw;
  }
  
  .px-7 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .py-6 {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }
}

/* Modern Focus States */
button:focus,
.nav-link:focus {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
  box-shadow: 
    0 0 0 6px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(255, 255, 255, 0.2);
}

/* Premium Pulse Effects */
.animate-pulse {
  animation: premiumPulse 3s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes premiumPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 
      0 0 20px rgba(59, 130, 246, 0.4),
      0 0 40px rgba(147, 51, 234, 0.2),
      0 0 60px rgba(236, 72, 153, 0.1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.05);
    box-shadow: 
      0 0 30px rgba(59, 130, 246, 0.6),
      0 0 60px rgba(147, 51, 234, 0.4),
      0 0 90px rgba(236, 72, 153, 0.2);
  }
}

/* Enhanced modern border effects */
.border-white\/20:hover,
.border-white\/10:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 0 20px rgba(255, 255, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Modern status indicator effects */
.bg-red-500.animate-pulse,
.bg-green-400.animate-pulse {
  animation: modernStatusPulse 2s ease-in-out infinite;
}

@keyframes modernStatusPulse {
  0%, 100% {
    box-shadow: 
      0 0 12px rgba(239, 68, 68, 0.5),
      0 0 24px rgba(239, 68, 68, 0.2);
  }
  50% {
    box-shadow: 
      0 0 20px rgba(239, 68, 68, 0.8),
      0 0 40px rgba(239, 68, 68, 0.4);
  }
}

/* Modern gradient animations */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.bg-gradient-to-br,
.bg-gradient-to-r {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* Enhanced Typography */
.tracking-tight {
  letter-spacing: -0.025em;
}

.tracking-wider {
  letter-spacing: 0.05em;
}

/* Status Indicators */
.border-3 {
  border-width: 3px;
}

/* Simple Color Palette */
.text-white {
  color: #ffffff;
}

.text-gray-300 {
  color: #d1d5db;
}

.text-gray-400 {
  color: #9ca3af;
}

.text-gray-500 {
  color: #6b7280;
}

.text-black {
  color: #000000;
}

.text-green-400 {
  color: #34d399;
}

.border-gray-600 {
  border-color: #4b5563;
}

.border-gray-700 {
  border-color: #374151;
}

/* Video Feed - TikTok-like scrolling */
#video-feed {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overflow-y: scroll;
  height: 100vh;
  width: 100%;
  background-color: #000;
  scroll-padding-top: 0;
  overscroll-behavior: contain;
}

/* Hide scrollbar for Chrome, Safari and Opera */
#video-feed::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
#video-feed {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Video Item - TikTok-like snap behavior */
.video-item {
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video Element Styling */
.video-container video,
.video-player {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  background-color: black;
  z-index: 1;
  position: relative;
}

/* Ensure loading indicators don't block video */
.loading-indicator,
.error-indicator {
  pointer-events: none;
}

.loading-indicator.hidden,
.error-indicator.hidden {
  display: none !important;
}

/* Loading Progress Indicator */
.loading-progress {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 30;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shimmer 2s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Force video visibility */
video {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Video Download Protection */
video {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  pointer-events: auto;
}

video::-webkit-media-controls-download-button {
  display: none !important;
}

video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* Enhanced Mobile Video Player Controls */
.video-controls {
  cursor: pointer !important;
  background: transparent;
  z-index: 15;
  min-height: 48px;
  padding: 8px;
}

/* Larger tap area for video controls on mobile */
@media (max-width: 768px) {
  .video-controls {
    min-height: 60px;
    padding: 12px;
  }
  
  /* Make video clickable area larger on mobile */
  .video-container {
    touch-action: manipulation;
  }
  
  /* Prevent double-tap zoom on video */
  .video-container video {
    touch-action: manipulation;
  }
}


.action-button button {
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 25;
}

.follow-button {
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 25;
}

/* Play/Pause Button */
.play-pause-btn {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-container:active .play-pause-btn {
  opacity: 1;
}

/* Video Progress Bar */
.video-progress {
  height: 3px;
  background-color: rgba(255, 255, 255, 0.2);
}

.progress-bar {
  background-color: #fff;
  transition: width 0.1s linear;
}

/* Enhanced Action Buttons with Better Touch Feedback */
.action-button button {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-button button:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.action-button button:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

/* Enhanced Touch Ripple Effect */
.action-button button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.action-button button:active::before {
  width: 60px;
  height: 60px;
  opacity: 1;
}

/* Like Button States - Much Better Visual Feedback */
.like-button {
  position: relative;
  overflow: hidden;
}

.like-button.liked {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  transform: scale(1.05);
}

.like-button.liked svg {
  fill: #ef4444 !important;
  stroke: #ef4444 !important;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.like-button.liked::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, transparent 70%);
  animation: like-pulse 0.6s ease-out;
  pointer-events: none;
}

@keyframes like-pulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Like Animation on Click */
.like-button.animating {
  animation: like-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes like-bounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.3) rotate(-5deg); }
  50% { transform: scale(0.9) rotate(3deg); }
  75% { transform: scale(1.1) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Comment Button Enhanced */
.comment-button {
  color: #ffffff !important;
}

.comment-button:hover {
  color: #ff0050 !important;
  background: rgba(255, 0, 80, 0.15) !important;
  border-color: rgba(255, 0, 80, 0.3) !important;
}

.comment-button:active {
  background: rgba(255, 0, 80, 0.25) !important;
}

/* Share Button Enhanced */
.share-button:hover {
  color: #00ff88 !important;
  background: rgba(0, 255, 136, 0.15) !important;
  border-color: rgba(0, 255, 136, 0.3) !important;
}

/* Count Numbers Enhanced */
.like-count, .comment-count, .share-count {
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  margin-top: 4px;
  transition: all 0.3s ease;
}

.like-count.updated {
  animation: count-bounce 0.5s ease-out;
  color: #ef4444;
}

@keyframes count-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: #ef4444; }
  100% { transform: scale(1); }
}

/* Enhanced Double-tap Heart Animation */
@keyframes heartBurst {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -50%) scale(1.4) rotate(5deg);
    opacity: 1;
  }
  40% {
    transform: translate(-50%, -50%) scale(0.9) rotate(-2deg);
    opacity: 1;
  }
  60% {
    transform: translate(-50%, -50%) scale(1.1) rotate(1deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 0;
  }
}

/* Floating Hearts Animation */
@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: translateY(-20px) scale(1.2) rotate(5deg);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-40px) scale(0.8) rotate(-3deg);
    opacity: 0.6;
  }
  75% {
    transform: translateY(-60px) scale(1.1) rotate(2deg);
    opacity: 0.3;
  }
  100% {
    transform: translateY(-80px) scale(0.5) rotate(0deg);
    opacity: 0;
  }
}

.heart-animation {
  animation: heartBurst 0.6s ease-out forwards;
}

/* Spinning Music Disc */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

/* Hamburger Menu Button */
#sidebar-toggle {
  transition: transform 0.2s ease;
}

#sidebar-toggle:active {
  transform: scale(0.9);
}

/* Sidebar Navigation */
#sidebar {
  /* No shadow */
}

.nav-link {
  transition: all 0.2s ease;
}

.nav-link.active {
  background-color: rgba(246, 92, 92, 0.2);
  color: #fff;
  font-weight: 500;
}

.nav-link.active svg {
  color: rgb(246 92 92);
}

/* Backdrop for Sidebar */
#sidebar-backdrop {
  backdrop-filter: blur(2px);
}

/* Upload Button Pulse */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  70% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

#get-premium-button {
  animation: pulse 2s infinite;
}

/* Swipe Indicator */
.swipe-indicator {
  animation: fadeInOut 2s ease-in-out;
  pointer-events: none;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Follow Button */
.follow-button {
  transition: all 0.2s ease;
}

.follow-button:active, .follow-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.following-button {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Video Text Elements */
.video-title, .video-description {
  /* No text shadow */
}

/* Premium Badge */
.paid-indicator {
  /* No shadow */
}

/* Login Modal */
#login-modal {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Toast Animations */
#error-toast {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateY(5rem);
  opacity: 0;
  pointer-events: none;
}

#error-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Modern Video Loading Animations */
.video-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.video-loading-spinner {
  position: relative;
  width: 60px;
  height: 60px;
}

.loading-circle {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 3px solid transparent;
  border-top: 3px solid #ff0050;
  border-radius: 50%;
  animation: spin-smooth 1.2s linear infinite;
}

.loading-circle:nth-child(2) {
  width: 48px;
  height: 48px;
  top: 6px;
  left: 6px;
  border-top: 3px solid rgba(255, 255, 255, 0.3);
  animation: spin-smooth 1.8s linear infinite reverse;
}

.loading-circle:nth-child(3) {
  width: 36px;
  height: 36px;
  top: 12px;
  left: 12px;
  border-top: 3px solid rgba(255, 0, 80, 0.5);
  animation: spin-smooth 2.4s linear infinite;
}

@keyframes spin-smooth {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-top: 16px;
  opacity: 0.9;
  animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Simple dot loading for smaller areas */
.dot-flashing {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #fff;
  animation: dot-flashing 1s infinite linear alternate;
  animation-delay: 0.5s;
}

.dot-flashing::before, .dot-flashing::after {
  content: '';
  display: inline-block;
  position: absolute;
  top: 0;
}

.dot-flashing::before {
  left: -15px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #fff;
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 0s;
}

.dot-flashing::after {
  left: 15px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #fff;
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 1s;
}

@keyframes dot-flashing {
  0% { background-color: #fff; }
  50%, 100% { background-color: rgba(255, 255, 255, 0.2); }
}

/* Buffer loading indicator */
.buffer-loader {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top: 2px solid #ff0050;
  border-radius: 50%;
  animation: spin-smooth 1s linear infinite;
}

/* Minimal loading state for comments */
.comments-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.comments-loading .buffer-loader {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

/* Line Clamp Utility (for text truncation) */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  /* Better show the sidebar on larger screens */
  #sidebar {
    box-shadow: none;
    border-right: 1px solid rgba(75, 85, 99, 0.5);
  }
  
  /* Adjust hamburger menu position on larger screens */
  #sidebar-toggle {
    top: 1rem;
    left: 1rem;
  }
}



/* Fullscreen Video Styles */
video:fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
  background: black !important;
  z-index: 9999 !important;
}

video:-webkit-full-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
  background: black !important;
  z-index: 9999 !important;
}

video:-moz-full-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
  background: black !important;
  z-index: 9999 !important;
}

video:-ms-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
  background: black !important;
  z-index: 9999 !important;
}

/* Desktop Layout Adjustments */
@media (min-width: 1024px) {
  /* Main layout container */
  body {
    display: flex;
    overflow: hidden;
  }
  
  /* Permanently visible sidebar */
  #sidebar {
    position: relative;
    transform: none !important;
    width: 288px;
    flex-shrink: 0;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    height: 100vh;
  }
  
  /* Hide sidebar scrollbar on desktop */
  #sidebar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
  }
  
  #sidebar {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE and Edge */
  }
  
  /* Hide hamburger toggle on desktop */
  #sidebar-toggle {
    display: none;
  }
  
  /* Hide sidebar backdrop on desktop */
  #sidebar-backdrop {
    display: none !important;
  }
  
  /* Video feed container */ 
  #video-feed-container {
    flex: 1;
    height: 100vh;
    display: flex;
  }
  
  /* Video feed */
  #video-feed {
    flex: 1;
    max-width: calc(100vh * 9 / 16); /* 16:9 aspect ratio */
    margin: 0 auto;
  }
  
  /* Video item layout */
  .video-item {
    max-width: 100%;
    margin: 0 auto;
  }
  
  /* Video full height */
  .video-container video {
    height: 100vh;
    width: auto;
    max-width: none;
  }
  
  /* Simple Clean Playlist Sidebar */
  #playlist-sidebar {
    width: 320px;
    background-color: #000000;
    border-left: 1px solid #333333;
    display: flex;
    flex-direction: column;
  }
  
  /* Clean Header */
  .playlist-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid #333333;
  }
  
  .playlist-header h2 {
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin: 0 0 8px 0;
  }
  
  .playlist-header p {
    font-size: 14px;
    color: #666666;
    margin: 0;
  }
  
  /* Clean Video List */
  .playlist-videos {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    scrollbar-width: none;
  }
  
  .playlist-videos::-webkit-scrollbar {
    display: none;
  }
  
  /* Clean Video Item */
  .playlist-video-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
  }
  
  .playlist-video-item:hover {
    background-color: #111111;
  }
  
  .playlist-video-item.active {
    background-color: #1a1a1a;
  }
  
  .playlist-video-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #ff0050;
  }
  
  /* Portrait Thumbnail */
  .playlist-thumbnail {
    width: 60px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 16px;
    position: relative;
    flex-shrink: 0;
    background: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .playlist-thumbnail::before {
    content: '📹';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0.6;
    z-index: 1;
  }
  
  .playlist-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    background: transparent;
  }
  
  .playlist-thumbnail img[src=""], 
  .playlist-thumbnail img:not([src]),
  .playlist-thumbnail img[src="#"],
  .playlist-thumbnail img.error {
    opacity: 0;
  }
  
  /* Hide placeholder when image loads successfully */
  .playlist-thumbnail:has(img:not([src=""]):not(.error))::before {
    display: none;
  }
  
  /* Clean Duration Badge */
  .video-duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: #000000;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
  }
  
  .playlist-video-item.active .video-duration {
    background: #ff0050;
    color: white;
  }
  
  /* Clean Video Info */
  .playlist-video-info {
    flex: 1;
    min-width: 0;
  }
  
  .playlist-video-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 6px;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .playlist-video-author {
    display: none;
  }
  
  .playlist-video-stats {
    font-size: 12px;
    color: #666666;
  }
  
  /* Clean Empty State */
  .playlist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    padding: 40px;
    text-align: center;
  }
  
  .playlist-empty h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: white;
    font-weight: 600;
  }
  
  .playlist-empty p {
    font-size: 14px;
    color: #666666;
    margin: 0;
    line-height: 1.5;
  }
  
  /* Clean Progress Bar */
  .watch-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #333333;
  }
  
  .watch-progress-bar {
    height: 100%;
    background-color: #ff0050;
    width: 0%;
    transition: width 0.3s ease;
  }
}


/* iPhone X+ Safe Area */
@supports (padding: max(0px)) {
  #sidebar {
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
  
  #sidebar-toggle {
    top: max(1rem, env(safe-area-inset-top));
  }
  
  .video-progress {
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* Battery Saving Mode Optimizations */
.battery-saving-mode {
  /* Reduce animations to save power */
  * {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0.1s !important;
  }
  
  /* Disable expensive visual effects */
  .animate-pulse,
  .animate-spin,
  .animate-spin-slow {
    animation: none !important;
  }
  
  /* Simplify gradients */
  .bg-gradient-to-br,
  .bg-gradient-to-r {
    background: #1f2937 !important;
    animation: none !important;
  }
  
  /* Disable backdrop blur */
  .backdrop-blur-sm,
  .backdrop-blur-2xl {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  /* Reduce shadow complexity */
  .shadow-2xl,
  .shadow-lg {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  }
}

/* Network-aware optimizations */
.slow-connection .video-item video {
  /* Preload only metadata on slow connections */
  preload: metadata;
}

.slow-connection .loading-indicator {
  /* Show more prominent loading indicators on slow connections */
  opacity: 1 !important;
}

/* Comment animations */
@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  50% {
    opacity: 1;
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .animate-pulse,
  .animate-spin,
  .animate-spin-slow {
    animation: none !important;
  }
}