/**
 * Base Styles — Marcil
 * Reset + Body + Typography + Scrollbar
 * Note: Cairo font is loaded via <link> in base templates — not @import
 */

/* ========================================
   RESET
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* الـ form elements مش بتورث الـ font تلقائياً من الـ browser */
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: inherit;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  direction: rtl;
  text-align: right;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-normal);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-light);
}

strong, b {
  font-weight: 600;
}

small {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ========================================
   LISTS
   ======================================== */

ul, ol {
  margin-bottom: var(--space-4);
  padding-right: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ========================================
   UTILITIES
   ======================================== */

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-center {
  text-align: center;
}

.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* ========================================
   SVG ICONS — Heroicons sprite system
   الاستخدام: <svg class="icon icon-md"><use href="#icon-NAME"/></svg>
   ======================================== */

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* أحجام */
.icon-xs  { width: 14px; height: 14px; }
.icon-sm  { width: 16px; height: 16px; }
.icon-md  { width: 20px; height: 20px; }
.icon-lg  { width: 24px; height: 24px; }
.icon-xl  { width: 32px; height: 32px; }

/* ألوان مختصرة */
.icon-muted   { color: var(--color-text-muted); }
.icon-primary { color: var(--color-primary); }
.icon-accent  { color: var(--color-accent); }
.icon-inverse { color: var(--color-text-inverse); }

/* ========================================
   SWEETALERT2 — reset fix
   ======================================== */

.swal2-container * {
  box-sizing: border-box;
}

.swal2-popup {
  font-family: 'Cairo', sans-serif !important;
  direction: rtl;
  text-align: center;
}

.swal2-title {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.5rem !important;
  padding: 1rem 1rem 0 !important;
}

.swal2-html-container {
  font-size: 0.9375rem !important;
  margin: 0.5rem 1.5rem !important;
  color: #4a5568 !important;
}

.swal2-actions {
  gap: 0.75rem !important;
  margin-top: 1.25rem !important;
  padding: 0 1rem 1rem !important;
}

.swal2-confirm,
.swal2-cancel {
  padding: 0.6rem 1.5rem !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  font-family: 'Cairo', sans-serif !important;
}

.swal2-icon {
  margin: 1.5rem auto 0.5rem !important;
}
