/* ═══════════════════════════════════════════════════════════════
   CIMAMIX — Frontend Custom CSS
   ═══════════════════════════════════════════════════════════════ */

/* ── Nav spacer ─────────────────────────────────────────────── */
.nav-spacer { height: 56px; }

/* ── Header ─────────────────────────────────────────────────── */
#user-top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(11,11,20,0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background .3s;
}

/* ── Header inner container ─────────────────────────────────── */
.site-header-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Logo ───────────────────────────────────────────────────── */
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}
.site-logo-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#7c3aed,#a855f7);
  flex-shrink: 0;
  transition: transform .2s;
}
.site-logo:hover .site-logo-icon { transform: scale(1.08); }
.site-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}
.site-logo img { height: 28px; width: auto; }

/* ── Desktop nav ────────────────────────────────────────────── */
.site-nav {
  display: none; /* hidden on mobile */
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 0 8px;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .site-nav { display: flex; }
}

.site-nav-link {
  position: relative;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  color: #9ca3af;
  transition: color .15s, background .15s;
}
.site-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.site-nav-link.active {
  color: #fff;
  background: rgba(139,92,246,0.15);
}
.site-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 12px; right: 12px;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg,#7c3aed,#a855f7);
}

/* ── Header actions ─────────────────────────────────────────── */
.site-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: auto; /* push left in RTL */
  flex-shrink: 0;
}

/* ── Icon buttons ───────────────────────────────────────────── */
.site-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  transition: color .15s, background .15s;
  position: relative;
  flex-shrink: 0;
}
.site-icon-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

/* ── Notif badge ────────────────────────────────────────────── */
.site-notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #0b0b14;
}

/* ── User avatar button ─────────────────────────────────────── */
.site-avatar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-right: 4px;
  transition: background .15s;
}
.site-avatar-btn:hover { background: rgba(255,255,255,0.06); }
.site-avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg,#7c3aed,#a855f7);
  border: 2px solid rgba(139,92,246,0.30);
  flex-shrink: 0;
}
.site-avatar-btn img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(139,92,246,0.35);
}
.site-avatar-chevron {
  font-size: 9px;
  color: #6b7280;
  transition: color .15s;
  display: none;
}
@media (min-width: 640px) {
  .site-avatar-chevron { display: block; }
  .site-logo-text { display: block; }
}

