/* ============================================
   REELS FULLSCREEN VIEWER
   TikTok-style immersive experience
   ============================================ */

.reels-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: reelsViewerFadeIn 0.3s ease;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.reels-viewer-overlay.closing {
  opacity: 0;
  transform: scale(0.95);
}

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

/* Exit Button */
.reels-viewer-exit {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10002;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.reels-viewer-exit:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Progress Indicator */
.reels-viewer-progress {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: 'SF Mono', 'Monaco', monospace;
}

/* Video Mute Toggle Button */
.reels-video-mute-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10002;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.reels-video-mute-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Music Ticker Overlay */
.reels-music-ticker {
  position: absolute;
  bottom: 100px;
  left: 16px;
  right: 16px;
  z-index: 101;
  cursor: pointer;
  animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reels-music-ticker-content {
  background: linear-gradient(135deg, #0891b2 0%, #06d6a0 100%);
  border-radius: 20px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  transition: transform 0.2s, box-shadow 0.2s;
  max-width: 350px;
}

.reels-music-ticker:active .reels-music-ticker-content {
  transform: scale(0.95);
}

.reels-music-ticker-info {
  flex: 1;
  min-width: 0;
  color: #fff;
}

.reels-music-ticker-song {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reels-music-ticker-artist {
  font-size: 12px;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Video Container */
.reels-viewer-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 100vh;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.reels-viewer-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Play/Pause Overlay */
.reels-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.reels-play-overlay.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.reels-play-overlay svg {
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5));
}

/* Navigation Hints */
.reels-nav-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
}

.reels-viewer-container:hover .reels-nav-hint {
  opacity: 1;
}

.reels-nav-hint:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateX(-50%) scale(1.1);
}

.reels-nav-up {
  top: 20px;
}

.reels-nav-down {
  bottom: 20px;
}

/* Sidebar - Creator & Actions */
.reels-viewer-sidebar {
  position: absolute;
  right: 16px;
  bottom: 100px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Creator Info */
.reels-creator-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.reels-creator-info:hover {
  transform: scale(1.05);
}

.reels-creator-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.reels-creator-name {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verified-badge {
  margin-top: 2px;
  display: inline-block;
  width: 16px;
  height: 16px;
  background: #0891b2;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

/* Action Buttons */
.reels-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.reels-action-btn:hover {
  transform: scale(1.1);
}

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

.reels-action-btn svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.reels-action-btn.active svg {
  animation: heartBeat 0.3s ease;
}

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

.reels-action-count {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.reels-action-label {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Caption & Info (Bottom) */
.reels-viewer-caption {
  position: absolute;
  bottom: 20px;
  left: 16px;
  right: 100px;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reels-caption-text {
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  max-height: 80px;
  overflow-y: auto;
  padding-right: 8px;
}

.reels-caption-text::-webkit-scrollbar {
  width: 4px;
}

.reels-caption-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.reels-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reel-hashtag {
  font-size: 14px;
  font-weight: 600;
  color: #0891b2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.reels-audio-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  max-width: fit-content;
}

/* Empty State */
.reels-viewer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px;
  text-align: center;
}

.empty-icon-large {
  font-size: 80px;
}

.reels-viewer-empty h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.reels-viewer-empty p {
  margin: 0;
  font-size: 16px;
  color: #888;
}

.reels-cta-btn {
  padding: 14px 32px;
  border: none;
  background: linear-gradient(135deg, #0891b2 0%, #10b981 100%);
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}

.reels-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .reels-viewer-container {
    max-width: 100%;
  }

  .reels-viewer-sidebar {
    right: 12px;
    bottom: 80px;
    gap: 16px;
  }

  .reels-creator-avatar {
    width: 40px;
    height: 40px;
  }

  .reels-action-btn svg {
    width: 24px;
    height: 24px;
  }

  .reels-viewer-caption {
    left: 12px;
    right: 80px;
    bottom: 16px;
  }

  .reels-caption-text {
    font-size: 14px;
  }

  .reels-nav-hint {
    width: 44px;
    height: 44px;
  }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 600px) {
  .reels-viewer-sidebar {
    flex-direction: row;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    gap: 16px;
  }

  .reels-viewer-caption {
    max-width: 50%;
  }
}

/* Dark Mode Support (Already dark by default) */
@media (prefers-color-scheme: light) {
  /* Keep dark theme for fullscreen video experience */
}
