/**
 * nreels.css — أنماط مشغّل الريلز (v9 — البنية الجديدة)
 * ─────────────────────────────────────────────────────
 * يتوافق مع: reels-helpers-v9.php + reels9.js
 *
 * البنية:
 *   .reels-app (fixed viewport)
 *     .slides-wrapper (translateY navigation)
 *       .slide (100vw × 100vh, absolute positioned)
 *     #touch-overlay
 *     .top-bar
 *     .side-actions
 *     .nav-arrows
 *     .bottom-info
 *     .progress-area
 *     visual effects (pp-indicator, heart, skip-bubbles)
 */

/* ═══════════════════════════════════════════════════════
   RESET & VARIABLES
   ═══════════════════════════════════════════════════════ */
:root {
  --clr-bg: #08080a;
  --clr-surface: #121216;
  --clr-text: #f0eff4;
  --clr-text-dim: #87868f;
  --clr-text-muted: #5a5963;
  --clr-accent: #e63946;
  --clr-accent-soft: rgba(230, 57, 70, 0.25);
  --clr-accent-glow: rgba(230, 57, 70, 0.4);
  --clr-gold: #f4a261;
  --clr-green: #2ec4b6;
  --clr-progress-bg: rgba(255, 255, 255, 0.12);
  --clr-progress-buf: rgba(255, 255, 255, 0.28);
  --clr-progress-fill: var(--clr-accent);
  --clr-glass: rgba(255, 255, 255, 0.08);
  --clr-glass-hover: rgba(255, 255, 255, 0.16);
  --clr-glass-border: rgba(255, 255, 255, 0.06);
  --clr-overlay-top: rgba(0, 0, 0, 0.55);
  --clr-overlay-bottom: rgba(0, 0, 0, 0.7);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --font-main: 'Segoe UI', 'SF Pro Display', -apple-system, system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50%;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --z-slides: 1;
  --z-overlay: 5;
  --z-gradient: 6;
  --z-touch: 15;
  --z-ui: 20;
  --z-controls: 30;
  --z-effects: 50;
  --z-panels: 60;
  --z-modal: 70;
  --z-toast: 80;
}

/* ═══════════════════════════════════════════════════════
   REELS APP CONTAINER
   ═══════════════════════════════════════════════════════ */
.reels-app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-main);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

/* ═══════════════════════════════════════════════════════
   SLIDES WRAPPER & SLIDES
   ═══════════════════════════════════════════════════════ */
.slides-wrapper {
  position: absolute;
  inset: 0;
  transition: transform 0.45s var(--ease-smooth);
  will-change: transform;
  z-index: var(--z-slides);
}

.slides-wrapper.no-transition {
  transition: none !important;
}

/* الـ wrapper طبقة شفافة لتتبع التفاعل فقط — لا تؤثر على التخطيط */
.reel-slide-wrapper {
  display: contents;
}

.slide {
  position: absolute;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--clr-bg);
  /* top يُحدَّد inline عبر PHP: top: Nvh */
}

.slide-player-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-slides);
}

.slide-player-wrap iframe,
.slide-player-wrap .video-element {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Gradient overlays on slides */
.slide::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 130px;
  background: linear-gradient(to bottom, var(--clr-overlay-top), transparent);
  z-index: var(--z-gradient);
  pointer-events: none;
}

.slide::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 240px;
  background: linear-gradient(to top, var(--clr-overlay-bottom) 0%, transparent 100%);
  z-index: var(--z-gradient);
  pointer-events: none;
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
  pointer-events: none;
}

.loading-overlay .spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--clr-accent);
  border-radius: var(--radius-full);
  animation: reelsSpin 0.8s linear infinite;
}

@keyframes reelsSpin {
  to { transform: rotate(360deg); }
}

/* Error state */
.error-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: var(--z-overlay);
}

.error-content {
  text-align: center;
  color: var(--clr-text-dim);
}

.error-content i {
  font-size: 40px;
  color: var(--clr-accent);
  margin-bottom: 12px;
  display: block;
}

.error-content p {
  font-size: 15px;
  margin-bottom: 16px;
}

.retry-btn {
  background: var(--clr-glass);
  color: var(--clr-text);
  border: 1px solid var(--clr-glass-border);
  padding: 10px 24px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.retry-btn:hover {
  background: var(--clr-glass-hover);
}

/* Video placeholder */
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--clr-text-dim);
  text-align: center;
  gap: 10px;
}

