/**
 * ==============================================================================
 * Tahniah Design System (TDS) — v1.0
 * منصة «تهنئة» للشهادات والبطاقات الرقمية — card2026.store
 * ==============================================================================
 * نظام تصميم موحد ومؤسسي قابل لإعادة الاستخدام في الواجهة الأمامية ولوحات التحكم
 * ==============================================================================
 */

:root {
  /* --- 1. الهوية اللونية المؤسسية (Brand Color Palette) --- */
  --t-primary: #008A76;        /* أخضر تيل مؤسسي رئيسي */
  --t-primary-hover: #007765;
  --t-primary-dark: #006B5C;   /* تيل غامق للتفاعلات والحالات النشطة */
  --t-primary-light: #E6F3F1;  /* خلفيات التيل الفاتحة */
  --t-primary-glow: rgba(0, 138, 118, 0.16);

  --t-navy: #183B56;           /* كحلي ملكي راقٍ للعناوين والعناصر القيادية */
  --t-navy-hover: #122C42;
  --t-navy-light: #EFF4F8;
  
  --t-dark: #123B3A;           /* تيل ليلي عميق للخلفيات الفاخرة */
  --t-dark-surface: #0c2827;

  /* --- 2. ألوان الأسطح والخلفيات (Surfaces & Backgrounds) --- */
  --t-bg: #F6F8F8;             /* رمادي عاجي ناعم مريح للعين */
  --t-bg-subtle: #EDF2F2;
  --t-surface: #FFFFFF;        /* أبيض ناصع للبطاقات والحاويات */
  --t-surface-elevated: #FFFFFF;

  /* --- 3. ألوان النصوص والقراءة (Typography & Content) --- */
  --t-text: #17252A;           /* أسود فحمي ناعم للقراءة الممتازة */
  --t-text-secondary: #3A4B53; /* رمادي داكن للعناوين الفرعية */
  --t-muted: #68777A;          /* رمادي وسيط للنصوص التوضيحية */
  --t-muted-light: #94A3A8;    /* رمادي فاتح للنصوص الهامشية */
  --t-border: #E2E9E7;         /* حدود ناعمة محايدة */
  --t-border-light: #F0F4F3;
  --t-border-focus: #008A76;

  /* --- 4. اللون الذهبي الفاخر (Accent Gold - غير طاغٍ بل نافر وراقٍ) --- */
  --t-gold: #C9A227;           /* ذهبي ملكي للرموز والشارات الفاخرة */
  --t-gold-hover: #B59020;
  --t-gold-dark: #A8831A;
  --t-gold-light: #FBF4E2;     /* خلفية ذهبية هادئة جداً */
  --t-gold-glow: rgba(201, 162, 39, 0.2);

  /* --- 5. ألوان الحالات الوظيفية (Functional & Feedback) --- */
  --t-success: #16835B;
  --t-success-light: #E7F6F0;
  --t-warning: #B7791F;
  --t-warning-light: #FEF7EC;
  --t-error: #C0392B;
  --t-error-light: #FDF2F1;
  --t-info: #0284C7;
  --t-info-light: #F0F9FF;

  /* --- 6. نظام الحواف الموحد (Border Radii) --- */
  --t-radius-sm: 8px;
  --t-radius-md: 12px;
  --t-radius-lg: 16px;
  --t-radius-xl: 24px;
  --t-radius-full: 9999px;

  /* --- 7. نظام الظلال الهادئة (Calm Elevation Shadows) --- */
  --t-shadow-sm: 0 1px 3px rgba(18, 59, 58, 0.04), 0 1px 2px rgba(18, 59, 58, 0.02);
  --t-shadow-md: 0 4px 16px -2px rgba(18, 59, 58, 0.06), 0 2px 6px -1px rgba(18, 59, 58, 0.03);
  --t-shadow-lg: 0 12px 32px -4px rgba(18, 59, 58, 0.08), 0 4px 12px -2px rgba(18, 59, 58, 0.04);
  --t-shadow-xl: 0 20px 48px -6px rgba(18, 59, 58, 0.12), 0 8px 18px -3px rgba(18, 59, 58, 0.06);

  /* --- 8. التوقيت والحركة الدقيقة (Micro-interactions: 150-300ms) --- */
  --t-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- 9. الترتيب الطبقي (Z-Index Hierarchy) --- */
  --t-z-sticky: 100;
  --t-z-drawer: 200;
  --t-z-modal: 300;
  --t-z-toast: 400;
}