/* ── Guest buttons ──────────────────────────────────────────── */
.site-btn-login {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px; font-weight: 500;
  color: #9ca3af;
  border-radius: 8px;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.site-btn-login:hover { color: #fff; background: rgba(255,255,255,0.06); }
@media (min-width: 640px) { .site-btn-login { display: flex; } }

.site-btn-register {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  background: linear-gradient(135deg,#7c3aed,#9333ea);
  transition: opacity .15s;
  white-space: nowrap;
}
.site-btn-register:hover { opacity: .88; }
.site-btn-register .btn-register-full { display: none; }
.site-btn-register .btn-register-short { display: inline; }
@media (min-width: 640px) {
  .site-btn-register .btn-register-full  { display: inline; }
  .site-btn-register .btn-register-short { display: none; }
}

/* ── Mobile hamburger ───────────────────────────────────────── */
.site-hamburger {
  display: flex;
  margin-right: 4px;
}
@media (min-width: 768px) { .site-hamburger { display: none; } }

/* ── Dropdown panels ────────────────────────────────────────── */
.site-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #111120;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  z-index: 200;
}
.site-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-dropdown-body { padding: 4px 0; }
.site-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  color: #d1d5db;
  text-decoration: none;
  transition: color .12s, background .12s;
}
.site-dropdown-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.site-dropdown-item.danger { color: #f87171; }
.site-dropdown-item.danger:hover { background: rgba(239,68,68,0.06); color: #fca5a5; }
.site-dropdown-item.admin { color: #c4b5fd; }
.site-dropdown-item.admin:hover { background: rgba(139,92,246,0.08); color: #ddd6fe; }
.site-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 12px;
}
.site-dropdown-icon {
  width: 16px;
  text-align: center;
  opacity: .65;
  color: #a78bfa;
  flex-shrink: 0;
}
.site-dropdown-icon.yellow { color: #fbbf24; }
.site-dropdown-icon.red { color: #f87171; opacity: 1; }
.site-dropdown-icon.purple { color: #c4b5fd; opacity: 1; }

/* Notif dropdown wider */
.site-dropdown-notif { min-width: 280px; max-height: 340px; overflow-y: auto; }
.site-dropdown-notif .site-dropdown-body { padding: 0; max-height: 260px; overflow-y: auto; }
@media (max-width: 767px) {
  .site-dropdown-notif { max-height: 220px; min-width: unset; }
  .site-dropdown-notif .site-dropdown-body { max-height: 160px; }
}
.site-notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
  transition: background .12s;
}
.site-notif-item:hover { background: rgba(255,255,255,0.04); }
.site-notif-item.unread { background: rgba(139,92,246,0.06); }
.site-notif-dot-sm {
  width: 6px; height: 6px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.site-notif-dot-sm.unread { background: #8b5cf6; }
.site-notif-dot-sm.read   { background: #374151; }
.site-notif-text { font-size: 13px; color: #e5e7eb; line-height: 1.4; }
.site-notif-time { font-size: 11px; color: #6b7280; margin-top: 3px; }
.site-notif-empty { padding: 24px 16px; text-align: center; color: #4b5563; font-size: 13px; }
@media (max-width: 767px) { .site-notif-empty { padding: 14px 12px; } }
.site-notif-empty i { font-size: 24px; display: block; margin-bottom: 8px; color: #1f2937; }

/* ── Search overlay ─────────────────────────────────────────── */
#nav-search-overlay {
  position: absolute;
  top: 100%; left: 0; right: 0;
  padding: 12px 16px;
  background: rgba(11,11,20,0.97);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  z-index: 99;
}
#nav-search-overlay.open { display: block; }
.site-search-form {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-search-wrap { position: relative; flex: 1; }
.site-search-wrap .fa-search {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: #6b7280; font-size: 13px;
}
.site-search-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 10px 40px 10px 14px;
  color: #fff; font-size: 14px;
  outline: none; transition: border-color .15s;
  box-sizing: border-box;
}
.site-search-input::placeholder { color: #6b7280; }
.site-search-input:focus { border-color: rgba(139,92,246,0.5); background: rgba(255,255,255,0.09); }
.site-search-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg,#7c3aed,#9333ea);
  color: #fff; font-size: 13px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  flex-shrink: 0; transition: opacity .15s;
}
.site-search-btn:hover { opacity: .88; }

/* ── Mobile menu ─────────────────────────────────────────────── */
#user-mobile-menu {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: rgba(11,11,20,0.98);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow-y: auto;
  max-height: 80vh;
  z-index: 98;
}
.site-mobile-nav { padding: 8px 12px; }
.site-mobile-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: #d1d5db; text-decoration: none;
  transition: color .12s, background .12s;
}
.site-mobile-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.site-mobile-link.active { color: #c4b5fd; background: rgba(139,92,246,0.12); }
.site-mobile-link i { width: 16px; text-align: center; color: #6b7280; flex-shrink: 0; }
.site-mobile-link.active i { color: #a78bfa; }
.site-mobile-search { padding: 0 12px 12px; display: flex; gap: 8px; }
.site-mobile-search input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff; font-size: 14px; outline: none;
}
.site-mobile-search input::placeholder { color: #6b7280; }
.site-mobile-search input:focus { border-color: rgba(139,92,246,0.4); }
.site-mobile-search button {
  padding: 10px 16px;
  background: linear-gradient(135deg,#7c3aed,#9333ea);
  color: #fff; font-size: 13px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  flex-shrink: 0;
}
.site-mobile-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 12px; }
.site-mobile-user { padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.site-mobile-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg,#7c3aed,#a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  border: 2px solid rgba(139,92,246,0.35);
  flex-shrink: 0;
}
.site-mobile-user-name { font-size: 14px; font-weight: 600; color: #fff; }
.site-mobile-user-email { font-size: 11px; color: #6b7280; }
.site-mobile-auth { padding: 8px 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.site-mobile-auth-login {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; font-size: 13px; font-weight: 500;
  color: #d1d5db; text-decoration: none; border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background .15s;
}
.site-mobile-auth-login:hover { background: rgba(255,255,255,0.10); }
.site-mobile-auth-register {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; font-size: 13px; font-weight: 600;
  color: #fff; text-decoration: none; border-radius: 10px;
  background: linear-gradient(135deg,#7c3aed,#9333ea);
  transition: opacity .15s;
}
.site-mobile-auth-register:hover { opacity: .88; }

/* ── Back to top ────────────────────────────────────────────── */
#back-to-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  transform: translateY(8px);
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   أحدث الاضافات — Episode Cards Fancy Effects
   ═══════════════════════════════════════════════════════════════ */

/* Stagger fade-up entrance */
@keyframes leCardIn {
  from { opacity:0; transform:translateY(22px) scale(.96); }
  to   { opacity:1; transform:translateY(0)    scale(1);   }
}

.le-card {
  opacity: 0;
  transform-style: preserve-3d;
  will-change: transform;
  border-radius: 12px;
  position: relative;
  flex-shrink: 0;
  scroll-snap-align: start;
  /* Mobile: 3 cards visible */
  width: calc((100vw - 2rem - 2 * 12px) / 3);
  min-width: 90px;
}
@media (min-width: 640px) {
  /* Tablet: 4 cards visible */
  .le-card { width: calc((100vw - 2rem - 3 * 12px) / 4); }
}
@media (min-width: 1024px) {
  /* Desktop: 6 cards visible — matches genre grid */
  .le-card { width: calc((min(1280px, 100vw) - 2rem - 5 * 12px) / 6); }
}
.le-card.le-visible {
  animation: leCardIn .45s cubic-bezier(.22,.68,0,1.2) forwards;
}

/* Glow border via box-shadow on the inner wrapper */
.le-card .le-inner {
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .35s ease, transform .18s ease;
  box-shadow: 0 4px 18px rgba(0,0,0,.55);
}
.le-card:hover .le-inner {
  box-shadow:
    0 0 0 1.5px rgba(220,38,38,.65),
    0 0 18px 4px  rgba(220,38,38,.28),
    0 8px 32px     rgba(0,0,0,.7);
}

/* Shimmer sweep on hover */
.le-card .le-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255,255,255,.10) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  background-position: 200% 0;
  transition: background-position .55s ease;
  pointer-events: none;
  border-radius: 12px;
  z-index: 10;
}
.le-card:hover .le-inner::after {
  background-position: -60% 0;
}

/* Play button pulse ring */
@keyframes lePulse {
  0%   { transform:scale(1);   opacity:.7; }
  70%  { transform:scale(1.8); opacity:0;  }
  100% { transform:scale(1.8); opacity:0;  }
}
.le-play-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(220,38,38,.8);
  animation: lePulse 1.4s ease-out infinite;
  pointer-events: none;
}
.le-play-btn {
  position: relative;
}

/* Lift the whole card */
.le-card:hover {
  z-index: 5;
}
