/* ==========================================================================
   IRCHAD FOR YOU — CSS DESIGN TOKENS
   ملف متغيرات التصميم الأساسية (المصدر الوحيد للحقيقة)
   يُستورد هذا الملف أولاً في كل صفحة من صفحات المنصة
   ========================================================================== */

/* 1. تعريفات الخطوط — Thmanyah Font Family */
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('../../public/fonts/thmanyahseriftext-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('../../public/fonts/thmanyahseriftext-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('../../public/fonts/thmanyahseriftext-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('../../public/fonts/thmanyahseriftext-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('../../public/fonts/thmanyahseriftext-Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('../../public/fonts/thmanyahserifdisplay-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('../../public/fonts/thmanyahserifdisplay-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('../../public/fonts/thmanyahserifdisplay-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('../../public/fonts/thmanyahserifdisplay-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('../../public/fonts/thmanyahserifdisplay-Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('../../public/fonts/thmanyahsans-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('../../public/fonts/thmanyahsans-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('../../public/fonts/thmanyahsans-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

/* 2. CSS Variables — Global Design Tokens */
:root {
  /* ── الألوان المحايدة الأساسية ─────────────────────────────── */
  --bg-color:     oklch(0.98 0.01 60);   /* خلفية كريمية دافئة */
  --ink-color:    oklch(0.18 0.02 280);  /* حبر داكن (بنفسجي/رمادي) */
  --ink-muted:    oklch(0.45 0.02 280);  /* حبر ثانوي خافت */
  --border-color: oklch(0.90 0.01 60);   /* حدود رمادية ناعمة */
  --white:        #ffffff;

  /* ── ألوان المجالات الدلالية الأربعة ──────────────────────── */
  --domain-psych:   oklch(0.55 0.22 300); /* نفسي: بنفسجي ملكي */
  --domain-edu:     oklch(0.78 0.18 85);  /* تربوي: ذهبي دافئ */
  --domain-speech:  oklch(0.65 0.16 230); /* أرطوفوني: أزرق سماوي */
  --domain-family:  oklch(0.55 0.15 140); /* أسري: أخضر عشبي */

  /* ── نظام السمة الافتراضي (Generic — قبل اختيار المجال) ───── */
  --theme-primary:       var(--ink-color);
  --theme-primary-hover: var(--ink-muted);
  --theme-bg-accent:     rgba(44, 36, 59, 0.03);
  --theme-accent-color:  var(--ink-color);

  /* ── الظلال ────────────────────────────────────────────────── */
  --shadow-sm: 0 2px 8px rgba(44, 36, 59, 0.03);
  --shadow-md: 0 10px 30px -10px rgba(44, 36, 59, 0.08);
  --shadow-lg: 0 20px 40px -15px rgba(44, 36, 59, 0.12);

  /* ── الخطوط ────────────────────────────────────────────────── */
  --font-serif:   'Thmanyah Serif Text', serif;    /* نصوص القراءة */
  --font-display: 'Thmanyah Serif Display', serif; /* العناوين الكبيرة */
  --font-sans:    'Thmanyah Sans', sans-serif;     /* واجهة التفاعل */

  /* ── تحسينات الخط ──────────────────────────────────────────── */
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 3. سمات المجالات الديناميكية — يُطبَّق عبر data-theme على <body> أو div */
[data-theme="admin"],
[data-theme="black"] {
  --theme-primary:       #0f172a;               /* أسود فخم / Deep Carbon Black */
  --theme-primary-hover: #1e293b;
  --theme-bg-accent:     rgba(15, 23, 42, 0.06);
  --theme-accent-color:  #0f172a;
}

[data-theme="psychological"] {
  --theme-primary:       var(--domain-psych);
  --theme-primary-hover: oklch(0.48 0.20 300);
  --theme-bg-accent:     rgba(147, 51, 234, 0.05);
  --theme-accent-color:  var(--domain-psych);
}

[data-theme="educational"] {
  --theme-primary:       var(--domain-edu);
  --theme-primary-hover: oklch(0.70 0.16 85);
  --theme-bg-accent:     rgba(217, 119, 6, 0.05);
  --theme-accent-color:  var(--domain-edu);
}

[data-theme="orthophonic"] {
  --theme-primary:       var(--domain-speech);
  --theme-primary-hover: oklch(0.58 0.14 230);
  --theme-bg-accent:     rgba(14, 165, 233, 0.05);
  --theme-accent-color:  var(--domain-speech);
}

[data-theme="family"] {
  --theme-primary:       var(--domain-family);
  --theme-primary-hover: oklch(0.48 0.13 140);
  --theme-bg-accent:     rgba(22, 163, 74, 0.05);
  --theme-accent-color:  var(--domain-family);
}
