/* Local High-Quality Persian Fonts (Offline & Bypass Filter) */
@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Regular.ttf') format('truetype');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Bold.ttf') format('truetype');
  font-weight: 600 700 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --c-bg:             #ffffff;
  --c-bg-subtle:      #fafbfd;
  --c-text-primary:   #333a48;
  --c-text-muted:     #6b7280;
  --c-text-light:     #9ca3af;
  --c-cyan-electric:  #0ea5e9;
  --c-cyan-deep:      #0284c7;
  --c-cyan-glow:      rgba(14, 165, 233, 0.55);
  --c-cyan-halo:      rgba(56, 189, 248, 0.15);
  
  --font-main:        'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-fa:          'Vazirmatn', system-ui, -apple-system, sans-serif;
  --font-current:     var(--font-main);
}

[data-lang="fa"] {
  --font-current: var(--font-fa);
  font-family: var(--font-fa);
  direction: rtl;
}

[data-lang="fa"] body {
  font-family: var(--font-fa);
}

[data-lang="en"] {
  --font-current: var(--font-main);
  font-family: var(--font-main);
  direction: ltr;
}

[data-lang="en"] body {
  font-family: var(--font-main);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-current);
  /* Deeper Luxury Platinum-Sky Canvas (تیره کردن سایت به اندازه یک پرده کامل)
     کاهش ملموس سفیدی، آرامش چشم و کنتراست فوق‌العاده برای مار و عصا */
  background-color: #dfebf5;
  background-image: 
    /* Gentle soft atmospheric lighting */
    radial-gradient(ellipse 980px 750px at 50% 50%, #eaf2fa 0%, #dfebf5 65%, #d4e3f0 100%);
  background-attachment: fixed;
  color: var(--c-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  user-select: none;
  padding: 24px;
}

/* Main Container Stage */
.staff-stage {
  width: 100%;
  max-width: 1760px;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* ==========================================================================
   Header & Typography (SPEEDOS UI)
   ========================================================================== */

.stage-header {
  width: 100%;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 16px 8px;
  position: relative;
  margin: 0 auto;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transform: none;
}

[data-lang="fa"] .brand-block {
  transform: none;
}

.brand-logo-wrap {
  position: relative;
  width: 250px;
  height: 115px; /* Refined luxury scale for high-visibility logo motion */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  margin: 0 auto;
  background: transparent;
  outline: none;
}

.brand-logo-wrap:hover {
  /* NEVER apply opacity, transform, or filter here: prevents Chrome from creating an isolated stacking context that turns canvas white! */
}

.brand-logo-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  background: transparent;
  mix-blend-mode: multiply; /* 100% Seamless blending with site pure white */
  filter: contrast(1.08) brightness(1.05); /* Clean, zero sub-255 compression artifacts */
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Top Utilities Navigation (Direct Standalone 3D Clay Icons with Labels Underneath) */
.top-nav-utils {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 32px;
  position: static;
  margin-top: 12px;
}

[data-lang="fa"] .top-nav-utils {
  right: auto;
  left: auto;
}

.nav-icon-action {
  background: transparent;
  border: none;
  padding: 6px 12px 4px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-decoration: none;
}

.nav-icon-wrapper {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-action-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(14, 165, 233, 0.25));
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), filter 0.28s ease;
}

/* Hover & Active Feedback on Direct 3D Icons */
.nav-icon-action:hover .nav-icon-wrapper {
  transform: translateY(-4px) scale(1.10);
}

.nav-icon-action:hover .nav-action-img {
  filter: drop-shadow(0 8px 18px rgba(14, 165, 233, 0.48));
}

.nav-icon-action:active .nav-icon-wrapper {
  transform: scale(0.94);
}

