/**
 * TikTok-Style Reels with Glassmorphism
 * DiaperGuys.com Brand Colors: #5d72e3, #764ba2, #08e3ec
 */

/* ============================================
   REELS WRAPPER - Fullscreen TikTok Style
   ============================================ */
.reels-tiktok-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #5d72e3 100%);
  background-attachment: fixed;
  z-index: 1;
  overflow: hidden;
}


.reels-tiktok-wrapper::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(93, 114, 227, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(8, 227, 236, 0.12) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

body.night-mode .reels-tiktok-wrapper {
  background: linear-gradient(135deg, #0b0f14 0%, #1a1f2e 50%, #262d34 100%);
}

body.night-mode .reels-tiktok-wrapper::before {
  background: 
    radial-gradient(circle at 20% 30%, rgba(8, 227, 236, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(93, 114, 227, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(118, 75, 162, 0.06) 0%, transparent 50%);
}

.reels-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.reels-wrapper::-webkit-scrollbar {
  display: none;
}

.reels-wrapper {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.reels-loader {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 20px 30px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.reels-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 20px;
}

/* ============================================
   REEL CONTAINER - TikTok Video Card
   ============================================ */
.reel-container {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
}

.reel-container.hidden {
  display: none;
}

/* ============================================
   VIDEO WRAPPER - Centered Video
   ============================================ */
.reel-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 70px 0 20px;
}

.reel-video-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 90px);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.1);
}

.reel-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

/* Video Player Controls - Hidden by default, show on hover */
.reel-video-container .plyr--video {
  height: 100%;
}

.reel-video-container .plyr__controls {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0 0 16px 16px;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}

.reel-video-container:hover .plyr__controls {
  opacity: 1;
}

/* ============================================
   TIKTOK-STYLE RIGHT SIDEBAR ACTIONS
   ============================================ */
.video-controlls {
  position: absolute;
  right: 20px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

@media (max-width: 768px) {
  .video-controlls {
    right: 15px;
    bottom: 80px;
    gap: 15px;
  }
}

.reel-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Profile Avatar - Glass Style */
.reel-actions .post-avatar {
  position: relative;
  margin-bottom: 0;
}

.reel-actions .post-avatar .post-avatar-picture {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(93, 114, 227, 0.4),
              inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
  cursor: pointer;
}

.reel-actions .post-avatar .post-avatar-picture:hover {
  transform: scale(1.1);
  border-color: rgba(93, 114, 227, 0.6);
  box-shadow: 0 6px 24px rgba(93, 114, 227, 0.6);
}

.reel-actions .post-avatar .online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #08e3ec;
  border: 2px solid rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(8, 227, 236, 0.6);
}

/* Action Buttons - Glass Style */
.reel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.reel-action-btn .action-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.reel-action-btn .action-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(93, 114, 227, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  border-color: rgba(93, 114, 227, 0.4);
  box-shadow: 0 6px 24px rgba(93, 114, 227, 0.4),
              inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

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

.reel-action-btn .action-btn .white-icon,
.reel-action-btn .action-btn i {
  color: #fff;
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.reel-action-btn .action-btn .reaction-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-action-btn .action-btn .reaction-btn-icon .inline-emoji {
  font-size: 24px;
}

.reel-action-btn span {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}

.reel-action-btn span:hover {
  color: #08e3ec;
  text-shadow: 0 0 10px rgba(8, 227, 236, 0.6);
}

/* Reactions Container - Glass Style */
.reactions-container {
  position: absolute;
  right: 80px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 8px 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reactions-wrapper:hover .reactions-container {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.reactions-container .reactions_item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 50%;
}

.reactions-container .reactions_item:hover {
  transform: scale(1.3);
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   VIDEO CAPTION - Bottom Left TikTok Style
   ============================================ */
.video-caption-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  pointer-events: none;
  z-index: 5;
}

.video-caption {
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 100px;
  padding: 20px;
  z-index: 6;
  color: #fff;
}

@media (max-width: 768px) {
  .video-caption {
    left: 15px;
    right: 80px;
    padding: 15px;
  }
}

.video-caption .post-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: all 0.2s;
}

.video-caption .post-author:hover {
  color: #08e3ec;
  text-shadow: 0 0 10px rgba(8, 227, 236, 0.6);
}

.video-caption .post-author .verified-badge {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #5d72e3 0%, #764ba2 100%);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(93, 114, 227, 0.5);
}

.video-caption .post-author .verified-badge i {
  color: #fff;
  font-size: 10px;
}

.video-caption .post-text {
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  max-height: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ============================================
   NAVIGATION BUTTONS - TikTok Style
   ============================================ */
.reel-prev-btn,
.reel-next-btn {
  position: absolute;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.reel-prev-btn {
  top: 100px;
}

.reel-next-btn {
  bottom: 20px;
}

.reel-prev-btn:hover,
.reel-next-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(93, 114, 227, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  border-color: rgba(93, 114, 227, 0.4);
  box-shadow: 0 6px 24px rgba(93, 114, 227, 0.4);
}

.reel-prev-btn i,
.reel-next-btn i {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@media (max-width: 768px) {
  .reel-prev-btn,
  .reel-next-btn {
    display: none;
  }
}

/* ============================================
   COMMENTS SIDEBAR - Glass Style
   ============================================ */
.reel-comments-wrapper {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
  z-index: 100;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.reel-container.comments-shown .reel-comments-wrapper {
  right: 0;
}

.reel-comments-wrapper .btn-close {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  opacity: 0.8;
  transition: all 0.2s;
}

.reel-comments-wrapper .btn-close:hover {
  opacity: 1;
  background: rgba(93, 114, 227, 0.2);
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .reel-comments-wrapper {
    max-width: 100%;
  }
}

/* ============================================
   NIGHT MODE ADJUSTMENTS
   ============================================ */
body.night-mode .reel-video-container {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.05);
}

body.night-mode .reel-action-btn .action-btn {
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.6) 0%, rgba(15, 20, 30, 0.4) 100%);
  border-color: rgba(255, 255, 255, 0.1);
}

body.night-mode .reel-comments-wrapper {
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.8) 0%, rgba(15, 20, 30, 0.6) 100%);
  border-left-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  .reel-video-wrapper {
    padding: 60px 0 10px;
  }
  
  .reel-video-container {
    height: calc(100vh - 70px);
    border-radius: 0;
  }
  
  .video-caption {
    font-size: 13px;
  }
  
  .reel-action-btn .action-btn {
    width: 48px;
    height: 48px;
  }
  
  .reel-action-btn .action-btn .white-icon,
  .reel-action-btn .action-btn i {
    font-size: 20px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reel-container {
  animation: fadeIn 0.4s ease-out;
}

/* ============================================
   SCROLL INDICATOR (Optional)
   ============================================ */
.reels-wrapper::after {
  content: '';
  position: fixed;
  top: 50%;
  right: 20px;
  width: 4px;
  height: 100px;
  background: linear-gradient(to bottom, 
    rgba(93, 114, 227, 0.6) 0%, 
    rgba(118, 75, 162, 0.6) 50%,
    transparent 100%);
  border-radius: 2px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 5;
}

@media (max-width: 768px) {
  .reels-wrapper::after {
    display: none;
  }
}
