/* ============================================
   base.css — الإعدادات الأساسية
   Reset + RTL + Typography + Utilities
   ============================================ */

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

/* ---- Reset — إلغاء كل الـ styles الافتراضية ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- الإعدادات الأساسية للصفحة ---- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* RTL — العربية من اليمين لليسار */
  direction: rtl;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: 1.7;
  color: var(--clr-text);
  background-color: var(--clr-bg);
  /* منع الـ overflow الأفقي */
  overflow-x: hidden;
  /* تحسين الخط على الشاشات */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- الروابط ---- */
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-base);
}

a:hover {
  color: var(--clr-primary);
}

/* ---- الصور ---- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- القوائم ---- */
ul, ol {
  list-style: none;
}

/* ---- الأزرار ---- */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

/* ---- الحقول ---- */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

/* ---- إزالة border من الجداول ---- */
table {
  border-collapse: collapse;
}

/* ============================================
   Typography — أنماط النصوص
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: 1.3;
  color: var(--clr-text);
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl),  3vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  color: var(--clr-text-muted);
  line-height: 1.8;
}

strong {
  font-weight: var(--font-bold);
  color: var(--clr-text);
}

/* ============================================
   Utilities — كلاسات مساعدة
   ============================================ */

/* ---- النص ---- */
.text-primary    { color: var(--clr-primary); }
.text-accent     { color: var(--clr-accent); }
.text-muted      { color: var(--clr-text-muted); }
.text-center     { text-align: center; }
.text-right      { text-align: right; }
.text-left       { text-align: left; }

.font-heading    { font-family: var(--font-heading); }
.font-bold       { font-weight: var(--font-bold); }
.font-semibold   { font-weight: var(--font-semibold); }

/* ---- Gradient Text ---- */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- الإخفاء والإظهار ---- */
.hidden          { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---- Flex Utilities ---- */
.flex            { display: flex; }
.flex-center     { display: flex; align-items: center; justify-content: center; }
.flex-between    { display: flex; align-items: center; justify-content: space-between; }
.flex-col        { display: flex; flex-direction: column; }
.gap-2           { gap: var(--space-2); }
.gap-4           { gap: var(--space-4); }
.gap-6           { gap: var(--space-6); }
.gap-8           { gap: var(--space-8); }

/* ---- Badge / Label ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(13, 158, 110, 0.15);
  border: 1px solid rgba(13, 158, 110, 0.3);
  border-radius: var(--radius-full);
  color: var(--clr-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

/* ---- Section Label (الكلمة الصغيرة فوق العنوان) ---- */
.section-label {
  display: inline-block;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  position: relative;
  padding-right: var(--space-5);
}

.section-label::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* ---- Divider ---- */
.divider {
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  margin: var(--space-4) auto;
}

.divider-right {
  margin: var(--space-4) 0 var(--space-4) auto;
}

/* ---- Scrollbar مخصصة ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #e8f3ef;
}
::-webkit-scrollbar-thumb {
  background: var(--clr-primary-dark);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--clr-primary);
}

/* ---- Selection color ---- */
::selection {
  background: rgba(13, 158, 110, 0.3);
  color: var(--clr-text);
}
