/* =========================================================
   EL FAN+ – Home Page CSS
   Dark theme | Masonry Grid | Hover animations
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Cairo:wght@400;600;700;800&display=swap');

/* =========================================================
   HOVER AUTOPLAY PREVIEW
   ========================================================= */

.vcard-preview {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;     /* let clicks pass through to the <a> */
  border-radius: inherit;
  overflow: hidden;
  opacity: 0;
  transition: opacity .35s ease;
}

.vcard-preview.ready { opacity: 1; }

/* YouTube iframe */
.vcard-preview iframe {
  position: absolute;
  /* push iframe edges outward so the YT controls bar / title bar stay hidden */
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  border: none;
  pointer-events: none;
}

/* MP4 video */
.vcard-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Thin gradient at the bottom so card info is still readable */
.vcard-preview::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  pointer-events: none;
}

/* While preview is loading show a shimmer over the thumbnail */
.vcard-preview-loading {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: linear-gradient(90deg,
    rgba(255,255,255,0)   0%,
    rgba(255,255,255,.06) 50%,
    rgba(255,255,255,0)   100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

:root {
  --bg-primary:   #0a0a0f;
  --bg-secondary: #111118;
  --bg-card:      #16161f;
  --bg-card-hover:#1e1e2a;
  --border:       #252535;
  --text-primary: #f0f0f5;
  --text-secondary:#9898b0;
  --accent:       #2eaa95;
  --accent-2:     #a855f7;
  --accent-glow:  rgba(46,170,149,.35);
  --red:          #ef4444;
  --amber:        #f59e0b;
  --radius-card:  14px;
  --radius-badge: 6px;
  --transition:   .25s cubic-bezier(.4,0,.2,1);
  --font-en:      'Inter', sans-serif;
  --font-ar:      'Cairo', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-en);
  min-height: 100vh;
  overflow-x: hidden;
}

body[dir="rtl"] { font-family: var(--font-ar); }

a { text-decoration: none; color: inherit; }

img { display: block; max-width: 100%; }

/* ── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* =========================================================
   NAVBAR
   ========================================================= */
.fp-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.fp-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.fp-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

/* =========================================================
   BLINX NAV MENU
   ========================================================= */
.blinx-nav-wrap {
    display: none;
    justify-content: center;
    padding: 8px 0;
    flex: 1;
}
@media (min-width: 1024px) {
    .blinx-nav-wrap {
        display: flex;
    }
}
.blinx-nav-container {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 9999px;
    padding: 6px 8px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 24px rgba(0,0,0,0.35);
}
.blinx-nav-link {
    position: relative;
    display: flex;
    width: fit-content;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 9999px;
}
.blinx-nav-link-inner {
    position: relative;
    display: flex;
    height: 100%;
    width: 100%;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 8px 12px;
    white-space: nowrap;
    color: rgba(255,255,255,0.75);
    transition: transform 200ms ease-out, letter-spacing 200ms ease-out, color 200ms ease-out;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.blinx-nav-link:hover .blinx-nav-link-inner,
.blinx-nav-link.active .blinx-nav-link-inner {
    color: #ffffff;
    transform: scale(1.04);
    letter-spacing: -0.02em;
}

/* Hover glow effect (non-active items) */
.blinx-nav-glow {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    opacity: 0;
    transition: opacity 200ms;
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
    pointer-events: none;
}
.blinx-nav-link:hover .blinx-nav-glow {
    opacity: 1;
}

/* Active item effect */
.blinx-nav-active-bg {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
    opacity: 1;
}
.blinx-nav-active-glow1 {
    position: absolute;
    inset: -8px;
    border-radius: 9999px;
    filter: blur(20px);
    opacity: 0.38;
    pointer-events: none;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.blinx-nav-active-glow2 {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    opacity: 0.6;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.blinx-nav-mouse-track {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    pointer-events: none;
    background: radial-gradient(circle 100px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.35), transparent 60%);
}
.blinx-nav-text {
    position: relative;
    z-index: 10;
    transition: opacity 300ms;
    opacity: 1;
}


.fp-search-wrap {
  flex: 1;
  max-width: 250px;
  position: relative;
}

.fp-search {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 10px 20px 10px 44px;
  color: var(--text-primary);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.fp-search::placeholder { color: var(--text-secondary); }
.fp-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.fp-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  font-size: .85rem;
}

body[dir="rtl"] .fp-search { padding: 10px 44px 10px 20px; }
body[dir="rtl"] .fp-search-icon { left: auto; right: 16px; }

.fp-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

body[dir="rtl"] .fp-nav-actions { margin-left: 0; margin-right: auto; }

.fp-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 7px 14px;
  color: var(--text-secondary);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.fp-lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =========================================================
   HERO & AGENDA
   ========================================================= */
.hero-agenda-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 24px 50px;
}

@media (min-width: 992px) {
  .hero-agenda-wrapper {
    flex-direction: row;
  }
}

.hero-slider-wrap {
  flex: 2;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  min-height: 400px;
}

/* Fallback if no slides */
.fp-hero-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(46,170,149,.18) 0%, transparent 70%);
}