/* دعم مستقبلي للوضع الداكن للمنصة (Platform Dark Theme - مع عزل تصميم الشهادات) */
[data-theme="dark"] {
  --t-bg: #0D1B22;
  --t-bg-subtle: #13242C;
  --t-surface: #172B35;
  --t-surface-elevated: #1D3440;
  --t-text: #EDF4F7;
  --t-text-secondary: #C8D8E0;
  --t-muted: #8FA4AE;
  --t-border: #233C48;
  --t-border-light: #1C333E;
  --t-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --t-shadow-md: 0 6px 18px rgba(0, 0, 0, 0.25);
  --t-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* ==============================================================================
 * عناصر التصميم القابلة لإعادة الاستخدام (Reusable UI Components)
 * ============================================================================== */

/* أزرار النظام */
.t-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  border-radius: var(--t-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-transition-normal);
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
}
.t-btn:active { transform: scale(0.98); }
.t-btn-sm { padding: 8px 16px; font-size: 13.5px; }
.t-btn-md { padding: 11px 22px; font-size: 15px; }
.t-btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--t-radius-lg); }
.t-btn-block { width: 100%; display: flex; }

/* أشكال الأزرار */
.t-btn-primary {
  background: var(--t-primary);
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px var(--t-primary-glow);
}
.t-btn-primary:hover {
  background: var(--t-primary-hover);
  color: #FFFFFF !important;
  box-shadow: 0 6px 20px rgba(0, 138, 118, 0.28);
  transform: translateY(-1px);
}

.t-btn-navy {
  background: var(--t-navy);
  color: #FFFFFF !important;
}
.t-btn-navy:hover {
  background: var(--t-navy-hover);
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.t-btn-gold {
  background: var(--t-gold);
  color: #17252A !important;
  font-weight: 800;
  box-shadow: 0 4px 14px var(--t-gold-glow);
}
.t-btn-gold:hover {
  background: var(--t-gold-hover);
  color: #17252A !important;
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.32);
  transform: translateY(-1px);
}

.t-btn-outline {
  background: transparent;
  border-color: var(--t-border);
  color: var(--t-text) !important;
}
.t-btn-outline:hover {
  background: var(--t-bg);
  border-color: var(--t-muted);
  color: var(--t-navy) !important;
}

.t-btn-outline-primary {
  background: transparent;
  border-color: var(--t-primary);
  color: var(--t-primary) !important;
}
.t-btn-outline-primary:hover {
  background: var(--t-primary-light);
  border-color: var(--t-primary);
}

.t-btn-ghost {
  background: transparent;
  color: var(--t-muted) !important;
}
.t-btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--t-text) !important;
}

/* البطاقات والأسطح */
.t-card {
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg);
  box-shadow: var(--t-shadow-sm);
  transition: all var(--t-transition-smooth);
}
.t-card:hover {
  box-shadow: var(--t-shadow-md);
  border-color: rgba(0, 138, 118, 0.2);
}

/* الشارات والأوسمة */
.t-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--t-radius-full);
  line-height: 1.2;
}
.t-badge-primary { background: var(--t-primary-light); color: var(--t-primary-dark); }
.t-badge-navy { background: var(--t-navy-light); color: var(--t-navy); }
.t-badge-gold { background: var(--t-gold-light); color: var(--t-gold-dark); border: 1px solid rgba(201, 162, 39, 0.25); }
.t-badge-success { background: var(--t-success-light); color: var(--t-success); }

/* حقول الإدخال */
.t-input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--t-text);
  background: var(--t-surface);
  border: 1.5px solid var(--t-border);
  border-radius: var(--t-radius-md);
  padding: 12px 16px;
  outline: none;
  transition: all var(--t-transition-fast);
}
.t-input:focus {
  border-color: var(--t-primary);
  box-shadow: 0 0 0 3px var(--t-primary-glow);
}
