/**
 * Nasher Telegram SaaS — Shared Design Tokens (Spec 029 - Arabic UX/UI Refresh)
 * Standardized Design System Tokens for Typography, Colors, Spacing, Touch Targets, and Accessibility
 */

:root {
  /* Typography */
  --font-sans: 'IBM Plex Sans Arabic', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-num: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif;

  /* Touch & Accessibility Standards (WCAG 2.1 AA / FR-005) */
  --touch-target-min: 44px;

  /* Brand Palette (Indigo / Primary) */
  --color-brand-50: #eef2ff;
  --color-brand-100: #e0e7ff;
  --color-brand-200: #c7d2fe;
  --color-brand-500: #6366f1;
  --color-brand-600: #4f46e5;
  --color-brand-700: #4338ca;
  --color-brand-800: #3730a3;
  --color-brand-900: #312e81;
  --color-brand: var(--color-brand-600);

  /* Neutral Slate Palette */
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;

  /* Semantic Feedback Palettes */
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-success-text: #065f46;
  --color-success-primary: #10b981;

  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-warning-text: #92400e;
  --color-warning-primary: #f59e0b;

  --color-danger-bg: #fff1f2;
  --color-danger-border: #fecdd3;
  --color-danger-text: #9f1239;
  --color-danger-primary: #f43f5e;

  --color-info-bg: #f0f9ff;
  --color-info-border: #bae6fd;
  --color-info-text: #075985;
  --color-info-primary: #0284c7;

  /* Spacing Grid (4px baseline) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */

  /* Border Radii */
  --radius-sm: 0.375rem; /* 6px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-2xl: 1.25rem; /* 20px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Global Font Utilities */
body {
  font-family: var(--font-sans);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
}

.font-num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* Minimum Touch Target Enforcement (FR-005) */
.touch-target {
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* SKU Selectable Container (FR-014) */
.sku-selectable {
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
  font-family: var(--font-num);
  direction: ltr;
  display: inline-block;
  padding: 2px 6px;
  background-color: var(--color-slate-100);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-sm);
  color: var(--color-slate-800);
  font-weight: 700;
}

/* Dedicated SKU Copy Button */
.btn-copy-sku {
  min-height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-slate-500);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.btn-copy-sku:hover {
  background-color: var(--color-slate-100);
  color: var(--color-brand-600);
  border-color: var(--color-slate-200);
}

.btn-copy-sku:focus-visible {
  outline: 2px solid var(--color-brand-500);
  outline-offset: 1px;
}

/* Accessible Dialog Styling & Focus Trap Support */
dialog,
[role="dialog"] {
  outline: none;
}

[role="dialog"]:focus-visible {
  outline: 2px solid var(--color-brand-500);
  outline-offset: 2px;
}

/* Plan Badge Refinements (FR-010) */
.plan-badge-container {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  max-width: 100%;
}

.plan-badge-pill {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 160px;
}

@media (max-width: 640px) {
  .plan-badge-pill {
    max-width: 110px;
    font-size: 9px;
  }
}
