/* ================================================================
   LevelUp FiveM — Main CSS
   Variables · Reset · Typography · Components · Utilities
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-0: #040710;
  --bg-1: #080B14;
  --bg-2: #0C1120;
  --bg-3: #101626;
  --bg-4: #16203A;
  --bg-5: #1C2A48;

  /* Borders */
  --b1: #0E1830;
  --b2: #172440;
  --b3: #1F3055;
  --b4: #274070;

  /* Blues */
  --blue-900: #1E3A8A;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-400: #60A5FA;
  --blue-300: #93C5FD;
  --blue-glow-sm:  rgba(37, 99, 235, 0.15);
  --blue-glow-md:  rgba(37, 99, 235, 0.28);
  --blue-glow-lg:  rgba(37, 99, 235, 0.45);

  /* Text */
  --t1: #F0F4FF;
  --t2: #C8D5F0;
  --t3: #8A9BBF;
  --t4: #5A6A8A;
  --t5: #3A4A6A;

  /* Status */
  --s-pending-bg:   rgba(245,158, 11,0.10); --s-pending-fg: #FCD34D; --s-pending-br: rgba(245,158, 11,0.25);
  --s-review-bg:    rgba( 59,130,246,0.10); --s-review-fg:  #93C5FD; --s-review-br:  rgba( 59,130,246,0.25);
  --s-interview-bg: rgba(249,115, 22,0.10); --s-interview-fg:#FDBA74;--s-interview-br:rgba(249,115, 22,0.25);
  --s-approved-bg:  rgba( 16,185,129,0.10); --s-approved-fg:#6EE7B7; --s-approved-br: rgba( 16,185,129,0.25);
  --s-rejected-bg:  rgba(239, 68, 68,0.10); --s-rejected-fg:#FCA5A5; --s-rejected-br: rgba(239, 68, 68,0.25);

  /* Role colors */
  --r-dev-bg:  rgba(249,115, 22,0.12); --r-dev-fg: #FDBA74; --r-dev-br: rgba(249,115, 22,0.30);
  --r-own-bg:  rgba(245,158, 11,0.12); --r-own-fg: #FCD34D; --r-own-br: rgba(245,158, 11,0.30);
  --r-mgm-bg:  rgba( 59,130,246,0.12); --r-mgm-fg: #93C5FD; --r-mgm-br: rgba( 59,130,246,0.30);
  --r-adm-bg:  rgba( 16,185,129,0.12); --r-adm-fg: #6EE7B7; --r-adm-br: rgba( 16,185,129,0.30);

  /* Misc */
  --green: #10B981; --green-dim: rgba(16,185,129,0.12);
  --red:   #EF4444; --red-dim:   rgba(239, 68, 68,0.12);
  --amber: #F59E0B; --amber-dim: rgba(245,158, 11,0.12);

  /* Radius */
  --r-xs: 4px; --r-sm: 6px; --r-md: 10px;
  --r-lg: 14px; --r-xl: 20px; --r-full: 9999px;

  /* Shadows */
  --sh-sm:   0 1px 4px  rgba(0,0,0,0.45);
  --sh-md:   0 4px 16px rgba(0,0,0,0.55);
  --sh-lg:   0 8px 32px rgba(0,0,0,0.65);
  --sh-blue: 0 4px 20px rgba(37,99,235,0.22);
  --sh-blue-lg: 0 8px 40px rgba(37,99,235,0.38);

  /* Layout */
  --sidebar-w: 256px;
  --topbar-h:  62px;

  /* Transition */
  --tf: 0.15s ease;
  --tm: 0.25s ease;
  --ts: 0.40s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Heebo', sans-serif;
  background-color: var(--bg-1);
  color: var(--t1);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Dot-grid background texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--b1) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

