/* =============================================
   GLOBAL STYLES — FR3ON STORE
   ============================================= */

:root {
  --bg:          #080812;
  --bg2:         #0f0f1f;
  --surface:     rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border:      rgba(255, 255, 255, 0.08);
  --border-glow: rgba(168, 85, 247, 0.4);

  --accent:      #a855f7;
  --accent2:     #06b6d4;
  --accent-grad: linear-gradient(135deg, #a855f7, #06b6d4);

  --ff:          #f97316;
  --ff-grad:     linear-gradient(135deg, #f97316, #facc15);
  --pubg:        #3b82f6;
  --pubg-grad:   linear-gradient(135deg, #3b82f6, #06b6d4);

  --success:     #22c55e;
  --danger:      #ef4444;
  --warning:     #f59e0b;

  --text:        #f1f5f9;
  --text-muted:  #94a3b8;
  --text-dim:    #64748b;

  --radius:      16px;
  --radius-sm:   10px;
  --radius-lg:   24px;
  --shadow:      0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(168, 85, 247, 0.2);

  --transition:  0.25s ease;
  --font:        'Segoe UI', 'Cairo', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
p { line-height: 1.6; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
}
.btn-primary:hover { opacity: 0.88; box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--accent); }
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }
.btn-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.btn-success:hover { background: rgba(34, 197, 94, 0.25); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Inputs ── */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
  direction: rtl;
}
.input-field::placeholder { color: var(--text-dim); }
.input-field:focus { border-color: var(--accent); background: rgba(168, 85, 247, 0.06); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12); }
select.input-field { cursor: pointer; }
select.input-field option { background: #1e1e3f; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}
.card:hover { border-color: rgba(168, 85, 247, 0.3); box-shadow: var(--shadow-glow); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}
.badge-ff  { background: rgba(249, 115, 22, 0.15); color: var(--ff); border: 1px solid rgba(249,115,22,0.3); }
.badge-pubg { background: rgba(59, 130, 246, 0.15); color: var(--pubg); border: 1px solid rgba(59,130,246,0.3); }
.badge-pending   { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-completed { background: rgba(34,197,94,0.15);  color: var(--success); border: 1px solid rgba(34,197,94,0.3); }

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  animation: toastIn 0.3s ease;
  pointer-events: all;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-info    { background: linear-gradient(135deg, #a855f7, #06b6d4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Loading Spinner ── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 999; gap: 16px;
}
.loading-screen p { color: var(--text-muted); font-size: 14px; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: rgba(8, 8, 18, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  gap: 16px;
}
.navbar-brand {
  font-size: 22px; font-weight: 900;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.navbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Cart Button ── */
.cart-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 18px;
  color: var(--text);
}
.cart-btn:hover { border-color: var(--accent); background: var(--surface-hover); }
#cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: none; align-items: center; justify-content: center;
}

/* ── Modal Overlay ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-overlay.center { align-items: center; }
.modal-box {
  background: #12122a;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.3s ease;
}
.modal-overlay.center .modal-box { border-radius: var(--radius-lg); }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; font-size: 16px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Divider ── */
.divider {
  height: 1px; background: var(--border);
  margin: 16px 0;
}

/* ── Page Layout ── */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .navbar { padding: 10px 16px; }
  .page-container { padding: 16px 12px; }
  .modal-box { padding: 20px 16px; }
}

/* ── FIFA & Social Media Colors ── */
:root {
  --fifa:       #1a56db;
  --fifa-grad:  linear-gradient(135deg, #003f8a, #c8a951);
  --social:     #e1306c;
  --social-grad:linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
}

/* ── Bottom Nav (mobile) ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,24,0.97);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}
@media (max-width: 640px) { .bottom-nav { display: flex; } body { padding-bottom: 72px; } }

.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-dim); text-decoration: none; font-size: 10px; font-weight: 700;
  padding: 6px 12px; border-radius: 10px; transition: var(--transition); background: none; border: none;
  cursor: pointer; font-family: var(--font); position: relative;
}
.bnav-item.active, .bnav-item:hover { color: var(--accent); }
.bnav-item .icon { font-size: 20px; }

/* unread badge on chat */
.bnav-badge {
  position: absolute; top: 2px; right: 8px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 100px; display: none; align-items: center; justify-content: center;
  padding: 0 4px;
}
.bnav-badge.show { display: flex; }

/* ── User balance chip ── */
.balance-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.25);
  color: var(--success); border-radius: 100px; font-size: 12px; font-weight: 700;
  padding: 4px 10px;
}