.fp-slider {
  position: absolute;
  inset: 0;
}

.fp-slider-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.fp-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none;
}
.fp-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.fp-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fp-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0.4) 50%, transparent 100%);
}

.fp-slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
  z-index: 2;
}

.fp-slide-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fp-slide-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.fp-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10,10,15,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}
.fp-slider-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.fp-slider-btn.prev { left: 20px; }
.fp-slider-btn.next { right: 20px; }

.fp-slider-dots {
  position: absolute;
  bottom: 20px;
  right: 40px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.fp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s;
}
.fp-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

body[dir="rtl"] .fp-slide-content { text-align: right; }
body[dir="rtl"] .fp-slider-dots { right: auto; left: 40px; }

/* Agenda */
.agenda-wrap {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.agenda-header {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.agenda-header i {
  color: var(--accent);
}

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
}

.agenda-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.agenda-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
}

.agenda-cal-icon {
  width: 50px;
  height: 56px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.agenda-cal-month {
  background: var(--accent);
  color: #fff;
  width: 100%;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 0;
}
.agenda-cal-day {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.agenda-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agenda-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: var(--text-primary);
}

.agenda-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.agenda-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agenda-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 0;
  font-style: italic;
}

.agenda-btn-more {
  display: inline-block;
  padding: 8px 24px;
  background: rgba(46, 170, 149, 0.1);
  color: var(--accent);
  border: 1px solid rgba(46, 170, 149, 0.3);
  border-radius: 99px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
}
.agenda-btn-more:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* =========================================================
   SECTION WRAPPER
   ========================================================= */
.fp-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.fp-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fp-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  border-radius: 4px;
  flex-shrink: 0;
}

/* =========================================================
   TOP CATEGORIES
   ========================================================= */
.cat-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.cat-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-radius: 50px;
  font-family: inherit;
  padding: 8px 18px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  background: var(--bg-card);
  border-color: var(--chip-color, var(--accent));
  color: var(--text-secondary);
}

.cat-chip:hover, .cat-chip.active {
  border-color: var(--chip-color, var(--accent));
  color: var(--chip-color, var(--accent));
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 12%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--chip-color, var(--accent)) 30%, transparent);
}

.cat-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, var(--accent));
  flex-shrink: 0;
}

/* =========================================================
   FILTER TABS
   ========================================================= */
.fp-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.fp-filter-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-family: inherit;
  padding: 7px 18px;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.fp-filter-btn:hover, .fp-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* =========================================================
   MASONRY GRID
   ========================================================= */
.vgrid {
  columns: 4 280px;
  column-gap: 16px;
}

@media (max-width: 1200px) { .vgrid { columns: 3 240px; } }
@media (max-width: 768px)  { .vgrid { columns: 2 180px; } }
@media (max-width: 480px)  { .vgrid { columns: 1; } }

/* =========================================================
   VIDEO CARD
   ========================================================= */
.vcard {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: block;
}

.vcard:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 0 1px var(--accent);
  border-color: var(--accent);
}

.vcard-link { display: block; }

/* Thumbnail wrapper */
.vcard-thumb-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9/16;
  background: #0d0d14;
}

.vcard-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}

.vcard:hover .vcard-thumb { transform: scale(1.06); }

/* Gradient overlay */
.vcard-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.1) 50%, transparent 100%);
  opacity: .7;
  transition: opacity var(--transition);
}