.video-placeholder i {
  font-size: 48px;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════
   TOUCH OVERLAY
   ═══════════════════════════════════════════════════════ */
#touch-overlay {
  position: fixed;
  top: 58px;
  left: 56px;
  right: 56px;
  bottom: 95px;
  z-index: var(--z-touch);
}

/* ═══════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════ */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  padding: 0 12px;
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: var(--z-controls);
  direction: rtl;
  pointer-events: none;
}

.top-bar > * {
  pointer-events: auto;
}

.top-bar .brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--clr-text);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.top-bar .brand svg {
  width: 18px;
  height: 18px;
  fill: var(--clr-accent);
}

.top-bar-actions,
.top-bar-end {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--clr-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.top-btn:hover {
  background: var(--clr-glass-hover);
}

.top-btn:active {
  transform: scale(0.92);
}

.counter-badge {
  font-size: 11px;
  color: var(--clr-text-dim);
  background: var(--clr-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  direction: ltr;
  border: 1px solid var(--clr-glass-border);
}

/* ═══════════════════════════════════════════════════════
   SIDE ACTIONS
   ═══════════════════════════════════════════════════════ */
.side-actions {
  position: fixed;
  left: 10px;
  bottom: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: var(--z-controls);
}

.side-actions .action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--clr-text);
  cursor: pointer;
  transition: transform 0.2s ease;
  padding: 0;
  text-decoration: none;
}

.side-actions .action-btn:active {
  transform: scale(0.88);
}

.side-actions .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--clr-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--clr-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.25s ease;
}

.side-actions .action-btn:hover .icon-circle {
  background: var(--clr-glass-hover);
}

.side-actions .action-btn.liked .icon-circle {
  background: var(--clr-accent-soft);
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}

.side-actions .label {
  font-size: 9px;
  color: var(--clr-text-muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   NAV ARROWS
   ═══════════════════════════════════════════════════════ */
.nav-arrows {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: var(--z-controls);
}

.nav-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--clr-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: var(--clr-glass-hover);
}

.nav-btn:active {
  transform: scale(0.92);
}

.nav-btn:disabled {
  opacity: 0.2;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   BOTTOM INFO
   ═══════════════════════════════════════════════════════ */
.bottom-info {
  position: fixed;
  bottom: 98px;
  right: 14px;
  left: 68px;
  z-index: var(--z-ui);
  direction: rtl;
  pointer-events: none;
}

.bottom-info a,
.bottom-info button {
  pointer-events: auto;
}

.platform-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--clr-text-muted);
  margin-bottom: 4px;
}

.platform-indicator i {
  font-size: 13px;
}

.bottom-info .video-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--clr-text);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 5px;
}

.video-channel {
  margin-bottom: 5px;
}

.channel-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--clr-gold);
  font-size: 13px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.channel-link:hover {
  opacity: 0.85;
}

.channel-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--clr-glass-border);
}

.video-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-item {
  font-size: 11px;
  color: var(--clr-text-muted);
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--clr-text-dim);
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.2s ease;
}

.source-link:hover {
  color: var(--clr-text);
}

/* ═══════════════════════════════════════════════════════
   PROGRESS AREA
   ═══════════════════════════════════════════════════════ */
.progress-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  z-index: var(--z-controls);
  direction: ltr;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 12px calc(12px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
}

.progress-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skip-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--clr-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  color: var(--clr-text);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.skip-btn:hover {
  background: var(--clr-glass-hover);
}

.skip-btn:active {
  transform: scale(0.9);
}

/* Progress Bar */
.progress-bar-container {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.progress-track {
  width: 100%;
  height: 3px;
  background: var(--clr-progress-bg);
  border-radius: 3px;
  position: relative;
  overflow: visible;
  transition: height 0.15s ease;
}

.progress-bar-container:hover .progress-track,
.progress-bar-container.dragging .progress-track {
  height: 6px;
}

.progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--clr-progress-buf);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--clr-progress-fill);
  border-radius: 3px;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  background: var(--clr-accent);
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--clr-accent-glow);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.progress-bar-container:hover .progress-thumb,
.progress-bar-container.dragging .progress-thumb {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.15);
}

.progress-tooltip {
  position: absolute;
  bottom: 100%;
  margin-bottom: 10px;
  background: var(--clr-surface);
  color: var(--clr-text);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  border: 1px solid var(--clr-glass-border);
}

.progress-bar-container.dragging .progress-tooltip {
  opacity: 1;
}

.time-display {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--clr-text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 82px;
  text-align: center;
  direction: ltr;
}

/* ═══════════════════════════════════════════════════════
   VISUAL EFFECTS
   ═══════════════════════════════════════════════════════ */