/* Small, Crisp Label Underneath the Icon */
.nav-icon-label {
  font-family: var(--font-current);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #475569;
  text-align: center;
  white-space: nowrap;
  transition: color 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.nav-icon-action:hover .nav-icon-label {
  color: var(--c-cyan-deep);
  transform: translateY(-1px);
}

/* Special 3D Clay Coin for Language Toggle */
.lang-clay-coin {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
  border: 2px solid #38bdf8;
  box-shadow: 
    0 4px 10px rgba(14, 165, 233, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.95),
    inset 0 -2px 4px rgba(14, 165, 233, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-coin-text {
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--c-cyan-deep);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.nav-icon-action:hover .lang-clay-coin {
  border-color: #0284c7;
  box-shadow: 
    0 6px 18px rgba(14, 165, 233, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 1);
}

/* ==========================================================================
   Hero Sanctuary (3-Column Layout: Download - Staff - Upload)
   ========================================================================== */

.hero-sanctuary {
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin: 0 auto;
  position: relative;
  flex-shrink: 0;
}

/* Metric Wings (Left & Right) */
.metric-wing {
  width: 260px;
  max-width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transform: translateY(55px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.download-wing {
  align-items: flex-start;
  text-align: left;
}

.upload-wing {
  align-items: flex-end;
  text-align: right;
}

[data-lang="fa"] .download-wing {
  align-items: flex-start;
  text-align: right;
}

[data-lang="fa"] .upload-wing {
  align-items: flex-end;
  text-align: left;
}

.metric-header-row {
  margin-bottom: 2px;
}

.metric-eyebrow {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--c-text-muted);
  text-transform: uppercase;
}

.metric-digits-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}

.metric-number {
  font-family: var(--font-main);
  font-size: 5.2rem;
  font-weight: 700;
  color: var(--c-cyan-electric);
  letter-spacing: -0.03em;
  line-height: 0.95;
  transition: color 0.3s ease;
  font-feature-settings: "tnum";
}

.metric-wing.active-wing .metric-number {
  color: #0284c7;
  text-shadow: 0 0 24px rgba(14, 165, 233, 0.45);
}

.metric-unit {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--c-text-muted);
}

/* Dynamic Glowing Cyan Waves */
.wave-container {
  width: 100%;
  height: 54px;
  position: relative;
  margin-top: 6px;
  overflow: visible;
  background: transparent;
}

.cyan-wave-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  background: transparent;
}

.wave-curved-aura {
  fill: none;
  stroke: #38bdf8;
  opacity: 0.18;
  filter: blur(5px);
  transform: translateY(3.5px);
  pointer-events: none;
}

.glowing-wave-path {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 5px rgba(14, 165, 233, 0.4));
}

.wave-ambient-halo {
  display: none !important;
}

/* ==========================================================================
   Centerpiece: The Staff of Asclepius & Electric Snake Video
   ========================================================================== */

.staff-centerpiece {
  width: 360px;
  height: 620px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  border-radius: 40px;
  background: transparent;
}

.staff-centerpiece:hover {
  /* NEVER transform container: prevents Chrome from isolating mix-blend-mode into a white box! */
}

/* Zero square box halo: complete transparency */
.staff-aura {
  display: none !important;
}

.staff-video-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.staff-video,
.staff-canvas {
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  /* Seamless pure white multiply blending with ZERO white box halo */
  mix-blend-mode: multiply;
  background: transparent;
  /* Natural sculpted texture, crystal-clear blue snake and zero highlight blowout */
  filter: contrast(1.02) saturate(1.06);
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.media-anti-grabber-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

/* Interactive Action Badge Floating Over Staff Base */
.staff-action-badge {
  position: absolute;
  bottom: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  padding: 8px 20px;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.18), 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.92;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}

.staff-centerpiece:hover .staff-action-badge {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.28);
}

.badge-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-cyan-electric);
  box-shadow: 0 0 8px var(--c-cyan-electric);
  animation: badgeDotPulse 1.8s infinite ease-in-out;
}

@keyframes badgeDotPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.badge-text {
  font-family: var(--font-current);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--c-cyan-deep);
  user-select: none;
}

.staff-centerpiece.testing .staff-action-badge {
  background: var(--c-cyan-deep);
  border-color: var(--c-cyan-electric);
}

.staff-centerpiece.testing .badge-text {
  color: #ffffff;
}

.staff-centerpiece.testing .badge-pulse-dot {
  background: #ffffff;
  box-shadow: 0 0 10px #ffffff;
}

/* ==========================================================================
   Bottom Stage Footer (PING / JITTER + Network Badge)
   ========================================================================== */

.stage-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
}

.ping-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ping-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--c-text-muted);
  text-transform: uppercase;
}

.ping-digits-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

.ping-number {
  font-family: var(--font-main);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--c-cyan-electric);
  letter-spacing: -0.03em;
  line-height: 0.95;
  font-feature-settings: "tnum";
}

.ping-unit {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--c-text-muted);
}

.jitter-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-text-light);
}

.network-badge {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  gap: 8px;
}

.net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.net-dot.testing {
  background: var(--c-cyan-electric);
  box-shadow: 0 0 8px var(--c-cyan-electric);
  animation: net-pulse 1s infinite alternate;
}

@keyframes net-pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 1; }
}

.net-sep {
  color: #cbd5e1;
}

/* Luxury Minimalist Direct Contact Pill */
.contact-pill-wrap {
  margin-top: 2px;
}

.contact-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 20px;
  padding: 5px 15px;
  font-size: 0.77rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  direction: ltr;
}

[data-lang="fa"] .contact-pill-link {
  direction: rtl;
}

