<?php $lang = stb_lang(); 
$login_label_url = $lang==='fa' ? 'https://crm.stbbrokers.com/fa':'https://crm.stbbrokers.com/';
$register_label_url = $lang==='fa' ? 'https://crm.stbbrokers.com/fa/register':'https://crm.stbbrokers.com/register/';
?>
<section class="pamm-wrap" id="investment" aria-labelledby="pamm-heading">
<style>
/* ═══════════════════════════════════════════
   STB INVESTMENT — PAMM Creative Dashboard Overhaul
   High-Contrast Futuristic Theme, Glassmorphism, 3D Tilt
   Preserves all original product copy and numbers exactly
   Scoped to .pamm-wrap
   ═══════════════════════════════════════════ */
.pamm-wrap {
  background: #030506;
  padding: 110px 0;
  position: relative;
  overflow: hidden;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Technical dual-layer CSS grid background overlay */
.pamm-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(20, 224, 163, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 224, 163, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 45%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Background animated decorative neon blobs */
.pamm-bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.pamm-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.07;
  mix-blend-mode: screen;
  pointer-events: none;
}
.pamm-blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #14e0a3 0%, transparent 70%);
  top: -150px;
  right: -100px;
  animation: pamm-float-blob-1 25s infinite alternate ease-in-out;
}
.pamm-blob-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, #0a523c 0%, transparent 70%);
  bottom: -200px;
  left: -150px;
  animation: pamm-float-blob-2 30s infinite alternate ease-in-out;
}
@keyframes pamm-float-blob-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-100px, 100px) scale(1.15); }
}
@keyframes pamm-float-blob-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(120px, -80px) scale(0.9); }
}

.pamm-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}
@media(max-width:768px) {
  .pamm-inner { padding: 0 24px; }
}

/* Grid Layout */
.pamm-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 1024px) {
  .pamm-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* ══════════════════════════
   LEFT COLUMN — TEXT & TRUST
   ══════════════════════════ */
.pamm-text-content {
  display: flex;
  flex-direction: column;
}
.pamm-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(20, 224, 163, 0.85);
  margin-bottom: 18px;
}
.pamm-kicker-icon {
  stroke: #14e0a3;
  fill: none;
  width: 14px;
  height: 14px;
}
.pamm-title {
  font-size: clamp(32px, 3.8vw, 48px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.pamm-title em {
  font-style: normal;
  background: linear-gradient(135deg, #14e0a3 0%, #089d6c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 35px rgba(20, 224, 163, 0.15);
}
.pamm-desc {
  font-size: 15.5px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 32px;
}

/* Features checklist */
.pamm-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}
.pamm-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.3s ease;
}
.pamm-feature:hover {
  color: rgba(255, 255, 255, 0.9);
}
.pamm-feature-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(20, 224, 163, 0.08);
  border: 1px solid rgba(20, 224, 163, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.pamm-feature:hover .pamm-feature-check {
  background: rgba(20, 224, 163, 0.16);
  border-color: rgba(20, 224, 163, 0.5);
  box-shadow: 0 0 8px rgba(20, 224, 163, 0.3);
}
.pamm-feature-check svg {
  stroke: #14e0a3;
  fill: none;
  width: 12px;
  height: 12px;
}

/* Action buttons */
.pamm-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
}
.pamm-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #14e0a3 0%, #089d6c 100%);
  color: #030c08;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(20, 224, 163, 0.25);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.pamm-btn-primary:hover {
  color: #030c08;
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(20, 224, 163, 0.45);
}
.pamm-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pamm-btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

