/* ==========================================================================
   Reels Component Stylesheet (Light & Dark Theme Compatible)
   ========================================================================== */

.reels-section {
  padding: 60px 0 70px;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.reels-card {
  background: var(--bg-card, #1f1f1f);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 20px);
  padding: 36px 32px 30px;
  box-shadow: 0 16px 40px var(--shadow-color, rgba(0, 0, 0, 0.35));
  position: relative;
  transition: background-color var(--transition-speed, 0.3s) ease, border-color var(--transition-speed, 0.3s) ease;
}

.reels-header {
  text-align: center;
  margin-bottom: 30px;
}

.reels-header .reels-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  background: var(--badge-bg, rgba(229, 195, 122, 0.12));
  color: var(--badge-text, #E5C37A);
  border: 1px solid var(--gold-border, rgba(229, 195, 122, 0.3));
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.reels-header .reels-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main, #ffffff);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.reels-header .reels-desc {
  font-size: 0.95rem;
  color: var(--text-muted, #a3a3a3);
  max-width: 620px;
  margin: 0 auto;
}

/* Swiper Container */
.reels-swiper-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 32px auto 0;
  padding: 10px 48px 24px;
}

.reels-swiper {
  overflow: hidden;
  position: relative;
  padding: 10px 4px;
}

.reels-swiper .swiper-wrapper {
  display: flex;
  align-items: center;
}

.reel-item {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
}

/* Reel Circle Thumbnail */
.reel-circle {
  width: 105px;
  height: 105px;
  border-radius: var(--radius-md, 14px);
  padding: 3px;
  background: var(--gold-gradient, linear-gradient(135deg, #F2D588 0%, #9C7333 100%));
  position: relative;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--shadow-color, rgba(0, 0, 0, 0.3)), 0 0 12px var(--gold-glow, rgba(229, 195, 122, 0.2));
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
}

.reel-circle:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 10px 24px var(--shadow-color, rgba(0, 0, 0, 0.4)), 0 0 18px var(--gold-glow, rgba(229, 195, 122, 0.35));
}

.reel-circle.viewed {
  background: var(--border-color, rgba(255, 255, 255, 0.2)) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  filter: grayscale(0.2);
}

.reel-circle img {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-md, 14px) - 3px);
  object-fit: cover;
  display: block;
  border: 2px solid var(--bg-card, #1f1f1f);
}

/* Play Button Overlay */
.reel-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(17, 17, 17, 0.75);
  border: 1px solid var(--gold-border, rgba(229, 195, 122, 0.5));
  color: var(--gold-text, #E5C37A);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.2s ease, background-color 0.2s ease;
  animation: playPulse 2s infinite;
}

.reel-circle:hover .reel-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--gold-gradient, linear-gradient(135deg, #F2D588 0%, #9C7333 100%));
  color: #111111;
  border-color: transparent;
}

.reel-title {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-heading, sans-serif);
  color: var(--text-main, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  transition: color 0.2s ease;
}

.reel-title:empty {
  display: none;
  margin-top: 0;
}

.reel-item:hover .reel-title {
  color: var(--gold-text, #E5C37A);
}

/* Swiper Arrows */
.reels-prev,
.reels-next {
  color: var(--text-main, #ffffff) !important;
  background: var(--bg-card, #1f1f1f);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 4px 14px var(--shadow-color, rgba(0, 0, 0, 0.3));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  transition: all 0.2s ease;
  position: absolute;
  top: 50%;
  margin-top: -20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.reels-prev::after,
.reels-next::after {
  font-size: 1rem !important;
  font-weight: bold;
}

.reels-prev:hover,
.reels-next:hover {
  background: var(--bg-card-hover, #262626);
  color: var(--gold-text, #E5C37A) !important;
  border-color: var(--gold-border, rgba(229, 195, 122, 0.5));
  transform: scale(1.08);
}

.reels-prev {
  left: -4px;
}

.reels-next {
  right: -4px;
}

.reels-prev.swiper-button-lock,
.reels-next.swiper-button-lock {
  display: none !important;
}

/* Pagination Bullets */
.reels-pagination {
  margin-top: 18px;
  position: relative !important;
  bottom: 0 !important;
  text-align: center;
}

.reels-pagination .swiper-pagination-bullet {
  background: var(--text-muted, #a3a3a3) !important;
  opacity: 0.35 !important;
  width: 8px !important;
  height: 8px !important;
  transition: all 0.25s ease;
}

.reels-pagination .swiper-pagination-bullet-active {
  background: var(--gold-text, #E5C37A) !important;
  opacity: 1 !important;
  width: 24px !important;
  border-radius: 4px !important;
}

/* ==========================================================================
   Reels Modal Video Player (Clean, Non-bootstrap Dependency Fallback)
   ========================================================================== */

.reels-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reels-modal.active,
.reels-modal.show {
  display: flex;
  opacity: 1;
}

.reels-modal-dialog {
  max-width: 400px;
  width: 90%;
  margin: 0 auto;
  position: relative;
}

.reels-modal-content {
  background: #0a0a0a;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px var(--gold-glow, rgba(229, 195, 122, 0.15));
  overflow: hidden;
  position: relative;
}

.reels-video-container {
  position: relative;
  aspect-ratio: 9/16;
  width: 100%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.reels-video-container video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000000;
  display: block;
}

/* Maintain aspect ratio in native fullscreen mode */
.reels-video-container video:fullscreen,
.reels-video-container video:-webkit-full-screen,
.reels-video-container video:-moz-full-screen,
.reels-video-container video:-ms-fullscreen {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000000 !important;
}

/* Progress bar inside Player */
.reels-progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  z-index: 25;
  overflow: hidden;
}

.reels-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gold-gradient, linear-gradient(90deg, #F2D588, #E5C37A));
  box-shadow: 0 0 6px rgba(229, 195, 122, 0.8);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* Modal Navigation Arrows */
.reels-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 20;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.reels-nav-btn:hover {
  background: rgba(38, 38, 38, 0.85);
  border-color: var(--gold-text, #E5C37A);
  color: var(--gold-text, #E5C37A);
  transform: translateY(-50%) scale(1.08);
}

.reels-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.reels-nav-prev {
  left: 12px;
}

.reels-nav-next {
  right: 12px;
}

/* Close Button in Modal */
.reels-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.reels-close-btn:hover {
  background: rgba(239, 68, 68, 0.85);
  color: #ffffff;
  transform: scale(1.08);
}

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

/* Pulse Animation */
@keyframes playPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(229, 195, 122, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(229, 195, 122, 0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .reels-section {
    padding: 40px 0 50px;
  }

  .reels-card {
    padding: 24px 16px 20px;
    border-radius: var(--radius-md, 14px);
  }

  .reels-header .reels-title {
    font-size: 1.45rem;
  }

  .reels-swiper-container {
    padding: 10px 0 16px;
    margin-top: 24px;
  }

  .reels-prev,
  .reels-next {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .reel-circle {
    width: 88px;
    height: 88px;
  }

  .reel-title {
    font-size: 0.78rem;
    max-width: 90px;
  }

  .reels-modal-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
  }

  .reels-modal-content {
    border-radius: 0;
    height: 100%;
    border: none;
  }

  .reels-video-container {
    height: 100%;
    aspect-ratio: auto;
  }
}