.contact-mail-icon {
  color: var(--c-cyan-deep);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.contact-pill-label {
  font-family: var(--font-current);
  color: #475569;
}

.contact-pill-email {
  font-family: var(--font-main);
  font-weight: 700;
  color: var(--c-cyan-deep);
  letter-spacing: 0.02em;
  direction: ltr;
  unicode-bidi: isolate;
}

.contact-pill-link:hover {
  border-color: #38bdf8;
  color: var(--c-cyan-deep);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.22);
  background: rgba(255, 255, 255, 0.98);
}

.contact-pill-link:hover .contact-mail-icon {
  transform: scale(1.15);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.minimal-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid #bae6fd;
  border-radius: 24px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 16px 36px rgba(14, 165, 233, 0.18), 0 2px 8px rgba(0, 0, 0, 0.04);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.minimal-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-glow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-cyan-electric);
  box-shadow: 0 0 10px var(--c-cyan-electric);
}

.toast-content {
  display: flex;
  flex-direction: column;
}

.toast-head {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--c-cyan-deep);
}

.toast-sub {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-muted);
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--c-text-light);
  line-height: 1;
  padding: 0 4px;
}

/* ==========================================================================
   Modals (Story & History)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.clean-modal-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .clean-modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-cyan-deep);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--c-text-light);
  line-height: 1;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-action-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px 20px;
  font-family: var(--font-current);
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-action-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-action-btn.primary {
  background: var(--c-cyan-deep);
  color: #ffffff;
  border-color: var(--c-cyan-electric);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.modal-action-btn.primary:hover {
  background: #0369a1;
}

.modal-action-btn.danger {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

/* Story Modal */
.story-modal-card {
  max-width: 500px;
}

.story-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.story-preview-container {
  width: 250px;
  height: 444px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.story-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-controls-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.story-tags {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.story-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-muted);
}

.story-actions {
  display: flex;
  gap: 10px;
}

.story-hint {
  font-size: 0.76rem;
  font-weight: 600;
  color: #10b981;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.history-empty {
  text-align: center;
  color: var(--c-text-light);
  padding: 32px 0;
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Layout (Mobile & Tablet)
   ========================================================================== */

@media (max-width: 900px) {
  .hero-sanctuary {
    flex-direction: column;
    gap: 20px;
  }

  .staff-centerpiece {
    width: 280px;
    height: 440px;
    order: 1;
  }

  .download-wing {
    order: 2;
    width: 100%;
    max-width: 320px;
    align-items: center;
    text-align: center;
  }

  .upload-wing {
    order: 3;
    width: 100%;
    max-width: 320px;
    align-items: center;
    text-align: center;
  }

  .metric-number {
    font-size: 4.4rem;
  }

  .brand-block {
    transform: none;
  }

  [data-lang="fa"] .brand-block {
    transform: none;
  }
}

/* ==========================================================================
   Monetization & Ad Slot Placements (IAB Standard Clean Aesthetics)
   ========================================================================== */

.ad-slot-wrapper {
  display: none !important; /* Temporarily hidden until traffic threshold reached */
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  transition: opacity 0.3s ease;
}

/* Top Leaderboard (728x90) */
.ad-slot-top-wrap {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  margin: 10px auto 4px;
}

/* Flanked Stage with Half-Page / Skyscraper Slots (300x600) */
.hero-stage-flanked {
  width: 100%;
  max-width: 1720px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  position: relative;
  padding: 0 20px;
  margin: auto auto;
}

.ad-slot-skyscraper {
  width: 300px;
  min-width: 300px;
  min-height: 600px;
  flex-shrink: 0;
}

/* Post-Test Result Rectangle (300x250) */
.ad-slot-result-wrap {
  width: 100%;
  max-width: 336px;
  min-height: 250px;
  margin: 18px auto 6px;
  display: none;
}

.ad-slot-result-wrap.ad-slot-visible {
  display: flex;
  animation: adResultFadeIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes adResultFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Ad Banner Card Container */
.ad-banner-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.025);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.ad-banner-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.12);
  border-color: rgba(186, 230, 253, 0.8);
}

.ad-sponsor-label {
  position: absolute;
  top: 4px;
  right: 6px;
  font-family: var(--font-main);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  padding: 1px 6px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 3;
}

[data-lang="fa"] .ad-sponsor-label {
  right: auto;
  left: 6px;
}

.ad-banner-link {
  display: block;
  text-decoration: none;
  line-height: 0;
  width: 100%;
  height: 100%;
}

.ad-banner-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.ad-banner-iframe {
  width: 100%;
  height: 100%;
  border: none;
  overflow: hidden;
}

/* Responsive Ad Visibility */
@media (max-width: 1680px) {
  .ad-slot-skyscraper {
    display: none !important;
  }
}

@media (max-width: 780px) {
  .ad-slot-top-wrap {
    max-width: 320px;
    min-height: 50px;
  }
}

/* ==========================================================================
   Admin Dashboard & Management Modal
   ========================================================================== */

