/* ============================================
   Sirr - Reels Styles
   Dark Theme | RTL | Mobile-First
   ============================================ */

/* ------------------------------------------
   Reels Container
   ------------------------------------------ */
.reels-container {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  background: #000;
}

/* Hide scrollbar */
.reels-container::-webkit-scrollbar {
  display: none;
}

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

/* ------------------------------------------
   Reel Item
   ------------------------------------------ */
.reel-item {
  width: 100%;
  height: calc(100vh - 110px);
  height: calc(100dvh - 110px);
  scroll-snap-align: start;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #000;
}

/* ------------------------------------------
   Reel Background
   ------------------------------------------ */
.reel-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.reel-bg img,
.reel-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gradient overlay for readability */
.reel-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0) 70%,
    rgba(0, 0, 0, 0.3) 100%
  );
  z-index: 1;
}

/* ------------------------------------------
   Progress Bar
   ------------------------------------------ */
.reel-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 10;
}

.reel-progress-bar {
  height: 100%;
  background: #fff;
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
  width: 0%;
}

/* ------------------------------------------
   Reel Actions (Left side for RTL)
   ------------------------------------------ */
.reel-actions {
  position: absolute;
  left: 14px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 5;
}

.reel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.reel-action-btn .icon {
  font-size: 28px;
  color: #fff;
  transition: transform 0.2s ease;
}

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

.reel-action-btn .count {
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.reel-action-btn.liked .icon {
  color: #e74c5e;
}

/* ------------------------------------------
   Reel Info (Right side for RTL)
   ------------------------------------------ */
.reel-info {
  position: absolute;
  bottom: 80px;
  right: 14px;
  left: 80px;
  z-index: 5;
}

/* User Row */
.reel-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.reel-user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  overflow: hidden;
}

.reel-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-user-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Follow Button */
.reel-follow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1.5px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 4px;
  transition: all 0.2s ease;
}

.reel-follow-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.reel-follow-btn.following {
  border-color: #555;
  color: #999;
}

/* Description */
.reel-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  word-wrap: break-word;
}

.reel-desc.expanded {
  -webkit-line-clamp: unset;
}

.reel-desc-more {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}

/* ------------------------------------------
   Reel Music
   ------------------------------------------ */
.reel-music {
  display: flex;
  align-items: center;
  gap: 8px;
}

.music-note {
  font-size: 14px;
  animation: spin-note 3s linear infinite;
}

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

.music-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* ------------------------------------------
   Reel Loading / Placeholder
   ------------------------------------------ */
.reel-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 3;
}

.reel-loading .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: reel-spin 0.7s linear infinite;
}

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