/* ============================================================
   NZ Modern 2026 — Glass navbar + Tilt cards + Glass cards + Marquee
   Performance-aware: GPU-only transforms, no expensive filters
   on large surfaces, no layout thrashing.
   ============================================================ */

/* ============ Glass sticky navbar ============ */
header.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(94, 62, 184, 0.08);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: background, box-shadow;
}
header.header.nz-scrolled {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 28px rgba(94, 62, 184, 0.08);
  border-bottom-color: rgba(94, 62, 184, 0.12);
}

/* Browsers without backdrop-filter fall back to a solid translucent bg */
@supports not (backdrop-filter: blur(1px)) {
  header.header { background: rgba(255, 255, 255, 0.96); }
}

/* ============ Verify button (added by modern-init.js) ============ */
.nz-verify-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(94,62,184,0.08), rgba(245,166,35,0.08));
  color: var(--primary, #5e3eb8);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(94, 62, 184, 0.18);
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  white-space: nowrap;
}
.nz-verify-btn:hover {
  background: linear-gradient(135deg, rgba(94,62,184,0.18), rgba(245,166,35,0.16));
  transform: translateY(-1px);
  border-color: var(--primary, #5e3eb8);
}
.nz-verify-btn svg { width: 14px; height: 14px; }

@media (max-width: 1100px) {
  .nav-actions .nz-verify-btn { display: none; }
}
.nav-menu .nz-verify-btn-mobile {
  display: none;
}
@media (max-width: 1100px) {
  .nav-menu .nz-verify-btn-mobile { display: list-item; }
}

/* ============ Navbar sizing: "آکادمی نوین ذهن" needs more breathing room ============ */
/* Slightly smaller logo + menu text + tighter gaps so the long brand
   ("آکادمی نوین ذهن" / "Novin Zehn Academy") fits with all menu items
   before flipping to the mobile hamburger. */
header.header .logo {
  font-size: 1.05rem;
  gap: 8px;
}
header.header .logo-mark {
  width: 36px; height: 36px;
}
header.header .nav-menu {
  gap: 4px;
}
header.header .nav-menu a {
  padding: 8px 10px;
  font-size: 0.92rem;
  white-space: nowrap;
}
header.header .nav-actions {
  gap: 6px;
}
header.header .nav-actions .btn {
  padding: 8px 14px;
  font-size: 0.86rem;
  white-space: nowrap;
}

/* Force hamburger menu earlier so the long brand never wraps */
@media (max-width: 1100px) {
  header.header .nav-menu {
    display: none;
  }
  header.header .nav-toggle {
    display: inline-flex;
  }
  /* When the JS opens the menu, it should drop down */
  header.header .nav-menu.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    padding: 1rem;
    box-shadow: 0 12px 32px rgba(94, 62, 184, 0.12);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
  }
  header.header .nav-menu.is-open li { width: 100%; }
  header.header .nav-menu.is-open a {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
  }
  header.header .nav-menu.is-open a:hover {
    background: rgba(94, 62, 184, 0.08);
  }
}
@media (max-width: 640px) {
  header.header .logo {
    font-size: 0.95rem;
  }
  header.header .nav-actions .btn-text {
    display: none;
  }
}

/* ============ Tilt cards ============ */
/* Pure CSS scaffold — JS adds inline transform on mousemove.
   Cards get a subtle base lift, shadow, and the JS-driven 3D tilt
   only fires on devices with a pointer. */
.nz-tilt {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.4s ease;
  will-change: transform;
}
.nz-tilt-inner { transform: translateZ(0); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.nz-tilt:hover { box-shadow: 0 28px 60px -10px rgba(94, 62, 184, 0.28), 0 12px 28px rgba(31, 27, 46, 0.10); }

/* Skip tilt on touch & reduced-motion */
@media (hover: none), (prefers-reduced-motion: reduce) {
  .nz-tilt, .nz-tilt-inner { transform: none !important; transition: none; }
}

/* ============ Glass cards ============ */
.nz-glass {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  backdrop-filter: saturate(170%) blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 32px rgba(94, 62, 184, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.nz-glass.dark {
  background: rgba(31, 27, 46, 0.45);
  border-color: rgba(255, 255, 255, 0.10);
  color: white;
}
@supports not (backdrop-filter: blur(1px)) {
  .nz-glass { background: rgba(255, 255, 255, 0.95); }
  .nz-glass.dark { background: rgba(31, 27, 46, 0.92); }
}

/* Course cards: opt-in glass + tilt mix.
   We don't auto-apply to .course-card because some have colored covers.
   Add .nz-glass and/or .nz-tilt where wanted. */

/* ============ Marquee (lightweight, CSS-only) ============ */
.nz-marquee {
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.nz-marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: nz-marquee 38s linear infinite;
  will-change: transform;
}
.nz-marquee:hover .nz-marquee-track { animation-play-state: paused; }
@keyframes nz-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
[dir="rtl"] .nz-marquee-track { animation-name: nz-marquee-rtl; }
@keyframes nz-marquee-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}
.nz-marquee-item {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: white;
  border: 1px solid var(--border, #E5E1F0);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-soft, #4A4566);
  font-weight: 600;
  white-space: nowrap;
}
.nz-marquee-item strong { color: var(--primary, #5e3eb8); }

@media (prefers-reduced-motion: reduce) {
  .nz-marquee-track { animation: none; }
  .nz-marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
}