/* Play/Pause Indicator */
.play-pause-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  opacity: 0;
  pointer-events: none;
  z-index: var(--z-effects);
}

.play-pause-indicator.show {
  animation: ppFlash 0.7s var(--ease-smooth) forwards;
}

@keyframes ppFlash {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  40%  { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
}

/* Heart Effect */
.heart-effect {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 76px;
  color: var(--clr-accent);
  pointer-events: none;
  z-index: var(--z-effects);
  filter: drop-shadow(0 0 20px var(--clr-accent-glow));
  line-height: 1;
}

.heart-effect.show {
  animation: heartBoom 0.85s var(--ease-spring) forwards;
}

@keyframes heartBoom {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(-15deg); }
  35%  { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(5deg); }
  55%  { transform: translate(-50%, -50%) scale(0.95) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35) rotate(0deg); }
}

/* Skip Bubbles */
.skip-bubble {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 18px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  z-index: var(--z-effects);
  opacity: 0;
  direction: ltr;
}

.skip-bubble.left  { left: 24px; }
.skip-bubble.right { right: 24px; }

.skip-bubble.show {
  animation: bubbleFlash 0.75s var(--ease-smooth) forwards;
}

@keyframes bubbleFlash {
  0%   { opacity: 0; transform: translateY(-50%) scale(0.7); }
  25%  { opacity: 1; transform: translateY(-50%) scale(1.04); }
  50%  { transform: translateY(-50%) scale(1); }
  100% { opacity: 0; transform: translateY(-50%) scale(1); }
}

/* Seek Feedback (horizontal swipe) */
.seek-feedback {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  z-index: var(--z-effects);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.seek-feedback.visible {
  opacity: 1;
}

#seek-feedback-left  { left: 24px; }
#seek-feedback-right { right: 24px; }

/* Swipe Hint */
.swipe-hint {
  position: fixed;
  bottom: 108px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: var(--z-effects);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.swipe-hint.visible {
  opacity: 1;
  animation: hintBounce 2s ease-in-out infinite;
}

.swipe-hint .arrow {
  font-size: 20px;
  color: var(--clr-text-dim);
}

.swipe-hint .text {
  font-size: 11px;
  color: var(--clr-text-muted);
}

@keyframes hintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-8px); }
}

/* View Mode Indicator */
.view-mode-indicator {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-lg);
  background: var(--clr-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--clr-glass-border);
  font-size: 10px;
  color: var(--clr-text-muted);
  pointer-events: none;
  opacity: 0;
  z-index: var(--z-ui);
  transition: opacity 0.3s ease;
}

.view-mode-indicator.visible {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════
   PANELS (Search, Filters, Menu) — Shared Styles
   ═══════════════════════════════════════════════════════ */
.search-panel,
.filters-panel,
.menu-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--clr-surface);
  z-index: var(--z-panels);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-smooth);
  border-left: 1px solid var(--clr-glass-border);
  direction: rtl;
}

.search-panel  { right: 0; }
.filters-panel { right: 0; }
.menu-panel    { right: 0; }

.search-panel.active,
.filters-panel.active,
.menu-panel.active {
  transform: translateX(0);
}

/* Panels backdrop */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-panels) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.panel-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Panel headers */
.search-header,
.filters-header,
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--clr-glass-border);
}

.search-header h2,
.filters-header h2,
.menu-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--clr-glass);
  border: none;
  color: var(--clr-text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filter panel specifics */
.filters-content,
.search-content,
.menu-content {
  padding: 16px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--clr-text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-option {
  padding: 7px 14px;
  border-radius: var(--radius-lg);
  background: var(--clr-glass);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-option:hover {
  background: var(--clr-glass-hover);
}

.filter-option.active {
  background: var(--clr-accent-soft);
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-apply-filters,
.btn-reset-filters {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-apply-filters {
  background: var(--clr-accent);
  color: white;
}

.btn-reset-filters {
  background: var(--clr-glass);
  color: var(--clr-text-dim);
  border: 1px solid var(--clr-glass-border);
}

/* Hashtag pills */
.hashtags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hashtag-pill {
  padding: 5px 12px;
  border-radius: var(--radius-lg);
  background: var(--clr-glass);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hashtag-pill:hover,
.hashtag-pill.active {
  background: var(--clr-accent-soft);
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}

/* Advanced filters */
.advanced-filters-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.filter-switch input[type="checkbox"] {
  accent-color: var(--clr-accent);
}

.filter-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-select-wrapper label {
  font-size: 12px;
  color: var(--clr-text-dim);
}

.filter-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--clr-glass);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text);
  font-size: 12px;
}

/* Search panel specifics */
.search-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--clr-glass);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text);
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: var(--clr-accent);
}

