* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SPLASH SCREEN
   ============================================ */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #ff006e 0%, #8338ec 50%, #3a86ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: splashFadeOut 0.8s ease-out 2s forwards;
  overflow: hidden;
}

.splash-screen::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

@keyframes splashFadeOut {
  to {
    opacity: 0;
    pointer-events: none;
  }
}

.splash-content {
  text-align: center;
  animation: splashZoomIn 0.6s ease-out;
  position: relative;
  z-index: 1;
}

@keyframes splashZoomIn {
  from {
    transform: scale(0.5) rotate(-10deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.splash-logo {
  font-size: 100px;
  margin-bottom: 10px;
  animation: bounce 1s infinite ease-in-out, rotate 3s infinite linear;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

@keyframes rotate {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.splash-title {
  font-size: 52px;
  font-weight: 900;
  color: white;
  text-shadow:
    0 0 10px rgba(255, 0, 110, 0.8),
    0 0 20px rgba(255, 0, 110, 0.6),
    0 4px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(255, 0, 110, 0.8),
      0 0 20px rgba(255, 0, 110, 0.6),
      0 4px 30px rgba(0, 0, 0, 0.5);
  }
  50% {
    text-shadow:
      0 0 20px rgba(255, 0, 110, 1),
      0 0 40px rgba(255, 0, 110, 0.8),
      0 4px 40px rgba(0, 0, 0, 0.7);
  }
}

.splash-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 30px;
  letter-spacing: 3px;
  opacity: 0.9;
}

.loader {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

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

/* ============================================
   APP CONTAINER
   ============================================ */
#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  opacity: 0;
  animation: appFadeIn 0.8s ease-out 2.5s forwards;
}

.hidden {
  opacity: 0 !important;
}

@keyframes appFadeIn {
  to { opacity: 1; }
}

/* ============================================
   VIDEO FEED CONTAINER
   ============================================ */
.feed-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  background: #000;
  overflow: hidden;
}

.feed {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.feed.is-animating .feed-slide {
  transition: transform 0.32s cubic-bezier(0.25, 0.9, 0.3, 1.05);
}

.feed-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(0, 100%, 0);
  will-change: transform;
}

.feed-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  background: #000;
  pointer-events: auto;
}

.feed-slide[data-role="current"] {
  z-index: 3;
}

.feed-slide[data-role="previous"] {
  z-index: 2;
}

.feed-slide[data-role="next"] {
  z-index: 1;
}

/* ============================================
   GRADIENT OVERLAYS
   ============================================ */
.gradient-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
  z-index: 5;
  pointer-events: none;
}

.gradient-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
  z-index: 5;
  pointer-events: none;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff006e, #8338ec);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

/* ============================================
   VIDEO INFO
   ============================================ */
.video-info {
  position: absolute;
  bottom: 180px;
  left: 20px;
  max-width: calc(100% - 120px);
  z-index: 10;
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.video-author {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-author::before {
  content: "🎬";
  font-size: 18px;
}

.video-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   SIDEBAR CONTROLS
   ============================================ */
.sidebar-controls {
  position: absolute;
  right: 15px;
  bottom: 180px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
  animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.sidebar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px;
  color: white;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.sidebar-btn:active {
  transform: scale(0.95);
}

.sidebar-btn .icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

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

/* Like button animation */
.sidebar-btn.liked .icon {
  animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
}

/* ============================================
   SWIPE INDICATOR
   ============================================ */
.swipe-indicator {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  opacity: 0.7;
  animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateX(-50%) translateY(-10px);
    opacity: 1;
  }
}

.swipe-arrow {
  font-size: 32px;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.swipe-text {
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Hide swipe indicator after first interaction */
.swipe-indicator.hidden {
  animation: fadeOutDown 0.5s ease-out forwards;
}

@keyframes fadeOutDown {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* ============================================
   DOWNLOAD BUTTON
   ============================================ */
.download-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
  border: none;
  border-radius: 50px;
  padding: 14px 28px;
  cursor: pointer;
  z-index: 11;
  box-shadow: 
    0 8px 24px rgba(255, 0, 110, 0.4),
    0 4px 12px rgba(131, 56, 236, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInUp 0.6s ease-out 3s both;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

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

.download-btn:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.05);
  box-shadow: 
    0 12px 32px rgba(255, 0, 110, 0.5),
    0 6px 16px rgba(131, 56, 236, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.download-btn:active {
  transform: translateX(-50%) translateY(-1px) scale(0.98);
  box-shadow: 
    0 4px 16px rgba(255, 0, 110, 0.4),
    0 2px 8px rgba(131, 56, 236, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.download-icon {
  font-size: 20px;
  animation: downloadBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes downloadBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

.download-text {
  font-size: 15px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Pulse effect on download button */
.download-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50px;
  padding: 2px;
  background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

.unlock-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
}

.unlock-card {
  width: 100%;
  max-width: 320px;
  background: linear-gradient(145deg, rgba(131, 56, 236, 0.95), rgba(58, 134, 255, 0.95));
  border-radius: 24px;
  padding: 26px 24px;
  text-align: center;
  box-shadow:
    0 18px 45px rgba(58, 134, 255, 0.35),
    0 6px 16px rgba(0, 0, 0, 0.3);
}

.unlock-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.unlock-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  margin-bottom: 22px;
}

.unlock-button {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  background: #fff;
  color: #3a86ff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.unlock-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

.unlock-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

/* Desktop styles (default) */
@media (min-width: 769px) {
  #app {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
  }

  .feed-container {
    width: 450px;
    max-width: 450px;
    height: 100vh;
    max-height: 900px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    border-radius: 0;
  }

  .gradient-overlay-top,
  .gradient-overlay-bottom {
    width: 450px;
    left: 50%;
    transform: translateX(-50%);
  }

  .progress-bar {
    width: 450px;
    left: 50%;
    transform: translateX(-50%);
  }

  .video-info {
    left: calc(50% - 225px + 20px);
  }

  .sidebar-controls {
    right: calc(50% - 225px + 15px);
  }

  .swipe-indicator {
    display: none;
  }

  .download-btn {
    display: flex;
    bottom: 24px;
  }

  /* Show keyboard hint on desktop */
  body::after {
    content: '↑ Arrow Up for next video • Space to pause • M for sound • L to like';
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0.6;
    transition: opacity 0.3s;
  }

  body:hover::after {
    opacity: 0.9;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .splash-title {
    font-size: 32px;
  }

  .splash-logo {
    font-size: 60px;
  }

  .video-info {
    bottom: 160px;
    left: 15px;
    max-width: calc(100% - 100px);
  }

  .video-author {
    font-size: 15px;
  }

  .video-description {
    font-size: 13px;
    max-height: 50px;
  }

  .sidebar-controls {
    right: 12px;
    bottom: 160px;
    gap: 16px;
  }

  .sidebar-btn {
    width: 50px;
    height: 50px;
  }

  .sidebar-btn .icon {
    font-size: 22px;
  }

  .sidebar-btn .count {
    font-size: 10px;
  }

  .swipe-indicator {
    bottom: 80px;
  }
}

/* ============================================
   ANIMATIONS FOR INTERACTIONS
   ============================================ */
@keyframes ripple {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
  }
}

.ripple-effect {
  animation: ripple 0.6s ease-out;
}

/* ============================================
   TOUCH FEEDBACK
   ============================================ */
* {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
