/* ═══════════════════════════════════════════════════
   MADAAR MEDIA — Rich Visual Layer
   لایه بصری غنی — رسانه تصویری مدار مدیا
═══════════════════════════════════════════════════ */

/* ─── Dot Grid Pattern (Global) ──────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,195,0,0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}

/* ─── Noise Texture ──────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

/* ─── Header Glass ───────────────────────────────── */
#header.scrolled {
  background: color-mix(in srgb, var(--bg) 85%, transparent) !important;
  box-shadow: 0 1px 0 rgba(255,195,0,0.1), 0 8px 32px rgba(0,0,0,0.4);
}
.logo img {
  filter: brightness(1.3) drop-shadow(0 0 10px rgba(255,195,0,0.4));
  transition: all 0.4s;
}
.logo:hover img {
  filter: brightness(1.5) drop-shadow(0 0 20px rgba(255,195,0,0.6));
  transform: scale(1.05);
}
.nav-link.active {
  text-shadow: 0 0 24px rgba(255,195,0,0.5);
}
.search-box:focus-within {
  box-shadow: 0 0 0 2px rgba(255,195,0,0.15), 0 8px 24px rgba(0,0,0,0.3);
}
.icon-btn:hover {
  box-shadow: 0 0 16px rgba(255,195,0,0.15);
}

/* ─── HERO — Cinematic ───────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #080808 0%, #0d0800 40%, #080808 100%);
}
/* Film strip left */
.hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 48px;
  background: 
    repeating-linear-gradient(to bottom,
      transparent 0px, transparent 12px,
      rgba(255,195,0,0.08) 12px, rgba(255,195,0,0.08) 14px,
      transparent 14px, transparent 32px
    ),
    linear-gradient(to right, rgba(255,195,0,0.04), transparent);
  z-index: 2;
  pointer-events: none;
}
/* Animated glow orbs */
.hero::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  top: -200px; right: -100px;
  background: radial-gradient(circle, rgba(255,195,0,0.08) 0%, transparent 60%);
  animation: orbFloat 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}
