<?php $lang=stb_lang(); ?>
<section class="stb-section stb-platform" id="platform" aria-labelledby="platform-heading">
 <div class="stb-wrap">
  <div class="stb-platform-grid">
   <div>
    <span class="stb-kicker"><?php echo $lang==='fa' ? 'پلتفرم معاملاتی' : 'Trading Platform'; ?></span>
    <h2 class="stb-h2" id="platform-heading"><?php echo $lang==='fa' ? 'MetaTrader 5 — انتخاب حرفه‌ای‌ها' : 'MetaTrader 5 — The Professional Choice'; ?></h2>
    <p class="stb-body" style="margin-top:12px"><?php echo $lang==='fa' ? 'جهان' : 'The world\'s most advanced trading platform — fully integrated with STB\'s institutional infrastructure.'; ?></p>
    <div class="stb-platform-features">
     <?php $feats = $lang==='fa' ? [
      ['۲۱ تایم‌فریم و نمودارهای پیشرفته','۸۰+ اندیکاتور و ابزارهای ترسیم پیشرفته.'],
      ['معاملات الگوریتمی','ساخت و استقرار استراتژی‌های خودکار.'],
      ['عمق بازار','نقدینگی لحظه‌ای و دفتر سفارشات.'],
      ['معامله با یک کلیک','اجرای فوری مستقیم از نمودارها.'],
     ] : [
      ['21 Timeframes &amp; Advanced Charting','80+ indicators and advanced drawing tools.'],
      ['Algorithmic Trading','Build and deploy automated strategies.'],
      ['Market Depth','Real-time liquidity and order book.'],
      ['One-Click Trading','Execute instantly directly from charts.'],
     ];
     foreach($feats as $f): ?>
     <div class="stb-platform-feat">
      <div class="stb-platform-feat-title"><?php echo $f[0]; ?></div>
      <div class="stb-platform-feat-text"><?php echo esc_html($f[1]); ?></div>
     </div>
     <?php endforeach; ?>
    </div>
    <div class="stb-platform-dl">
     <?php $platforms = $lang==='fa'
       ? ['ویندوز','macOS','موبایل','وب‌تریدر']
       : ['Windows','macOS','Mobile','WebTrader']; 
foreach([['Windows','https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe'],['macOS','https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/MetaTrader5.dmg'],['iOS','https://apps.apple.com/app/metatrader-5/id413251709'],['Android','https://play.google.com/store/apps/details?id=net.metaquotes.metatrader5'],['WebTrader','https://trade.mql5.com/trade?servers=STBProvider-Demo,STBProvider-Live&lang=en']] as $d): ?>
      <a href="<?php echo $d[1]; ?>" class="stb-platform-dl-link" target="_blank" rel="noopener" onmouseover="this.style.borderColor='rgba(200,16,46,.3)';this.style.color='#fff'" onmouseout="this.style.borderColor='rgba(255,255,255,.1)';this.style.color='rgba(255,255,255,.7)'"><?php echo $d[0]; ?></a>
      <?php endforeach; ?>

    </div>
   </div>
   <!-- MT5 Preview -->
   <div class="stb-platform-preview" role="img" aria-label="MT5 trading terminal preview">
    <div class="stb-mt-header">
     <span class="stb-mt-title">MTS — STB MARKETS TERMINAL</span>
    </div>
    <div class="stb-mt-rows" role="list">
     <?php $rows=[['EURUSD','H4','1.0847','up'],['XAUUSD','D1','2,318.4','up'],['NAS100','H1','22,918','dn'],['GBPUSD','M15','1.2701','dn']];
     foreach($rows as $r): ?>
     <div class="stb-mt-row" role="listitem">
      <div><div class="stb-mt-sym"><?php echo $r[0]; ?></div><div class="stb-mt-tf"><?php echo $r[1]; ?></div></div>
      <div class="stb-mt-price <?php echo $r[3]==='up'?'stb-green':''; ?>" style="<?php echo $r[3]==='dn'?'color:#ff5a72':''; ?>"><?php echo $r[2]; ?></div>
      <div class="stb-mt-btns">
       <button class="stb-mt-buy"><?php echo $lang==='fa' ? 'خرید' : 'BUY'; ?></button>
       <button class="stb-mt-sell"><?php echo $lang==='fa' ? 'فروش' : 'SELL'; ?></button>
      </div>
     </div>
     <?php endforeach; ?>
    </div>
   </div>
  </div>
 </div>
</section>