/* ── TRUST BADGES GRID ── */
.pamm-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .pamm-trust {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
.pamm-trust-item {
  background: rgba(13, 16, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.pamm-trust-item:hover {
  background: rgba(13, 16, 18, 0.85);
  border-color: rgba(20, 224, 163, 0.25);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.4),
    0 0 25px rgba(20, 224, 163, 0.05);
  transform: translateY(-2px);
}
.pamm-trust-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(20, 224, 163, 0.06);
  border: 1px solid rgba(20, 224, 163, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.pamm-trust-item:hover .pamm-trust-icon {
  background: rgba(20, 224, 163, 0.15);
  border-color: rgba(20, 224, 163, 0.4);
  box-shadow: 0 0 12px rgba(20, 224, 163, 0.2);
  transform: scale(1.05) rotate(3deg);
}
.pamm-trust-icon svg {
  stroke: #14e0a3;
  fill: none;
  width: 20px;
  height: 20px;
}
.pamm-trust-content {
  flex-grow: 1;
}
.pamm-trust-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.pamm-trust-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.4;
}

/* Technical HUD brackets for items */
.pamm-hud-bracket {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(20, 224, 163, 0.25);
  border-style: solid;
  z-index: 10;
  pointer-events: none;
  transition: all 0.3s ease;
}
.pamm-hud-bracket.tl { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.pamm-hud-bracket.tr { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.pamm-hud-bracket.bl { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.pamm-hud-bracket.br { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.pamm-3d-item:hover .pamm-hud-bracket {
  border-color: rgba(20, 224, 163, 0.7);
  box-shadow: 0 0 8px rgba(20, 224, 163, 0.4);
}

/* ══════════════════════════
   RIGHT COLUMN — LEADERBOARD
   ══════════════════════════ */
.pamm-table-card {
  background: rgba(13, 16, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 35px 70px rgba(0,0,0,0.6);
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--tz, 0px)) scale(var(--scale, 1));
  transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}
.pamm-table-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.003) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.003) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
  z-index: 1;
}
.pamm-table-card:hover {
  border-color: rgba(20, 224, 163, 0.35);
  box-shadow: 
    0 40px 80px rgba(0,0,0,0.75),
    0 0 35px rgba(20, 224, 163, 0.08);
}
.pamm-table-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle 300px at var(--mx, 50%) var(--my, 50%), rgba(20, 224, 163, 0.08) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.pamm-table-card:hover .pamm-table-glow {
  opacity: 1;
}

/* Table top bar */
.pamm-table-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(20, 224, 163, 0.03);
}
.pamm-table-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(20, 224, 163, 0.85);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pamm-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #14e0a3;
  background: rgba(20, 224, 163, 0.08);
  border: 1px solid rgba(20, 224, 163, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
}
.pamm-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #14e0a3;
  animation: pamm-blink 1.4s ease-in-out infinite;
}
@keyframes pamm-blink {
  0%,100% { opacity:1; box-shadow: 0 0 6px #14e0a3; }
  50% { opacity:.3; box-shadow: none; }
}

/* Table header */
.pamm-thead {
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.1fr 100px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 12px;
}
.pamm-th {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}
.pamm-th:not(:first-child) {
  text-align: right;
}

/* Manager rows */
.pamm-tbody {
  padding: 4px 0;
}
.pamm-row {
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.1fr 100px;
  padding: 18px 24px;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  align-items: center;
  transition: all 0.25s ease;
  position: relative;
  cursor: pointer;
}
.pamm-row:last-child {
  border-bottom: none;
}
.pamm-row:hover {
  background: rgba(20, 224, 163, 0.02);
}

/* Hexagon-style rank design */
.pamm-rank-hex {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.pamm-row:nth-child(1) .pamm-rank-hex {
  background: rgba(20, 224, 163, 0.12);
  border-color: rgba(20, 224, 163, 0.35);
  color: #14e0a3;
  box-shadow: 0 0 10px rgba(20, 224, 163, 0.2);
}
.pamm-row:nth-child(2) .pamm-rank-hex {
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.35);
  color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}
.pamm-row:nth-child(3) .pamm-rank-hex {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}
.pamm-row:nth-child(4) .pamm-rank-hex {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

.pamm-manager-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pamm-manager-info {
  display: flex;
  flex-direction: column;
}
.pamm-manager-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  transition: color 0.2s ease;
}
.pamm-row:hover .pamm-manager-name {
  color: #14e0a3;
}
.pamm-manager-id {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  font-family: monospace;
  margin-top: 2px;
}

/* Return Cell (Neon Flash Animates) */
.pamm-return {
  font-size: 15.5px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: all 0.3s;
}
.pamm-return.up { color: #14e0a3; text-shadow: 0 0 10px rgba(20, 224, 163, 0.15); }
.pamm-return.down { color: #ff5a72; text-shadow: 0 0 10px rgba(255, 90, 114, 0.15); }
.pamm-return.flash {
  animation: pamm-flash 0.4s ease-out;
}
@keyframes pamm-flash {
  0% { transform: scale(1.15); filter: brightness(1.3); }
  100% { transform: scale(1); }
}

/* Drawdown Cell */
.pamm-dd {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Equity curve sparkline */
.pamm-spark-cell {
  display: flex;
  justify-content: flex-end;
}
.pamm-spark {
  width: 80px;
  height: 32px;
}

/* Stats strip below table */
.pamm-table-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.pamm-footer-stat {
  background: rgba(13, 16, 18, 0.8);
  padding: 18px 20px;
  text-align: center;
  transition: background 0.2s;
}
.pamm-footer-stat:hover {
  background: rgba(20, 224, 163, 0.02);
}
.pamm-footer-val {
  font-size: 19px;
  font-weight: 800;
  color: #14e0a3;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  text-shadow: 0 0 12px rgba(20, 224, 163, 0.15);
}
.pamm-footer-label {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Responsiveness inside Leaderboard */
@media (max-width: 580px) {
  .pamm-thead, .pamm-row {
    grid-template-columns: 2.2fr 1fr;
  }
  .pamm-th:nth-child(3), .pamm-th:nth-child(4),
  .pamm-dd, .pamm-spark-cell {
    display: none;
  }
}

/* ── BOTTOM PROMO CAPULES GRID (Inspired by reference layout) ── */
.pamm-footer-promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
  width: 100%;
}
@media (max-width: 768px) {
  .pamm-footer-promo-grid {
    grid-template-columns: 1fr;
  }
}
.pamm-promo-card {
  background: rgba(13, 16, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--tz, 0px)) scale(var(--scale, 1));
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}
.pamm-promo-card:hover {
  border-color: rgba(20, 224, 163, 0.35);
  box-shadow: 
    0 25px 45px rgba(0, 0, 0, 0.75),
    0 0 25px rgba(20, 224, 163, 0.08);
}
.pamm-promo-card-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle 250px at var(--mx, 50%) var(--my, 50%), rgba(20, 224, 163, 0.08) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.pamm-promo-card:hover .pamm-promo-card-glow {
  opacity: 1;
}
.pamm-promo-content {
  flex: 1;
  position: relative;
  z-index: 2;
}
.pamm-promo-content strong {
  display: block;
  font-size: 15.5px;
  color: #fff;
  margin-bottom: 6px;
  font-weight: 700;
}
.pamm-promo-content p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.5;
  margin: 0;
}
.pamm-promo-action {
  position: relative;
  z-index: 2;
}
.pamm-coupon-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 224, 163, 0.04);
  border: 1px dashed rgba(20, 224, 163, 0.3);
  padding: 10px 16px;
  border-radius: 12px;
  color: #14e0a3;
  font-family: monospace;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.pamm-coupon-box:hover {
  background: rgba(20, 224, 163, 0.1);
  border-color: #14e0a3;
  box-shadow: 0 0 10px rgba(20, 224, 163, 0.2);
}
.pamm-promo-btn-glow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 50px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.pamm-promo-btn-glow:hover {
  background: #14e0a3;
  color: #030c08;
  border-color: #14e0a3;
  box-shadow: 0 0 15px rgba(20, 224, 163, 0.3);
}

/* ── BILINGUAL & RTL STYLING ── */
body.rtl .pamm-grid {
  direction: rtl;
}
body.rtl .pamm-text-content {
  text-align: right !important;
  direction: rtl;
}
body.rtl .pamm-kicker {
  flex-direction: row !important;
  justify-content: flex-start !important;
}
body.rtl .pamm-title {
  text-align: right !important;
}
body.rtl .pamm-features {
  align-items: flex-start !important;
}
body.rtl .pamm-feature {
  flex-direction: row !important;
  text-align: right !important;
}
body.rtl .pamm-feature-check {
  margin-right: 0 !important;
  margin-left: 12px !important;
}
body.rtl .pamm-btns {
  flex-direction: row !important;
  justify-content: flex-start !important;
}
body.rtl .pamm-trust {
  direction: rtl !important;
}
body.rtl .pamm-trust-item {
  direction: rtl !important;
  text-align: right !important;
}
body.rtl .pamm-trust-icon {
  margin-right: 0 !important;
  margin-left: 14px !important;
}
body.rtl .pamm-hud-label {
  left: auto !important;
  right: 18px !important;
}
body.rtl .pamm-hud-status {
  right: auto !important;
  left: 18px !important;
  flex-direction: row-reverse;
}
body.rtl .pamm-status-pulse-dot {
  margin-right: 0 !important;
  margin-left: 6px !important;
}
body.rtl .pamm-table-card {
  direction: rtl;
}
body.rtl .pamm-table-bar {
  flex-direction: row !important;
}
body.rtl .pamm-thead {
  direction: rtl;
}
body.rtl .pamm-th:not(:first-child) {
  text-align: left !important;
}
body.rtl .pamm-row {
  direction: rtl;
}
body.rtl .pamm-manager-cell {
  flex-direction: row !important;
}
body.rtl .pamm-manager-info {
  margin-left: 0 !important;
  margin-right: 12px !important;
}
body.rtl .pamm-return {
  text-align: left !important;
}
body.rtl .pamm-dd {
  text-align: left !important;
}
body.rtl .pamm-spark-cell {
  justify-content: flex-start !important;
}
body.rtl .pamm-table-footer {
  direction: rtl;
}
body.rtl .pamm-footer-promo-grid {
  direction: rtl;
}
body.rtl .pamm-promo-card {
  direction: rtl !important;
}
body.rtl .pamm-promo-content {
  text-align: right !important;
}
body.rtl .pamm-coupon-box {
  flex-direction: row !important;
}
body.rtl .pamm-promo-btn-glow {
  flex-direction: row !important;
}
body.rtl .pamm-promo-btn-glow svg {
  transform: scaleX(-1);
  margin-right: 8px;
}

body.rtl .pamm-hud-bracket.tl { left: auto !important; right: -1px !important; border-width: 1px 1px 0 0 !important; }
body.rtl .pamm-hud-bracket.tr { right: auto !important; left: -1px !important; border-width: 1px 0 0 1px !important; }
body.rtl .pamm-hud-bracket.bl { bottom: -1px !important; left: auto !important; right: -1px !important; border-width: 0 1px 1px 0 !important; }
body.rtl .pamm-hud-bracket.br { bottom: -1px !important; right: auto !important; left: -1px !important; border-width: 0 0 1px 1px !important; }
</style>

<!-- Decorative Neon Blobs -->
<div class="pamm-bg-decor" aria-hidden="true">
  <div class="pamm-blob pamm-blob-1"></div>
  <div class="pamm-blob pamm-blob-2"></div>
</div>

<div class="pamm-inner">
  <div class="pamm-grid">

    <!-- ══ LEFT: Text, Buttons, Trust ══ -->
    <div class="pamm-text-content">
      <div class="pamm-kicker">
        <svg class="pamm-kicker-icon" viewBox="0 0 24 24">
          <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" stroke-width="1.5"/>
        </svg>
        <?php echo $lang==='fa' ? 'محصول سرمایه‌گذاری · PAMM' : 'INVESTMENT PRODUCT · PAMM'; ?>
      </div>

      <h2 class="pamm-title" id="pamm-heading">
        <?php echo $lang==='fa' ? 'بگذارید حرفه‌ای‌ها<br>سرمایه شما را <em>مدیریت کنند</em>' : 'Let Professionals<br>Grow Your <em>Capital</em>'; ?>
      </h2>

      <p class="pamm-desc">
        <?php echo $lang==='fa'
          ? 'سیستم PAMM در STB سرمایه‌گذاران را با معامله‌گران حرفه‌ای تاییدشده پیوند می‌دهد؛ وجوه خود را تخصیص دهید، عملکرد لحظه‌ای ببینید و به صورت شفاف در سود شریک شوید.'
          : "STB's PAMM system connects investors with verified professional traders. Allocate funds, track performance in real time, and earn proportionally — with full transparency."; ?>
      </p>

      <div class="pamm-features">
        <?php $features = $lang==='fa' ? [
          'سابقه مدیران تأیید شده — ارزیابی دقیق',
          'نظارت لحظه‌ای عملکرد — داشبورد زنده',
          'تخصیص و برداشت انعطاف‌پذیر — در هر زمان',
          'محافظت کامل سرمایه — وجوه تفکیک‌شده',
        ] : [
          'Verified Manager Track Records — strict evaluation',
          'Real-Time Performance Monitoring — live dashboard',
          'Flexible Allocation & Withdrawal — invest anytime',
          'Full Capital Protection — funds are segregated',
        ];
        foreach($features as $f): ?>
        <div class="pamm-feature">
          <div class="pamm-feature-check">
            <svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
          </div>
          <span><?php echo esc_html($f); ?></span>
        </div>
        <?php endforeach; ?>
      </div>

      <div class="pamm-btns">
        <a href="/NewSite/pamm/" class="pamm-btn-primary">
          <?php echo $lang==='fa' ? 'سرمایه‌گذاری در PAMM' : 'Invest in PAMM'; ?>
        </a>
        <a href="<?php echo esc_html($register_label_url);?>" class="pamm-btn-ghost">
          <?php echo $lang==='fa' ? 'مدیر صندوق شوید' : 'Become a Manager'; ?>
        </a>
      </div>

      <!-- Trust Badges 2x2 Grid -->
      <div class="pamm-trust">
        <?php $trust = $lang==='fa' ? [
          ['<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke-width="1.5"/>',
           'وجوه تفکیک‌شده','سرمایه شما جدا نگهداری می‌شود'],
          ['<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5"/>',
           'سابقه قابل تأیید','عملکرد واقعی، بدون دستکاری'],
          ['<circle cx="12" cy="12" r="10" stroke-width="1.5"/><path d="M12 8v4l3 3" stroke-width="1.5" stroke-linecap="round"/>',
           'ردیابی لحظه‌ای','داشبورد زنده در هر لحظه'],
          ['<path d="M12 2v20M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6" stroke-width="1.5" stroke-linecap="round"/>',
           'برداشت آزاد','بدون قفل سرمایه'],
        ] : [
          ['<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke-width="1.5"/>',
           'Segregated Funds','Your capital held separately'],
          ['<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5"/>',
           'Auditable Track Record','Real performance, no manipulation'],
          ['<circle cx="12" cy="12" r="10" stroke-width="1.5"/><path d="M12 8v4l3 3" stroke-width="1.5" stroke-linecap="round"/>',
           'Real-Time Tracking','Live dashboard at any moment'],
          ['<path d="M12 2v20M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6" stroke-width="1.5" stroke-linecap="round"/>',
           'Free Withdrawal','No capital lock-in'],
        ];
        foreach($trust as $t): ?>
        <div class="pamm-trust-item">
          <div class="pamm-hud-bracket tl" aria-hidden="true"></div>
          <div class="pamm-hud-bracket tr" aria-hidden="true"></div>
          <div class="pamm-hud-bracket bl" aria-hidden="true"></div>
          <div class="pamm-hud-bracket br" aria-hidden="true"></div>

          <div class="pamm-trust-icon">
            <svg viewBox="0 0 24 24" stroke="currentColor" fill="none"><?php echo $t[0]; ?></svg>
          </div>
          <div class="pamm-trust-content">
            <div class="pamm-trust-title"><?php echo esc_html($t[1]); ?></div>
            <div class="pamm-trust-sub"><?php echo esc_html($t[2]); ?></div>
          </div>
        </div>
        <?php endforeach; ?>
      </div>
    </div>

    <!-- ══ RIGHT: Leaderboard table card ══ -->
    <div class="pamm-table-card pamm-3d-item">
      <div class="pamm-hud-bracket tl" aria-hidden="true"></div>
      <div class="pamm-hud-bracket tr" aria-hidden="true"></div>
      <div class="pamm-hud-bracket bl" aria-hidden="true"></div>
      <div class="pamm-hud-bracket br" aria-hidden="true"></div>

      <div class="pamm-table-glow" aria-hidden="true"></div>

      <div class="pamm-table-bar">
        <div class="pamm-table-title">
          <svg viewBox="0 0 24 24" stroke="currentColor" fill="none" width="14" height="14"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" stroke-width="1.5"/><circle cx="9" cy="7" r="4" stroke-width="1.5"/><path d="M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" stroke-width="1.5"/></svg>
          <?php echo $lang==='fa' ? 'مدیران برتر PAMM' : 'TOP PAMM MANAGERS'; ?>
        </div>
        <div class="pamm-live-badge">
          <span class="pamm-live-dot" aria-hidden="true"></span>
          <?php echo $lang==='fa' ? 'زنده' : 'Live'; ?>
        </div>
      </div>

      <!-- Column headers -->
      <div class="pamm-thead">
        <span class="pamm-th"><?php echo $lang==='fa' ? 'مدیر صندوق' : 'Manager'; ?></span>
        <span class="pamm-th"><?php echo $lang==='fa' ? 'بازده' : 'Return'; ?></span>
        <span class="pamm-th"><?php echo $lang==='fa' ? 'افت سرمایه' : 'DD'; ?></span>
        <span class="pamm-th"><?php echo $lang==='fa' ? 'نمودار بازده' : 'Equity'; ?></span>
      </div>

      <!-- Rows — data updated by JS -->
      <div class="pamm-tbody" id="pamm-tbody">
        <?php
        $managers = [
          ['AlphaFX Pro',      '#0041', 184.3, 12.4, [60,68,55,72,80,75,90,88,95,100]],
          ['Meridian Capital', '#0088',  97.6, 18.1, [40,35,50,45,60,55,65,60,72,75]],
          ['Quantum Edge',     '#0112',  61.2,  9.8, [30,38,35,45,42,50,48,55,52,60]],
          ['DeltaSwing FX',    '#0059', 312.8, 29.3, [20,40,30,60,50,80,70,90,85,100]],
        ];
        foreach($managers as $i=>$m): ?>
        <div class="pamm-row" data-base-return="<?php echo $m[2]; ?>" data-base-dd="<?php echo $m[3]; ?>">
          <div class="pamm-manager-cell">
            <div class="pamm-rank-hex"><span><?php echo $i+1; ?></span></div>
            <div class="pamm-manager-info">
              <div class="pamm-manager-name"><?php echo esc_html($m[0]); ?></div>
              <div class="pamm-manager-id"><?php echo esc_html($m[1]); ?></div>
            </div>
          </div>
          <div class="pamm-return up" data-return="<?php echo $m[2]; ?>">
            +<?php echo number_format($m[2],1); ?>%
          </div>
          <div class="pamm-dd" data-dd="<?php echo $m[3]; ?>">
            <?php echo number_format($m[3],1); ?>%
          </div>
          <div class="pamm-spark-cell">
            <canvas class="pamm-spark" id="pamm-spark-<?php echo $i; ?>" data-points="<?php echo implode(',',$m[4]); ?>"></canvas>
          </div>
        </div>
        <?php endforeach; ?>
      </div>

      <!-- Footer stats -->
      <div class="pamm-table-footer">
        <div class="pamm-footer-stat">
          <div class="pamm-footer-val" id="pamm-avg-return">+163.5%</div>
          <div class="pamm-footer-label"><?php echo $lang==='fa' ? 'میانگین بازده' : 'Avg Return'; ?></div>
        </div>
        <div class="pamm-footer-stat">
          <div class="pamm-footer-val" style="color:#fff">4</div>
          <div class="pamm-footer-label"><?php echo $lang==='fa' ? 'مدیران تأییدشده' : 'Verified Mgrs'; ?></div>
        </div>
        <div class="pamm-footer-stat">
          <div class="pamm-footer-val" id="pamm-avg-dd">17.4%</div>
          <div class="pamm-footer-label"><?php echo $lang==='fa' ? 'میانگین افت' : 'Avg DD'; ?></div>
        </div>
      </div>
    </div>

  </div>

  <!-- ══ BOTTOM PROMO CAPULES GRID (Inspired by reference layout) ══ -->
  <div class="pamm-footer-promo-grid">
    <!-- Promo Card 1: Referral Code -->
    <div class="pamm-promo-card pamm-3d-item">
      <div class="pamm-hud-bracket tl" aria-hidden="true"></div>
      <div class="pamm-hud-bracket tr" aria-hidden="true"></div>
      <div class="pamm-hud-bracket bl" aria-hidden="true"></div>
      <div class="pamm-hud-bracket br" aria-hidden="true"></div>
      <div class="pamm-promo-card-glow" aria-hidden="true"></div>
      
      <div class="pamm-promo-content">
        <strong><?php echo $lang==='fa' ? 'کد استراتژی اشتراکی' : 'Copy Strategy Invite Code'; ?></strong>
        <p><?php echo $lang==='fa' ? 'برای جذب سرمایه و دریافت سود معاملاتی مستقیم از این شناسه استفاده کنید.' : 'Share your allocation node with other investors using this verification code.'; ?></p>
      </div>
      <div class="pamm-promo-action">
        <div class="pamm-coupon-box" id="pamm-copy-referral-btn">
          <span>STB_PAMM_2026</span>
          <svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
        </div>
      </div>
    </div>

    <!-- Promo Card 2: Live Audit Document -->
    <div class="pamm-promo-card pamm-3d-item">
      <div class="pamm-hud-bracket tl" aria-hidden="true"></div>
      <div class="pamm-hud-bracket tr" aria-hidden="true"></div>
      <div class="pamm-hud-bracket bl" aria-hidden="true"></div>
      <div class="pamm-hud-bracket br" aria-hidden="true"></div>
      <div class="pamm-promo-card-glow" aria-hidden="true"></div>

      <div class="pamm-promo-content">
        <strong><?php echo $lang==='fa' ? 'تأییدیه و حسابرسی زنده' : 'Verified Auditor Certification'; ?></strong>
        <p><?php echo $lang==='fa' ? 'تمامی عملکردهای معاملاتی مدیران با سابقه واقعی و بدون دخل و تصرف ثبت شده است.' : 'Track records, historical drawdowns, and transaction logs are fully audited.'; ?></p>
      </div>
      <div class="pamm-promo-action">
        <a href="<?php echo esc_html($register_label_url); ?>" class="pamm-promo-btn-glow">
          <?php echo $lang==='fa' ? 'مشاهده سند حسابرسی' : 'View Audit Logs'; ?>
          <svg width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path d="M14 5l7 7m0 0l-7 7m7-7H3" stroke-width="2" stroke-linecap="round"/></svg>
        </a>
      </div>
    </div>
  </div>

</div>

<script>
(function(){
  'use strict';
  
  var prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;

  /* ── Draw sparkline equity curves with filled gradients ── */
  function drawSpark(canvas, points, color) {
    var W = canvas.width  = canvas.offsetWidth  || 80;
    var H = canvas.height = canvas.offsetHeight || 32;
    var ctx = canvas.getContext('2d');
    ctx.clearRect(0,0,W,H);
    if(!points.length) return;
    var min = Math.min.apply(null,points);
    var max = Math.max.apply(null,points);
    var range = max - min || 1;
    var step  = W / (points.length - 1);
    
    // Gradient for line stroke
    var strokeGrad = ctx.createLinearGradient(0,0,W,0);
    strokeGrad.addColorStop(0, color.replace('rgb','rgba').replace(')',',0.3)'));
    strokeGrad.addColorStop(1, color);
    
    // Array of points coordinates
    var coords = [];
    points.forEach(function(v,i){
      var x = i * step;
      var y = H - ((v - min) / range) * (H - 6) - 3;
      coords.push({x: x, y: y});
    });
    
    // Stroke the path
    ctx.beginPath();
    coords.forEach(function(p, i){
      i === 0 ? ctx.moveTo(p.x, p.y) : ctx.lineTo(p.x, p.y);
    });
    ctx.strokeStyle = strokeGrad;
    ctx.lineWidth = 2.2;
    ctx.lineJoin = 'round';
    ctx.lineCap = 'round';
    ctx.stroke();
    
    // Fill path under the curve
    ctx.lineTo(W, H);
    ctx.lineTo(0, H);
    ctx.closePath();
    
    var fillGrad = ctx.createLinearGradient(0, 0, 0, H);
    fillGrad.addColorStop(0, color.replace('rgb','rgba').replace(')',',0.18)'));
    fillGrad.addColorStop(1, 'rgba(20,224,163,0)');
    ctx.fillStyle = fillGrad;
    ctx.fill();
  }

  function initSparks() {
    document.querySelectorAll('.pamm-spark').forEach(function(c){
      var pts = (c.getAttribute('data-points')||'').split(',').map(Number);
      drawSpark(c, pts, 'rgb(20,224,163)');
    });
  }

  /* ── Animate returns like old site (random drift) ── */
  function rand(min, max){ return Math.random()*(max-min)+min; }

  function updateReturns() {
    var returns = [];
    var dds     = [];

    document.querySelectorAll('.pamm-row').forEach(function(row){
      var retEl = row.querySelector('[data-return]');
      var ddEl  = row.querySelector('[data-dd]');
      if(!retEl||!ddEl) return;

      // Return — drift slightly
      var retVal = parseFloat(retEl.getAttribute('data-return'));
      var change = rand(-0.6, 1.0); // slight upward bias
      retVal = Math.max(1, retVal + change);
      retEl.setAttribute('data-return', retVal.toFixed(1));
      var formatted = (change >= 0 ? '+' : '') + retVal.toFixed(1) + '%';
      if(retEl.textContent !== formatted) {
        retEl.textContent = formatted;
        retEl.className = 'pamm-return ' + (change >= 0 ? 'up' : 'down') + ' flash';
        setTimeout(function(){ retEl.classList.remove('flash'); }, 400);
      }
      returns.push(retVal);

      // DD — minor fluctuation
      var ddVal = parseFloat(ddEl.getAttribute('data-dd'));
      ddVal = Math.max(0.5, ddVal + rand(-0.25, 0.25));
      ddEl.setAttribute('data-dd', ddVal.toFixed(1));
      ddEl.textContent = ddVal.toFixed(1) + '%';
      dds.push(ddVal);
    });

    // Update footer averages
    if(returns.length) {
      var avgR = returns.reduce(function(a,b){return a+b;},0)/returns.length;
      var avgD = dds.reduce(function(a,b){return a+b;},0)/dds.length;
      var avgREl = document.getElementById('pamm-avg-return');
      var avgDEl = document.getElementById('pamm-avg-dd');
      if(avgREl) avgREl.textContent = '+' + avgR.toFixed(1) + '%';
      if(avgDEl) avgDEl.textContent = avgD.toFixed(1) + '%';
    }
  }

  /* ── 3D Parallax Tilt Effect for Cards/Leaderboard/CTA ── */
  function init3DTilt() {
    if (!window.matchMedia('(hover: hover)').matches) return;
    
    var cards = document.querySelectorAll('.pamm-3d-item');
    cards.forEach(function(card) {
      card.addEventListener('mousemove', function(e) {
        var rect = card.getBoundingClientRect();
        var x = e.clientX - rect.left;
        var y = e.clientY - rect.top;
        
        var px = x / rect.width;
        var py = y / rect.height;
        
        var dx = px - 0.5;
        var dy = py - 0.5;
        
        var maxTilt = card.classList.contains('pamm-promo-card') ? 7 : 5;
        var rx = -dy * maxTilt;
        var ry = dx * maxTilt;
        
        card.style.setProperty('--rx', rx + 'deg');
        card.style.setProperty('--ry', ry + 'deg');
        card.style.setProperty('--mx', (px * 100) + '%');
        card.style.setProperty('--my', (py * 100) + '%');
        card.style.setProperty('--tz', '12px');
      });
      
      card.addEventListener('mouseleave', function() {
        card.style.setProperty('--rx', '0deg');
        card.style.setProperty('--ry', '0deg');
        card.style.setProperty('--mx', '50%');
        card.style.setProperty('--my', '50%');
        card.style.setProperty('--tz', '0px');
      });
    });
  }

  /* ── Dynamic Referral Code Copying ── */
  function initCopyReferral() {
    var btn = document.getElementById('pamm-copy-referral-btn');
    if (!btn) return;
    
    btn.addEventListener('click', function(){
      var text = btn.querySelector('span').textContent;
      navigator.clipboard.writeText(text).then(function(){
        var originalText = btn.innerHTML;
        btn.innerHTML = '<span><?php echo $lang==='fa' ? 'کپی شد!' : 'COPIED!'; ?></span>';
        btn.style.borderColor = '#14e0a3';
        btn.style.background = 'rgba(20, 224, 163, 0.15)';
        setTimeout(function(){
          btn.innerHTML = originalText;
          btn.style.borderColor = '';
          btn.style.background = '';
        }, 1500);
      });
    });
  }

  document.addEventListener('DOMContentLoaded', function(){
    initSparks();
    init3DTilt();
    initCopyReferral();
    if(!prefersReduced) setInterval(updateReturns, 2600);
  });
})();
</script>
</section>
