.reels-section {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Scrollable container */
.reels-container {
  position: relative;
  max-width: 420px;
  width: 100%;
  height: 80vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  border-radius: 20px;
  background: #000;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.reels-container::-webkit-scrollbar {
  display: none;
}

/* Mobile-specific horizontal scrolling */
@media (max-width: 768px) {
  .reels-container {
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    display: flex;
    flex-direction: row;
  }
}

/* Each reel block */
.reel-player {
  position: relative;
  width: 100%;
  height: 80vh;
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .reel-player {
    min-width: 100%;
    height: 100%;
  }
}

/* Video */
.reel-player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

/* Custom video controls */
.custom-controls {
  position: absolute;
  bottom: 80px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
  margin-bottom: -50px;
}

.reel-player:hover .custom-controls {
  opacity: 1;
}

.control-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
}

.control-btn.play-pause .fa-pause {
  display: none;
}

.control-btn.play-pause.paused .fa-play {
  display: none;
}

.control-btn.play-pause.paused .fa-pause {
  display: inline;
}

.control-btn.mute-btn .fa-volume-mute {
  display: none;
}

.control-btn.mute-btn.muted .fa-volume-up {
  display: none;
}

.control-btn.mute-btn.muted .fa-volume-mute {
  display: inline;
}

.progress-bar {
  flex-grow: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #ff004f;
  border-radius: 50%;
  cursor: pointer;
}

.progress-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #ff004f;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.time-display {
  color: #fff;
  font-size: 12px;
  min-width: 90px;
  text-align: center;
}

/* Bottom-left caption */
.reel-info {
  position: absolute;
  bottom: 90px;
  left: 20px;
  right: 120px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  z-index: 2;
}

/* Right floating actions */
.reel-actions {
  position: absolute;
  bottom: 100px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 2;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  transition: transform 0.2s ease, color 0.3s;
}

.action-btn span {
  font-size: 13px;
  margin-top: 4px;
}

/* Hover animation */
.action-btn:hover {
  transform: scale(1.2);
}

/* Heart active state */
.action-btn.liked {
  color: #ff004f;
  transform: scale(1.3);
}

/* Download button style */
.action-btn.download {
  background: #ff004f;
  padding: 10px;
  border-radius: 50%;
  font-size: 20px;
  position: relative;
  overflow: hidden;
}

.action-btn.download:hover {
  background: #e60045;
}

.action-btn.download.downloading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 4px solid #fff;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

.action-btn.download.downloading i {
  opacity: 0;
}

/* Navigation buttons */
.reel-nav {
  position: absolute;
  z-index: 10;
  background: transparent;
  color: #fff;
  border: none;
  padding: 15px;
  cursor: pointer;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.reel-nav i {
  font-size: 24px;
}


.prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

@media (min-width: 769px) {
  .prev {
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
  }

  .prev i:before {
    content: "\f077"; /* fa-chevron-up */
  }

  .next {
    left: 50%;
    bottom: 20px;
    top: auto;
    transform: translateX(-50%);
  }

  .next i:before {
    content: "\f078"; /* fa-chevron-down */
  }
}

@keyframes pulse {
  0% {
    transform: translateY(-50%) scale(1);
  }
  50% {
    transform: translateY(-50%) scale(1.1);
  }
  100% {
    transform: translateY(-50%) scale(1);
  }
}

@media (min-width: 769px) {
  @keyframes pulse {
    0% {
      transform: translateX(-50%) scale(1);
    }
    50% {
      transform: translateX(-50%) scale(1.1);
    }
    100% {
      transform: translateX(-50%) scale(1);
    }
  }
}

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

/* Loading indicator */
.reel-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  color: #fff;
}

.reel-loading::after {
  content: "";
  width: 30px;
  height: 30px;
  border: 4px solid #fff;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
}