/* ── Custom Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar            { width: 5px; height: 5px; }
::-webkit-scrollbar-track      { background: var(--bg-2); }
::-webkit-scrollbar-thumb      { background: var(--b4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover{ background: var(--blue-700); }

/* ── Typography ────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--t1); }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p  { color: var(--t2); }
a  { color: var(--blue-400); text-decoration: none; transition: color var(--tf); }
a:hover { color: var(--blue-300); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 9px 20px;
  border-radius: var(--r-md); border: 1px solid transparent;
  font-family: 'Heebo', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--tm); white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background var(--tf);
  pointer-events: none;
}
.btn:hover::before { background: rgba(255,255,255,0.04); }

.btn-primary {
  background: var(--blue-600); color: #fff;
  box-shadow: var(--sh-blue);
}
.btn-primary:hover { background: var(--blue-700); box-shadow: var(--sh-blue-lg); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-4); color: var(--t2);
  border-color: var(--b3);
}
.btn-secondary:hover { background: var(--bg-5); border-color: var(--b4); color: var(--t1); }

.btn-ghost {
  background: transparent; color: var(--t3);
  border-color: var(--b2);
}
.btn-ghost:hover { background: var(--bg-4); border-color: var(--b3); color: var(--t1); }

.btn-danger {
  background: var(--red-dim); color: #FCA5A5;
  border-color: rgba(239,68,68,0.28);
}
.btn-danger:hover { background: rgba(239,68,68,0.22); border-color: rgba(239,68,68,0.45); }

.btn-success {
  background: var(--green-dim); color: #6EE7B7;
  border-color: rgba(16,185,129,0.28);
}
.btn-success:hover { background: rgba(16,185,129,0.22); }

.btn-sm  { padding: 6px 14px; font-size: 0.82rem; border-radius: var(--r-sm); }
.btn-xs  { padding: 4px 10px; font-size: 0.78rem; border-radius: var(--r-xs); }
.btn-lg  { padding: 12px 28px; font-size: 1rem; }
.btn-icon{ padding: 7px; border-radius: var(--r-sm); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-3);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative; overflow: hidden;
  transition: border-color var(--tm), box-shadow var(--tm);
}
.card:hover { border-color: var(--b3); }
.card-accent::before {
  content: ''; position: absolute;
  top: 0; right: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-600), transparent);
}
.card-glow { box-shadow: 0 0 0 1px var(--b2), var(--sh-blue); }

/* ── Status Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 0.76rem; font-weight: 700;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-dot::before { content: ''; display: block; width: 100%; height: 100%; border-radius: 50%; animation: pulse-dot 2s ease infinite; }

.badge-pending   { background: var(--s-pending-bg);   color: var(--s-pending-fg);   border-color: var(--s-pending-br);   }
.badge-review    { background: var(--s-review-bg);    color: var(--s-review-fg);    border-color: var(--s-review-br);    }
.badge-interview { background: var(--s-interview-bg); color: var(--s-interview-fg); border-color: var(--s-interview-br); }
.badge-approved  { background: var(--s-approved-bg);  color: var(--s-approved-fg);  border-color: var(--s-approved-br);  }
.badge-rejected  { background: var(--s-rejected-bg);  color: var(--s-rejected-fg);  border-color: var(--s-rejected-br);  }

/* ── Role Badges ────────────────────────────────────────────── */
.role-badge {
  display: inline-flex; padding: 3px 9px; border-radius: var(--r-full);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.role-developer { background: var(--r-dev-bg); color: var(--r-dev-fg); border-color: var(--r-dev-br); }
.role-owner     { background: var(--r-own-bg); color: var(--r-own-fg); border-color: var(--r-own-br); }
.role-management{ background: var(--r-mgm-bg); color: var(--r-mgm-fg); border-color: var(--r-mgm-br); }
.role-admin     { background: var(--r-adm-bg); color: var(--r-adm-fg); border-color: var(--r-adm-br); }

/* ── Form Inputs ────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.86rem; font-weight: 600; color: var(--t2); }
.form-hint  { font-size: 0.78rem; color: var(--t4); }

.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg-4); border: 1px solid var(--b2);
  border-radius: var(--r-md); color: var(--t1);
  font-family: 'Heebo', sans-serif; font-size: 0.92rem;
  padding: 10px 14px; outline: none; direction: rtl;
  transition: border-color var(--tf), box-shadow var(--tf);
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px var(--blue-glow-sm);
}
.form-input::placeholder { color: var(--t4); }
.form-select { cursor: pointer; }
.form-textarea { resize: vertical; min-height: 96px; }
.form-input.error, .form-select.error, .form-textarea.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--b2); }
table      { width: 100%; border-collapse: collapse; }
thead      { background: var(--bg-2); }
thead th   {
  padding: 11px 16px; text-align: right;
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--t4); border-bottom: 1px solid var(--b2);
  white-space: nowrap; user-select: none;
}
tbody tr   { border-bottom: 1px solid var(--b1); transition: background var(--tf); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-4); }
tbody td   { padding: 13px 16px; font-size: 0.88rem; color: var(--t2); vertical-align: middle; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 11px 16px; border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 0.88rem; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
}
.alert-error   { background: var(--s-rejected-bg);  color: var(--s-rejected-fg);  border-color: var(--s-rejected-br);  }
.alert-success { background: var(--s-approved-bg);  color: var(--s-approved-fg);  border-color: var(--s-approved-br);  }
.alert-info    { background: var(--s-review-bg);    color: var(--s-review-fg);    border-color: var(--s-review-br);    }
.alert-warning { background: var(--s-pending-bg);   color: var(--s-pending-fg);   border-color: var(--s-pending-br);   }

/* ── Divider ────────────────────────────────────────────────── */
.divider       { height: 1px; background: var(--b2); width: 100%; }
.divider-label { display: flex; align-items: center; gap: 12px; color: var(--t4); font-size: 0.8rem; }
.divider-label::before,.divider-label::after { content: ''; flex: 1; height: 1px; background: var(--b2); }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--b3);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-dot{ 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes shimmer  { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes glow-pulse {
  0%,100% { box-shadow: 0 0 8px var(--blue-glow-sm); }
  50%      { box-shadow: 0 0 20px var(--blue-glow-md); }
}

.fade-up  { animation: fadeUp  0.30s ease forwards; }
.fade-in  { animation: fadeIn  0.25s ease forwards; }

/* Stagger for lists */
.stagger > * { opacity: 0; animation: fadeUp 0.3s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.16s; }
.stagger > *:nth-child(5) { animation-delay: 0.20s; }
.stagger > *:nth-child(6) { animation-delay: 0.24s; }

/* ── Flag Indicators ────────────────────────────────────────── */
.flag-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: var(--r-xs);
  font-size: 0.72rem; font-weight: 800;
}
.flag-duplicate   { background: var(--amber-dim); color: var(--amber); }
.flag-blacklisted { background: var(--red-dim);   color: var(--red);   }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 24px; gap: 12px;
  color: var(--t4); text-align: center;
}
.empty-state-icon { font-size: 2.5rem; opacity: 0.4; }
.empty-state h3   { color: var(--t3); font-size: 1rem; }