.search-submit-btn {
  width: 42px;
  border-radius: var(--radius-md);
  background: var(--clr-accent);
  border: none;
  color: white;
  font-size: 15px;
  cursor: pointer;
}

.quick-search-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.quick-search-btn {
  padding: 5px 14px;
  border-radius: var(--radius-lg);
  background: var(--clr-glass);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text-dim);
  font-size: 12px;
  cursor: pointer;
}

.search-results {
  margin-top: 16px;
}

.search-result-item {
  display: flex;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--clr-glass);
}

.result-thumbnail img {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
}

.result-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--clr-text);
  margin: 0 0 3px;
}

.result-channel {
  font-size: 11px;
  color: var(--clr-text-dim);
  margin: 0;
}

.search-welcome,
.search-no-results,
.search-loading {
  text-align: center;
  padding: 40px 16px;
  color: var(--clr-text-dim);
}

.search-welcome i,
.search-no-results i,
.search-loading i {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.4;
}

/* Menu panel */
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  background: none;
  border: none;
  width: 100%;
  text-align: right;
}

.menu-item:hover {
  background: var(--clr-glass);
}

.menu-item i {
  width: 20px;
  text-align: center;
  color: var(--clr-text-dim);
}

/* Provider filter search */
.filter-search-container {
  position: relative;
}

.filter-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--clr-glass);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text);
  font-size: 13px;
  outline: none;
  margin-bottom: 8px;
}

.custom-select-container {
  max-height: 200px;
  overflow-y: auto;
}

.custom-select__option {
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.custom-select__option:hover {
  background: var(--clr-glass);
}

.custom-select__option.selected {
  background: var(--clr-accent-soft);
  color: var(--clr-accent);
}

.custom-select__trigger {
  display: none;
}

.option-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

/* Share Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--clr-glass-border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--clr-glass-border);
  direction: rtl;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.share-modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--clr-glass);
  border: none;
  color: var(--clr-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 16px;
  direction: rtl;
}

.share-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
}

.share-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.share-icon:active { transform: scale(0.9); }
.share-icon.whatsapp { background: #25d366; }
.share-icon.facebook { background: #1877f2; }
.share-icon.twitter  { background: #1da1f2; }
.share-icon.telegram { background: #0088cc; }
.share-icon.email    { background: #666; }

.share-or-text {
  text-align: center;
  font-size: 12px;
  color: var(--clr-text-muted);
  margin: 12px 0 8px;
}

.share-link-container {
  display: flex;
  gap: 8px;
  direction: ltr;
}

.share-url-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--clr-glass);
  border: 1px solid var(--clr-glass-border);
  color: var(--clr-text);
  font-size: 12px;
  outline: none;
}

.btn-copy {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--clr-accent);
  border: none;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Video Info Panel */
.video-info-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 50vh;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-glass-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  z-index: var(--z-panels);
  transform: translateY(100%);
  transition: transform 0.35s var(--ease-smooth);
  overflow-y: auto;
  direction: rtl;
}

.video-info-panel.active {
  transform: translateY(0);
}

.video-info-content {
  padding: 20px 16px;
}

/* Loading indicator (global) */
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--clr-text-dim);
  font-size: 13px;
  z-index: var(--z-modal);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--clr-accent);
  border-radius: var(--radius-full);
  animation: reelsSpin 0.8s linear infinite;
}

/* Toast container */
.toast-container {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Accessibility: visually hidden */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (min-width: 600px) {
  .side-actions {
    left: 16px;
    bottom: 170px;
    gap: 20px;
  }

  .side-actions .icon-circle {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .nav-arrows {
    right: 16px;
    gap: 12px;
  }

  .nav-btn {
    width: 44px;
    height: 44px;
  }

  .bottom-info {
    right: 20px;
    left: 76px;
    bottom: 106px;
  }

  .bottom-info .video-title {
    font-size: 16px;
  }

  .progress-area {
    padding: 0 18px calc(14px + var(--safe-bottom));
  }

  #touch-overlay {
    left: 66px;
    right: 66px;
  }

  .top-bar {
    height: 60px;
    padding: 0 16px;
  }
}

@media (min-width: 900px) {
  .side-actions .icon-circle {
    width: 52px;
    height: 52px;
  }
}

/* Fullscreen */
:fullscreen .reels-app,
:-webkit-full-screen .reels-app {
  width: 100vw;
  height: 100vh;
}