@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, 40px) scale(1.2); }
}
.hero-content { animation: heroSlideIn 1s ease-out; position: relative; z-index: 3; }
@keyframes heroSlideIn {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-eyebrow {
  box-shadow: 0 0 24px rgba(255,195,0,0.2), inset 0 0 12px rgba(255,195,0,0.05);
  animation: eyebrowPulse 3s ease-in-out infinite alternate;
}
@keyframes eyebrowPulse {
  from { box-shadow: 0 0 20px rgba(255,195,0,0.15); }
  to { box-shadow: 0 0 36px rgba(255,195,0,0.3); }
}
.hero-title {
  text-shadow: 0 4px 60px rgba(0,0,0,0.6);
  background: linear-gradient(175deg, #ffffff 20%, #FFC300 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.hero .btn {
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(255,195,0,0.35), 0 0 60px rgba(255,195,0,0.08);
}
.hero .btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: rotate(45deg) translateX(-150%);
  transition: transform 0.7s;
}
.hero .btn:hover::after {
  transform: rotate(45deg) translateX(150%);
}

/* ─── Section Decorators ─────────────────────────── */
.section-sm, .section {
  position: relative;
}
.section-label {
  position: relative;
  padding-right: 20px;
}
.section-label::before {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  background: var(--gold);
  border-radius: 3px;
  box-shadow: 0 0 14px rgba(255,195,0,0.6), 0 0 28px rgba(255,195,0,0.2);
  animation: labelGlow 2s ease-in-out infinite alternate;
}
@keyframes labelGlow {
  from { box-shadow: 0 0 10px rgba(255,195,0,0.4); }
  to { box-shadow: 0 0 20px rgba(255,195,0,0.8); }
}
.section-head::after {
  content: '';
  position: absolute;
  bottom: -8px; right: 0;
  width: 100%; height: 1px;
  background: linear-gradient(to left, rgba(255,195,0,0.2), transparent 60%);
}
.section-title {
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* ─── Video Cards — Rich ─────────────────────────── */
.video-card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Gold line */
.video-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 3px; height: 0;
  background: linear-gradient(to bottom, var(--gold), rgba(255,195,0,0.3));
  transition: height 0.5s ease;
  z-index: 10;
  border-radius: 0 0 0 3px;
}
.video-card:hover::before { height: 100%; }
/* Glow border */
.video-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,195,0,0.15), transparent 40%, transparent 60%, rgba(255,195,0,0.1));
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 0;
  pointer-events: none;
}
.video-card:hover::after { opacity: 1; }
.video-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 
    0 20px 50px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,195,0,0.12),
    0 0 80px rgba(255,195,0,0.04);
}
/* Thumb overlay gradient */
.video-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  pointer-events: none;
}
/* Play button glow */
.play-btn {
  box-shadow: 0 4px 24px rgba(255,195,0,0.5);
  transition: all 0.3s;
}
.video-card:hover .play-btn {
  box-shadow: 0 8px 36px rgba(255,195,0,0.7);
  transform: scale(1.1);
}
/* Film frame corners on thumb */
.video-card-thumb::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  z-index: 1;
  pointer-events: none;
  transition: border-color 0.3s;
}
.video-card:hover .video-card-thumb::before {
  border-color: rgba(255,195,0,0.2);
}
.video-card-cat {
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.video-card-body {
  position: relative;
  z-index: 1;
}
.video-card:hover .video-card-title { color: #fff; }

/* ─── Video Row Arrows ───────────────────────────── */
.row-arrow {
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.row-arrow:hover {
  box-shadow: 0 6px 24px rgba(255,195,0,0.25);
  transform: translateY(-50%) scale(1.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* ─── Live Banner — Dramatic ─────────────────────── */
.live-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,30,30,0.08) 0%, var(--bg-2) 40%, rgba(255,30,30,0.04) 100%) !important;
}
.live-banner::before {
  content: '';
  position: absolute;
  top: -100%; right: -50%;
  width: 100%; height: 300%;
  background: radial-gradient(ellipse, rgba(255,68,68,0.08) 0%, transparent 60%);
  animation: livePulse 4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes livePulse {
  from { opacity: 0.5; transform: scale(1); }
  to { opacity: 1; transform: scale(1.1); }
}
.live-banner-pulse {
  animation: liveIconPulse 1.5s ease-in-out infinite;
}
@keyframes liveIconPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,68,68,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(255,68,68,0); }
}

/* ─── Buttons — Premium ──────────────────────────── */
.btn-gold {
  background: linear-gradient(135deg, #FFC300, #e6b000) !important;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.btn-gold::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}
.btn-gold:hover::after { left: 120%; }
.btn-gold:hover {
  box-shadow: 0 8px 32px rgba(255,195,0,0.4), 0 0 60px rgba(255,195,0,0.1);
  transform: translateY(-2px);
}
.btn-ghost:hover {
  box-shadow: 0 4px 20px rgba(255,195,0,0.1);
  transform: translateY(-1px);
}

/* ─── Page Hero — Cinematic ──────────────────────── */
.page-hero {
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 85% 30%, rgba(255,195,0,0.06) 0%, transparent 40%),
    radial-gradient(circle at 15% 80%, rgba(255,195,0,0.04) 0%, transparent 40%);
  pointer-events: none;
}
/* Decorative film strip */
.page-hero::after {
  content: '';
  position: absolute;
  left: 24px; top: 0; bottom: 0;
  width: 32px;
  background: repeating-linear-gradient(to bottom,
    transparent 0px, transparent 8px,
    rgba(255,195,0,0.06) 8px, rgba(255,195,0,0.06) 10px,
    transparent 10px, transparent 24px);
  pointer-events: none;
}
.page-hero-title {
  background: linear-gradient(175deg, #ffffff 20%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Watch Page ─────────────────────────────────── */
.player-wrap {
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,195,0,0.08);
  position: relative;
}
.player-wrap::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,195,0,0.15), transparent 30%, transparent 70%, rgba(255,195,0,0.1));
  z-index: -1;
}
.player-title {
  background: linear-gradient(175deg, #ffffff 30%, #cccccc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.chapters-box {
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.chapter-item:hover {
  background: linear-gradient(90deg, rgba(255,195,0,0.05), transparent 60%);
}
.related-item {
  position: relative;
  overflow: hidden;
}
.related-item::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 2px; height: 0;
  background: var(--gold);
  transition: height 0.3s;
  border-radius: 2px;
}
.related-item:hover::before { height: 100%; }
.related-item:hover {
  background: linear-gradient(90deg, rgba(255,195,0,0.04), transparent) !important;
}
.share-btn:hover {
  box-shadow: 0 4px 16px rgba(255,195,0,0.15);
}

/* ─── Footer — Rich ──────────────────────────────── */
#footer {
  position: relative;
  overflow: hidden;
}
#footer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 300px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
#footer::after {
  content: '';
  position: absolute;
  top: 0; right: -10%;
  width: 40%; height: 60%;
  background: radial-gradient(ellipse, rgba(255,195,0,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.social-chip {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.social-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,195,0,0.2);
}
.footer-col a {
  display: inline-block;
  position: relative;
}
.footer-col a::after {
  content: '';
  position: absolute;
  bottom: -2px; right: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s;
}
.footer-col a:hover::after { width: 100%; }

/* ─── Video Grid Stagger Animation ───────────────── */
.video-grid .video-card { animation: cardReveal 0.5s ease backwards; }
.video-grid .video-card:nth-child(1) { animation-delay: 0.03s; }
.video-grid .video-card:nth-child(2) { animation-delay: 0.06s; }
.video-grid .video-card:nth-child(3) { animation-delay: 0.09s; }
.video-grid .video-card:nth-child(4) { animation-delay: 0.12s; }
.video-grid .video-card:nth-child(5) { animation-delay: 0.15s; }
.video-grid .video-card:nth-child(6) { animation-delay: 0.18s; }
.video-grid .video-card:nth-child(7) { animation-delay: 0.21s; }
.video-grid .video-card:nth-child(8) { animation-delay: 0.24s; }
.video-grid .video-card:nth-child(9) { animation-delay: 0.27s; }
.video-grid .video-card:nth-child(10) { animation-delay: 0.3s; }
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Video Row Track Fade Edges ─────────────────── */
.video-row::before, .video-row::after {
  content: '';
  position: absolute;
  top: 0; bottom: 4px;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.video-row::before {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}
.video-row::after {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}

/* ─── Empty State ────────────────────────────────── */
.empty-state .empty-icon svg {
  filter: drop-shadow(0 0 12px rgba(255,195,0,0.2));
}

/* ─── 404 ────────────────────────────────────────── */
.notfound::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 40%, rgba(255,195,0,0.05) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(255,195,0,0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* ─── Selection ──────────────────────────────────── */
::selection {
  background: rgba(255,195,0,0.25);
  color: #fff;
}

/* ─── Smooth Page Transitions ────────────────────── */
main {
  animation: pageIn 0.5s ease;
}
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Bottom Nav ─────────────────────────────────── */
.bottom-nav {
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.bottom-nav-item.active {
  position: relative;
}
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 2px;
  background: var(--gold);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 8px rgba(255,195,0,0.4);
}

/* ─── Light Theme ────────────────────────────────── */
[data-theme="light"] body::before {
  background-image: radial-gradient(rgba(255,195,0,0.05) 1px, transparent 1px);
}
[data-theme="light"] .hero {
  background: linear-gradient(160deg, #f5f5f5 0%, #fff8e1 40%, #f5f5f5 100%);
}
[data-theme="light"] .hero-title {
  background: linear-gradient(175deg, #111 20%, #8B6914 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .video-card:hover {
  box-shadow: 0 16px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(255,195,0,0.2);
}
[data-theme="light"] .page-hero-title {
  background: linear-gradient(175deg, #111 20%, #8B6914 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
