/* ============================================================
   PLATFORM.CSS — يعتمد على متغيرات ومكونات style.css الأساسية
   (topbar, wallet-chip, drawer, cat-grid, hero, bottom-nav...)
   وبيضيف مكونات المنصة: الشاشات، السلة، الفورمز، الأدمن
   ============================================================ */

.platform-body{ padding-bottom: calc(var(--nav-h) + 20px); }
.platform-wrap{ padding-top: 4px; }

/* Screens */
.screen{ display:none; animation: fadeIn .25s ease; }
.screen.active{ display:block; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);} }

.screen-title{
  font-size:20px; font-weight:800; color:var(--white);
  margin:16px 0 14px;
}
.section-title.small{ margin-top:22px; font-size:14px; }
.hint-text{ color:var(--muted); font-size:12px; margin-bottom:14px; }
.muted-text{ color:var(--muted); font-size:13px; }
.empty-state{ text-align:center; color:var(--muted); font-size:13px; padding:30px 0; }

/* Home CTA */
.home-cta{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px; }
.cta-card{
  border:1px solid var(--card-border);
  border-radius:var(--radius-md);
  padding:18px 12px;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  text-align:center;
  cursor:pointer;
  color:var(--white);
  font-family:inherit;
}
.cta-topup{ background:linear-gradient(135deg, rgba(123,47,247,0.35), rgba(59,108,255,0.15)); }
.cta-withdraw{ background:linear-gradient(135deg, rgba(255,204,51,0.2), rgba(123,47,247,0.15)); }
.cta-ic{ font-size:26px; }
.cta-title{ font-weight:800; font-size:14px; margin-top:4px; }
.cta-sub{ font-size:11px; color:var(--muted); }

.quick-row{
  display:grid; grid-template-columns:repeat(4,1fr); gap:8px;
  margin-top:14px;
}
.quick-item{
  border:1px solid var(--card-border);
  background:var(--card-bg);
  border-radius:12px;
  padding:10px 4px;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  color:var(--white); font-size:11px; font-weight:700;
  cursor:pointer; font-family:inherit;
}
.quick-item span:first-child{ font-size:18px; }

/* Search + chips */
.search-box{ position:relative; margin-bottom:12px; }
.search-box input{
  width:100%;
  padding:12px 40px 12px 14px;
  border-radius:14px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  color:var(--white);
  font-family:inherit;
  font-size:14px;
  outline:none;
}
.search-ic{ position:absolute; right:14px; top:50%; transform:translateY(-50%); color:var(--muted); }

.chip-row{ display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; margin-bottom:14px; }
.chip{
  flex:none;
  padding:8px 14px;
  border-radius:20px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  color:var(--muted);
  font-size:12px; font-weight:700;
  white-space:nowrap;
  cursor:pointer;
  font-family:inherit;
}
.chip.active{
  background:linear-gradient(135deg, var(--purple), var(--blue));
  color:var(--white);
  border-color:transparent;
}

/* Product grid */
.product-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.product-tile{
  border:1px solid var(--card-border);
  background:var(--card-bg);
  border-radius:var(--radius-md);
  padding:18px 10px;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  cursor:pointer; color:var(--white); font-family:inherit; text-align:center;
}
.product-emoji{ font-size:32px; }
.product-name{ font-weight:700; font-size:13px; }
.product-from{ font-size:11px; color:var(--gold-2); }

