/*
  ╔══════════════════════════════════╗
  ║   GERBOX — Global Design System  ║
  ╚══════════════════════════════════╝
  Shared tokens, resets, and utilities
  used by index.html, GERBOX.html, challeing.html
*/

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&family=Sora:wght@400;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:       #0a0f1e;
  --bg2:      #0e1628;
  --card:     #111827;
  --bdr:      rgba(255,255,255,0.07);
  --txt:      #f0f4ff;
  --mid:      #9ba3bf;
  --acc:      #6366f1;
  --acc2:     #38bdf8;
  --gold:     #f59e0b;
  --green:    #10b981;
  --red:      #ef4444;
  --glow:     0 0 24px rgba(99,102,241,0.18);
  --c4:       #a78bfa;
  --radius:   16px;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--txt);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.7); }

/* ── Toast Notifications ── */
.gb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--txt);
  padding: 12px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  z-index: 99999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 16px rgba(99,102,241,0.2);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.gb-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.gb-toast.success { border-color: rgba(16,185,129,0.5); }
.gb-toast.error   { border-color: rgba(239,68,68,0.5); }
.gb-toast.warning { border-color: rgba(245,158,11,0.5); }

/* ── Offline Banner ── */
#offlineBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  color: white;
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  z-index: 99998;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#offlineBanner.visible {
  transform: translateY(0);
}
#offlineBanner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Utility Classes ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Responsive helpers ── */
@media (max-width: 480px) {
  body { font-size: 15px; }
}