.vcard:hover .vcard-overlay { opacity: 1; }

/* Play button */
.vcard-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.vcard-play i {
  width: 52px;
  height: 52px;
  background: rgba(46,170,149,.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 0 28px var(--accent-glow);
  backdrop-filter: blur(4px);
}

.vcard:hover .vcard-play { opacity: 1; }

/* Duration badge */
.vcard-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(8px);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}

body[dir="rtl"] .vcard-duration { right: auto; left: 10px; }

/* Featured star */
.card-featured {
  position: absolute;
  top: 10px;
  left: 10px;
  color: var(--amber);
  font-size: .85rem;
  background: rgba(0,0,0,.65);
  padding: 3px 7px;
  border-radius: 5px;
}

body[dir="rtl"] .card-featured { left: auto; right: 10px; }

/* Short badge */
.card-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 5px;
  padding: 3px 8px;
  color: #fff;
  backdrop-filter: blur(8px);
}

body[dir="rtl"] .card-type-badge { right: auto; left: 10px; }

.card-type-badge.short { background: rgba(239,68,68,.85); }

/* Info section */
.vcard-info {
  padding: 12px 14px 14px;
}

.vcard-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  min-height: 2.8em; /* Force exactly 2 lines for symmetry */
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition);
}

.vcard:hover .vcard-title { color: var(--accent-2); }

.vcard-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.vcard-cat {
  font-size: .74rem;
  font-weight: 700;
  border-radius: var(--radius-badge);
  padding: 3px 9px;
  color: var(--cat-color, var(--accent));
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color, var(--accent)) 30%, transparent);
  letter-spacing: .3px;
  text-transform: uppercase;
}

.vcard-views {
  font-size: .73rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* =========================================================
   INFINITE SCROLL LOADER
   ========================================================= */
#load-sentinel {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fp-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.fp-end-msg {
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 500;
  padding: 20px;
  text-align: center;
}

/* =========================================================
   CARD ENTRANCE ANIMATION
   ========================================================= */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.vcard {
  animation: cardIn .4s var(--transition) both;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.fp-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.fp-empty i { font-size: 3rem; margin-bottom: 16px; opacity: .4; }

/* =========================================================
   FOOTER
   ========================================================= */
.fp-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 24px;
  color: var(--text-secondary);
  font-size: .82rem;
}

.fp-footer a { color: var(--accent-2); }

/* =========================================================
   RESPONSIVE MISC
   ========================================================= */
@media (max-width: 640px) {
  .fp-hero { padding: 50px 20px 60px; }
  .fp-hero h1 { font-size: 1.8rem; }
  .fp-nav-inner { padding: 0 16px; }
  .fp-section { padding: 0 16px 48px; }
}

/* =========================================================
   LIGHTBOX PLAYER  (Sprint 10)
   ========================================================= */

/* ── Backdrop ────────────────────────────────────────────── */
#lb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  padding: 20px;
}

#lb-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Shell ───────────────────────────────────────────────── */
#lb-shell {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 92vh;
  display: flex;
  flex-direction: row;
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #0e0e16;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 0 1px rgba(46,170,149,.2);
  transform: scale(.95) translateY(20px);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  opacity: 0;
}

#lb-backdrop.open #lb-shell {
  transform: none;
  opacity: 1;
}

/* ── Player side ─────────────────────────────────────────── */
#lb-player-side {
  flex: 1 1 60%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  position: relative;
}

#lb-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}

#lb-player-wrap.portrait { aspect-ratio: 9/16; max-height: 70vh; }

#lb-player-wrap iframe,
#lb-player-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Gradient hint at bottom of player */
#lb-player-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
  pointer-events: none;
}

/* Prev / Next arrow buttons */
.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  border: 1.5px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
  backdrop-filter: blur(8px);
}

.lb-nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.lb-nav-btn:disabled {
  opacity: .25;
  cursor: not-allowed;
  pointer-events: none;
}

#lb-prev { left: 14px; }
#lb-next { right: 14px; }

/* ── Info side ───────────────────────────────────────────── */
#lb-info-side {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 24px;
  gap: 20px;
  border-left: 1px solid rgba(255,255,255,.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

#lb-info-side::-webkit-scrollbar { width: 4px; }
#lb-info-side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Category badge */
#lb-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 6px;
  padding: 4px 10px;
  width: fit-content;
}