/* Lists / rows (orders, deposits, admin) */
.list{ display:flex; flex-direction:column; gap:10px; }
.row{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:14px;
  border-radius:14px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  color:var(--white);
  text-align:right;
  cursor:pointer;
  font-family:inherit;
  width:100%;
}
.admin-row{ cursor:default; flex-wrap:wrap; }
.row-main{ display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
.row-title{ font-weight:700; font-size:13px; }
.row-sub{ font-size:11px; color:var(--muted); }
.row-side{ display:flex; align-items:center; gap:8px; flex-none; }
.admin-actions{ gap:6px; }

.status-badge{
  font-size:10px; font-weight:800; padding:4px 8px; border-radius:8px;
}
.status-pending{ background:rgba(255,204,51,0.15); color:var(--gold-2); }
.status-completed, .status-approved{ background:rgba(80,220,140,0.15); color:#6fe3a3; }
.status-failed, .status-rejected{ background:rgba(255,80,80,0.15); color:#ff8b8b; }

.mini-btn{
  padding:6px 10px;
  border-radius:8px;
  border:1px solid var(--card-border);
  background:rgba(255,255,255,0.04);
  color:var(--white);
  font-size:11px; font-weight:700;
  cursor:pointer;
  font-family:inherit;
}
.mini-btn.ok{ background:rgba(80,220,140,0.15); color:#6fe3a3; border-color:rgba(80,220,140,0.3); }
.mini-btn.warn{ background:rgba(255,80,80,0.15); color:#ff8b8b; border-color:rgba(255,80,80,0.3); }

/* Order detail */
.detail-card{
  border:1px solid var(--card-border);
  background:var(--card-bg);
  border-radius:var(--radius-md);
  padding:6px 16px;
  margin-bottom:16px;
}
.detail-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 0;
  border-bottom:1px solid rgba(255,255,255,0.06);
  font-size:13px;
}
.detail-row:last-child{ border-bottom:none; }
.detail-row span{ color:var(--muted); }
.detail-row b{ color:var(--white); }

/* Buttons */
.btn-primary{
  width:100%;
  padding:14px;
  border-radius:14px;
  border:none;
  background:linear-gradient(135deg, var(--purple), var(--blue));
  color:var(--white);
  font-weight:800;
  font-size:14px;
  font-family:inherit;
  cursor:pointer;
  box-shadow:var(--shadow-glow);
  margin-top:6px;
}
.btn-google{
  width:100%;
  padding:13px;
  border-radius:14px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  color:var(--white);
  font-weight:700;
  font-size:13px;
  font-family:inherit;
  cursor:pointer;
  margin-top:12px;
}

/* Forms */
.pay-form{ display:flex; flex-direction:column; gap:10px; margin-bottom:10px; }
.pay-form label{ font-size:12px; color:var(--muted); font-weight:700; }
.pay-form input{
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  color:var(--white);
  font-family:inherit;
  font-size:14px;
  outline:none;
}
.bank-box{
  border:1px dashed var(--card-border);
  border-radius:12px;
  padding:12px 14px;
  font-size:12px;
  color:var(--muted);
  line-height:1.9;
}
.bank-box strong{ color:var(--gold-2); }

/* Balance card */
.balance-card{
  border-radius:var(--radius-md);
  padding:20px;
  background:linear-gradient(135deg, rgba(123,47,247,0.3), rgba(59,108,255,0.15));
  border:1px solid var(--card-border);
  display:flex; flex-direction:column; align-items:center; gap:6px;
  margin-bottom:20px;
}
.balance-label{ font-size:12px; color:var(--muted); }
.balance-value{ font-size:26px; font-weight:900; color:var(--gold-2); }

/* Profile / account */
.profile-card{
  text-align:center;
  padding:20px 0 10px;
}
.profile-avatar{
  width:76px; height:76px; border-radius:50%; object-fit:cover;
  border:2px solid var(--gold);
  box-shadow:var(--shadow-glow);
  margin-bottom:10px;
}
.profile-card h2{ font-size:17px; }
.tier-badge{
  display:inline-block; margin-top:8px;
  padding:4px 12px; border-radius:14px;
  background:rgba(255,204,51,0.15); color:var(--gold-2);
  font-size:11px; font-weight:800;
}

.tier-progress-box{
  border:1px solid var(--card-border); background:var(--card-bg);
  border-radius:14px; padding:14px; margin:16px 0;
}
.tier-progress-head{ display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-bottom:8px; }
.tier-progress-track{ height:8px; border-radius:6px; background:rgba(255,255,255,0.08); overflow:hidden; }
.tier-progress-fill{ height:100%; background:linear-gradient(90deg, var(--purple), var(--gold)); border-radius:6px; transition:width .3s ease; }

.affiliate-box{
  border:1px solid var(--card-border); background:var(--card-bg);
  border-radius:14px; padding:16px; margin-bottom:16px;
  display:flex; flex-direction:column; gap:10px;
  font-size:12px; color:var(--muted); text-align:center;
}
.affiliate-code-row{ display:flex; align-items:center; justify-content:center; gap:10px; }
.affiliate-code-row code{
  background:rgba(255,255,255,0.06); padding:8px 14px; border-radius:10px;
  color:var(--gold-2); font-weight:800; letter-spacing:1px;
}
.affiliate-code-row button{
  padding:8px 14px; border-radius:10px; border:none;
  background:linear-gradient(135deg, var(--purple), var(--blue));
  color:var(--white); font-weight:700; font-size:12px; cursor:pointer; font-family:inherit;
}

.stat-row{ display:flex; gap:12px; }
.stat-box{
  flex:1; text-align:center; padding:16px 8px;
  border:1px solid var(--card-border); background:var(--card-bg); border-radius:14px;
}
.stat-num{ display:block; font-size:22px; font-weight:900; color:var(--gold-2); }
.stat-label{ font-size:11px; color:var(--muted); }

.menu-row{
  width:100%;
  display:flex; align-items:center; gap:10px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  color:var(--white);
  font-size:13px; font-weight:700;
  margin-bottom:10px;
  cursor:pointer;
  font-family:inherit;
  text-align:right;
}
.menu-row.danger{ color:#ff8b8b; border-color:rgba(255,80,80,0.25); }

/* Admin grid */
.admin-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.admin-tile{
  border:1px solid var(--card-border);
  background:var(--card-bg);
  border-radius:var(--radius-md);
  padding:22px 10px;
  display:flex; flex-direction:column; align-items:center; gap:8px;
  color:var(--white); font-weight:700; font-size:13px;
  cursor:pointer; font-family:inherit;
}
.admin-tile span{ font-size:26px; }

/* Buy sheet modal */
.sheet-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,0.6);
  opacity:0; pointer-events:none; transition:opacity .25s ease;
  z-index:120;
}
.sheet-overlay.show{ opacity:1; pointer-events:auto; }

.buy-sheet{
  position:fixed; left:0; right:0; bottom:0;
  max-width:520px; margin:0 auto;
  background:linear-gradient(180deg, var(--bg-mid), var(--bg-deep));
  border-top:1px solid var(--card-border);
  border-radius:24px 24px 0 0;
  z-index:130;
  transform:translateY(100%);
  transition:transform .3s ease;
  max-height:88vh;
  overflow-y:auto;
  padding:10px 18px 24px;
}
.buy-sheet.open{ transform:translateY(0); }
.sheet-handle{ width:40px; height:4px; background:rgba(255,255,255,0.2); border-radius:4px; margin:6px auto 14px; }

.sheet-head{
  display:flex; align-items:center; gap:12px;
  margin-bottom:16px;
  position:relative;
}
.sheet-head img, .sheet-emoji{
  width:48px; height:48px; border-radius:12px; object-fit:cover;
  border:1px solid var(--card-border);
  display:flex; align-items:center; justify-content:center;
  font-size:26px;
  background:var(--card-bg);
}
.sheet-head h3{ font-size:15px; }
.sheet-balance{ font-size:11px; color:var(--muted); }
.sheet-close{
  position:absolute; left:0; top:0;
  width:32px; height:32px; border-radius:50%;
  background:var(--card-bg); border:1px solid var(--card-border);
  color:var(--white); cursor:pointer;
}

.field-label{ font-size:12px; color:var(--muted); font-weight:700; display:block; margin-bottom:8px; }
.field-group{ margin-bottom:14px; display:flex; flex-direction:column; gap:6px; }
.field-group label{ font-size:12px; color:var(--muted); font-weight:700; }
.field-group input{
  padding:12px 14px; border-radius:12px;
  border:1px solid var(--card-border); background:var(--card-bg);
  color:var(--white); font-family:inherit; font-size:14px; outline:none;
}

.package-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.package-card{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--card-border);
  background:var(--card-bg);
  color:var(--white);
  font-family:inherit; font-size:13px; font-weight:700;
  cursor:pointer;
}
.package-card.active{
  border-color:var(--gold);
  background:linear-gradient(135deg, rgba(123,47,247,0.3), rgba(255,204,51,0.08));
}
.package-card b{ color:var(--gold-2); }

.price-box{
  border:1px solid var(--card-border);
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:14px;
}
.price-row{ display:flex; justify-content:space-between; font-size:13px; padding:4px 0; }
.price-row span{ color:var(--muted); }
.price-row b{ color:var(--gold-2); }

/* Toast */
.toast{
  position:fixed; bottom:calc(var(--nav-h) + 16px); left:50%;
  transform:translateX(-50%) translateY(20px);
  background:rgba(20,11,46,0.95);
  border:1px solid var(--card-border);
  color:var(--white);
  padding:12px 20px;
  border-radius:14px;
  font-size:13px;
  z-index:200;
  opacity:0; pointer-events:none;
  transition:all .25s ease;
  white-space:nowrap;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