.admin-modal-card {
  width: 940px;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  direction: rtl;
  text-align: right;
  font-family: var(--font-current);
}

.admin-modal-title-box h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #1e293b;
  font-family: inherit;
}

.admin-modal-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 3px;
  display: block;
}

.admin-modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Admin Login Screen */
.admin-login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  max-width: 380px;
  margin: 0 auto;
}

.admin-lock-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.admin-login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

.admin-login-sub {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 6px;
  margin-bottom: 24px;
}

.admin-login-sub code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--c-cyan-deep);
}

.admin-input-group {
  width: 100%;
  display: flex;
  gap: 10px;
}

.admin-err-msg {
  color: #ef4444;
  font-size: 0.82rem;
  margin-top: 10px;
  min-height: 20px;
}

/* Dashboard Tabs */
.admin-slot-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.admin-tab-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-tab-btn .tab-dim {
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 500;
  direction: ltr;
}

.admin-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.admin-tab-btn.active .tab-dim {
  color: #e0f2fe;
}

/* Slot Editor Grid */
.admin-editor-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

@media (max-width: 820px) {
  .admin-editor-grid {
    grid-template-columns: 1fr;
  }
}

.admin-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.admin-title-badge strong {
  font-size: 1rem;
  color: #1e293b;
  display: block;
}

.admin-badge-size {
  display: inline-block;
  background: #f0f9ff;
  color: #0284c7;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

/* Switch Toggle */
.admin-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.admin-switch input {
  display: none;
}

.admin-slider {
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 20px;
  position: relative;
  transition: background 0.25s ease;
}

.admin-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.admin-switch input:checked + .admin-slider {
  background: #10b981;
}

.admin-switch input:checked + .admin-slider::before {
  transform: translateX(20px);
}

.admin-switch-label {
  font-size: 0.82rem;
  color: #334155;
}

/* Form Styles */
.admin-form-group {
  margin-bottom: 16px;
}

.admin-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.admin-text-input,
.admin-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-text-input:focus,
.admin-textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.admin-radio-group {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.admin-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: #475569;
  cursor: pointer;
}

.admin-upload-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-file-btn {
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background 0.2s ease;
}

.admin-file-btn:hover {
  background: #e2e8f0;
}

.admin-file-name {
  font-size: 0.76rem;
  color: #64748b;
}

/* Live Preview Column */
.admin-preview-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.admin-preview-head {
  font-size: 0.84rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 12px;
}

.admin-live-box {
  width: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  position: relative;
  overflow: hidden;
}

.admin-fit-badge-row {
  margin-bottom: 12px;
}

.admin-fit-badge {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  line-height: 1.5;
  text-align: right;
  direction: rtl;
}

.admin-fit-badge.match {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.admin-fit-badge.warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.admin-safe-frame {
  max-width: 100%;
  max-height: 200px;
  width: 100%;
  border: 2px solid #0284c7;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-preview-media {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  display: block;
}

.admin-preview-media.fit-cover {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
}

.admin-preview-media.fit-contain {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: #f8fafc;
}

.admin-fit-selector-row {
  margin-bottom: 14px;
}

.admin-fit-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
  display: block;
  margin-bottom: 6px;
}

.admin-fit-btn-group {
  display: flex;
  gap: 8px;
}

.admin-fit-opt {
  flex: 1;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
  font-family: var(--font-current);
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.admin-fit-opt:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.admin-fit-opt.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.admin-preview-placeholder {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
}

/* Slot Metrics Cards */
.admin-slot-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
}

.admin-metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}

.admin-metric-num {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-cyan-deep);
  display: block;
}

.admin-metric-lbl {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 2px;
  display: block;
}

/* Footer Buttons */
.admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 20px;
}

.admin-footer-left,
.admin-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-primary-btn {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.admin-primary-btn:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.admin-outline-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-outline-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.admin-outline-btn.danger {
  color: #ef4444;
  border-color: #fca5a5;
}

.admin-outline-btn.danger:hover {
  background: #fef2f2;
}

.admin-status-text {
  font-size: 0.82rem;
  color: #10b981;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.admin-status-text.visible {
  opacity: 1;
}

/* Stats Overview Tab */
.admin-stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.admin-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.summary-val {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0284c7;
  display: block;
}

.summary-lbl {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
  display: block;
}

.admin-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.admin-stats-table th {
  background: #f1f5f9;
  color: #475569;
  text-align: right;
  padding: 10px 14px;
  border-bottom: 2px solid #e2e8f0;
}

[data-lang="en"] .admin-stats-table th {
  text-align: left;
}

.admin-stats-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.status-pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
}

.status-pill.active {
  background: #dcfce7;
  color: #15803d;
}

.status-pill.inactive {
  background: #f1f5f9;
  color: #94a3b8;
}

.admin-stats-actions {
  display: flex;
  justify-content: flex-end;
}