/* Title */
#lb-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Stats row */
#lb-stats {
  display: flex;
  gap: 20px;
  font-size: .8rem;
  color: var(--text-secondary);
}

#lb-stats span { display: flex; align-items: center; gap: 5px; }

/* Description */
#lb-description {
  font-size: .87rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
  flex: 1;
}

/* Action buttons row */
.lb-action-btn {
  flex: 1 1 calc(33% - 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}


.lb-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(46,170,149,.12);
}

.lb-action-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.lb-action-btn.liked {
  background: rgba(239,68,68,.15);
  border-color: var(--red);
  color: var(--red);
}

.lb-action-btn.icon-only {
  padding: 12px;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

#lb-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ── Close button ────────────────────────────────────────── */
#lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 100;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  border: 1.5px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}

#lb-close:hover {
  background: var(--red);
  border-color: var(--red);
  transform: rotate(90deg);
}

/* ── Loading skeleton inside lightbox ───────────────────── */
#lb-skeleton {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(135deg, #111118 0%, #1a1a28 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .3s;
}

#lb-skeleton .lb-spin {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── Share toast ─────────────────────────────────────────── */
#lb-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e1e2e;
  border: 1px solid var(--accent);
  color: var(--text-primary);
  font-size: .85rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 50px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all .3s ease;
  white-space: nowrap;
}

#lb-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive: mobile stacked ─────────────────────────── */
@media (max-width: 860px) {
  #lb-shell {
    flex-direction: column;
    max-height: 95vh;
    border-radius: 14px;
  }

  #lb-info-side {
    flex: 0 0 auto;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 18px 16px;
    max-height: 42vh;
  }

  #lb-title { font-size: 1rem; }

  .lb-nav-btn { width: 38px; height: 38px; font-size: .85rem; }

  /* Stack actions vertically on the left side of the player */
  #lb-actions {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 12px;
    border: none;
    padding: 0;
    z-index: 50;
  }

  /* Move prev/next down so they don't overlap with actions */
  #lb-prev, #lb-next {
    top: auto;
    bottom: 30px;
    transform: none;
  }
  #lb-prev { left: calc(50% - 60px); }
  #lb-next { right: calc(50% - 60px); }

  body[dir="rtl"] #lb-actions {
    left: auto;
    right: 12px;
  }

  .lb-action-btn.icon-only {
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    flex: 0 0 44px; /* Ensure flex sizing doesn't override */
  }

  .lb-action-btn.icon-only:hover {
    background: var(--accent);
  }
}

@media (max-width: 480px) {
  #lb-backdrop { padding: 10px; }
  
  #lb-actions {
    left: 8px; /* Slightly closer to edge on very small screens */
  }
  body[dir="rtl"] #lb-actions {
    left: auto;
    right: 8px;
  }
}

/* ── Search Highlight ── */
mark {
    background-color: rgba(46, 170, 149, 0.4);
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}


.fp-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); color: #fff; margin-right: 8px; text-decoration: none; border: none; cursor: pointer; transition: background 0.2s; }
.fp-icon-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* =========================================================
   MOBILE NAV MENU & SEARCH TOGGLE
   ========================================================= */

/* Hide search bar on mobile */
@media (max-width: 1023px) {
    .fp-search-wrap {
        display: none !important;
    }
}

/* Burger Button */
.fp-burger-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
}
body[dir="rtl"] .fp-burger-btn {
    margin-right: 0;
    margin-left: 12px;
}

@media (max-width: 1023px) {
    .fp-burger-btn {
        display: block;
    }
}

/* Mobile Menu Drawer */
.fp-mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 9999;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    transition: left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}
body[dir="rtl"] .fp-mobile-menu {
    left: auto;
    right: -100%;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    transition: right 0.3s ease-in-out;
}

.fp-mobile-menu.open {
    left: 0;
}
body[dir="rtl"] .fp-mobile-menu.open {
    right: 0;
}

.fp-mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.fp-mobile-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.fp-mobile-menu-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fp-mobile-link {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color 0.2s;
}

.fp-mobile-link:hover,
.fp-mobile-link.active {
    color: var(--accent);
}