/* ── Skeleton Loading ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% auto;
  border-radius: var(--r-md);
  animation: shimmer 1.4s linear infinite;
}

/* ── Tooltip ────────────────────────────────────────────────── */
[data-tooltip] { position: relative; cursor: default; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); right: 50%;
  transform: translateX(50%);
  background: var(--bg-5); color: var(--t1);
  font-size: 0.76rem; padding: 5px 9px;
  border-radius: var(--r-sm); white-space: nowrap;
  border: 1px solid var(--b3);
  pointer-events: none; opacity: 0;
  transition: opacity var(--tf);
  z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Modal Overlay ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 7, 16, 0.75);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--bg-3); border: 1px solid var(--b3);
  border-radius: var(--r-xl); padding: 28px; width: 100%;
  max-width: 480px; margin: 16px;
  animation: fadeUp 0.25s ease;
  box-shadow: var(--sh-lg), 0 0 0 1px var(--b2);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-start; margin-top: 22px; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  padding: 6px 12px; border-radius: var(--r-sm);
  font-size: 0.86rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--b2); background: transparent; color: var(--t3);
  transition: all var(--tf);
}
.page-btn:hover   { background: var(--bg-4); border-color: var(--b3); color: var(--t1); }
.page-btn.active  { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.page-btn:disabled{ opacity: 0.3; cursor: not-allowed; }

/* ── Tag / Chip ─────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; background: var(--bg-4);
  border: 1px solid var(--b3); border-radius: var(--r-full);
  font-size: 0.78rem; color: var(--t2);
}

/* ── Utilities ──────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.w-full { width: 100%; }
.text-sm  { font-size: 0.84rem; }
.text-xs  { font-size: 0.76rem; }
.text-muted  { color: var(--t4); }
.text-subtle { color: var(--t3); }
.text-accent { color: var(--blue-400); }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }  .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-0 { padding: 0; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}
