/* =====================================================
   الأمن العام - نظام التصميم الأساسي
   Public Security Portal - Core Design System
   ===================================================== */

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

/* =====================================================
   CSS Custom Properties (Design Tokens)
   ===================================================== */
:root {
  /* Primary Colors — Navy Blue theme matching the main page */
  --color-bg-primary:    #05091e;
  --color-bg-secondary:  #0a1435;
  --color-bg-tertiary:   #0d1840;
  --color-bg-card:       #0b1540;
  --color-bg-glass:      rgba(255, 255, 255, 0.03);

  /* Gold Palette */
  --color-gold-primary:  #c9a227;
  --color-gold-light:    #f0cb52;
  --color-gold-dark:     #8a6d0f;
  --color-gold-glow:     rgba(201, 162, 39, 0.25);
  --color-gold-subtle:   rgba(201, 162, 39, 0.08);

  /* Silver/Gray Palette */
  --color-silver:        #8a8aaa;
  --color-silver-light:  #b0b0cc;
  --color-silver-dark:   #555570;
  --color-text-primary:  #e8e8f0;
  --color-text-secondary:#9090b0;
  --color-text-muted:    #55556a;

  /* Accent Colors */
  --color-blue-deep:     #060b22;
  --color-blue-mid:      #111f5c;
  --color-red-alert:     #c0392b;
  --color-green-ok:      #27ae60;
  --color-orange-warn:   #e67e22;

  /* Borders */
  --border-gold:         1px solid rgba(201, 162, 39, 0.3);
  --border-subtle:       1px solid rgba(255, 255, 255, 0.06);
  --border-glass:        1px solid rgba(255, 255, 255, 0.08);

  /* Shadows */
  --shadow-gold:         0 0 20px rgba(201, 162, 39, 0.15), 0 4px 30px rgba(0,0,0,0.5);
  --shadow-card:         0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-nav:          0 4px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow-gold:    0 0 40px rgba(201, 162, 39, 0.3);

  /* Typography */
  --font-arabic:         'Cairo', 'Tajawal', sans-serif;
  --font-display:        'Orbitron', monospace;
  --font-size-xs:        0.75rem;
  --font-size-sm:        0.875rem;
  --font-size-base:      1rem;
  --font-size-md:        1.125rem;
  --font-size-lg:        1.25rem;
  --font-size-xl:        1.5rem;
  --font-size-2xl:       2rem;
  --font-size-3xl:       2.5rem;
  --font-size-4xl:       3.5rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   all 0.15s ease;
  --transition-base:   all 0.3s ease;
  --transition-slow:   all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Scale */
  --z-base:    1;
  --z-dropdown:100;
  --z-sidebar: 200;
  --z-navbar:  300;
  --z-modal:   400;
  --z-toast:   500;

  /* Layout */
  --navbar-height:  72px;
  --sidebar-width:  280px;
  --content-max:    1400px;
}
/* ── Global Page Background Grid Pattern (matching index.html) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(88, 101, 242, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 101, 242, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(650px, 85vw);
  height: min(650px, 85vw);
  background-image: url('../img/emblem.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.045; /* Faint, elegant security watermark */
  pointer-events: none;
  z-index: 999; /* Float as a security watermark overlay */
}
body > * { position: relative; z-index: 1; }

/* =====================================================
   CSS Reset & Base
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  direction: rtl;
}

body {
  font-family: var(--font-arabic);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

input, textarea, [contenteditable], [contenteditable="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-secondary); }
::-webkit-scrollbar-thumb { background: #4b8cdb; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* Selection */
::selection {
  background: var(--color-gold-glow);
  color: var(--color-gold-light);
}

/* Images */
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-arabic); border: none; outline: none; }
input, select, textarea { font-family: var(--font-arabic); outline: none; }
ul, ol { list-style: none; }

/* =====================================================
   Layout Utilities
   ===================================================== */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.page-content {
  padding-top: 102px; /* 62px top bar + 40px sub-nav */
  min-height: 100vh;
}

.page-wrapper {
  padding: var(--space-8) var(--space-6);
  max-width: var(--content-max);
  margin: 0 auto;
}

/* Grid Systems */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-6); }

/* 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); }

/* =====================================================
   Typography
   ===================================================== */
.text-gold        { color: var(--color-gold-primary); }
.text-silver      { color: var(--color-silver); }
.text-muted       { color: var(--color-text-muted); }
.text-center      { text-align: center; }
.text-right       { text-align: right; }
.text-sm          { font-size: var(--font-size-sm); }
.text-lg          { font-size: var(--font-size-lg); }
.text-xl          { font-size: var(--font-size-xl); }
.font-bold        { font-weight: 700; }
.font-black       { font-weight: 900; }

.section-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  position: relative;
}

.section-title .highlight {
  color: var(--color-gold-primary);
  text-shadow: 0 0 20px var(--color-gold-glow);
}

.section-subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

.section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--color-gold-primary), transparent);
}

.section-divider-icon {
  width: 40px;
  height: 40px;
  background: var(--color-gold-subtle);
  border: var(--border-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* =====================================================
   Glass Card Component
   ===================================================== */
.glass-card {
  background: var(--color-bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}

.glass-card:hover {
  border-color: rgba(201, 162, 39, 0.3);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

/* =====================================================
   Button Components
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: var(--transition-base);
  cursor: pointer;
  border: none;
  font-family: var(--font-arabic);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

/* Gold Button */
.btn-gold {
  background: linear-gradient(135deg, var(--color-gold-primary), var(--color-gold-dark));
  color: #000;
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
}
.btn-gold:hover {
  box-shadow: 0 6px 25px rgba(201, 162, 39, 0.5);
  transform: translateY(-2px);
}

/* Outline Gold Button */
.btn-outline-gold {
  background: transparent;
  color: var(--color-gold-primary);
  border: 1px solid var(--color-gold-primary);
}
.btn-outline-gold:hover {
  background: var(--color-gold-subtle);
  box-shadow: 0 0 20px var(--color-gold-glow);
}

/* Ghost Button */
.btn-ghost {
  background: var(--color-bg-glass);
  color: var(--color-text-secondary);
  border: var(--border-subtle);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  color: var(--color-text-primary);
}

/* Danger Button */
.btn-danger {
  background: var(--color-red-alert);
  color: #fff;
}
.btn-danger:hover { background: #e74c3c; box-shadow: 0 4px 15px rgba(192,57,43,0.4); }

/* Success Button */
.btn-success {
  background: var(--color-green-ok);
  color: #fff;
}
.btn-success:hover { background: #2ecc71; box-shadow: 0 4px 15px rgba(39,174,96,0.4); }

/* Sizes */
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--font-size-xs); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--font-size-md); }
.btn-icon { padding: var(--space-3); aspect-ratio: 1; border-radius: var(--radius-md); }

/* =====================================================
   Badge Components
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.badge-gold    { background: var(--color-gold-subtle); color: var(--color-gold-primary); border: 1px solid rgba(201,162,39,0.3); }
.badge-green   { background: rgba(39,174,96,0.1); color: var(--color-green-ok); border: 1px solid rgba(39,174,96,0.3); }
.badge-red     { background: rgba(192,57,43,0.1); color: var(--color-red-alert); border: 1px solid rgba(192,57,43,0.3); }
.badge-blue    { background: rgba(41,128,185,0.1); color: #3498db; border: 1px solid rgba(41,128,185,0.3); }
.badge-silver  { background: rgba(138,138,170,0.1); color: var(--color-silver); border: 1px solid rgba(138,138,170,0.3); }
.badge-orange  { background: rgba(230,126,34,0.1); color: var(--color-orange-warn); border: 1px solid rgba(230,126,34,0.3); }

/* =====================================================
   Form Elements
   ===================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  transition: var(--transition-fast);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-gold-primary);
  background: rgba(201,162,39,0.05);
  box-shadow: 0 0 0 3px var(--color-gold-glow);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-text-muted); }
.form-select option { background: var(--color-bg-card); color: var(--color-text-primary); }

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* =====================================================
   Page Header Component
   ===================================================== */
.page-header {
  padding: var(--space-10) 0 var(--space-8);
  position: relative;
  text-align: center;
  background: linear-gradient(180deg, #060d2e 0%, #0b1840 60%, var(--color-bg-primary) 100%);
  border-bottom: 1px solid rgba(201,162,39,0.12);
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, rgba(201,162,39,0.4) 20%, var(--color-gold-primary) 50%, rgba(201,162,39,0.4) 80%, transparent 100%);
}

.page-header-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(13,27,75,0.5) 0%, transparent 70%);
  pointer-events: none;
}

.page-header-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-gold-subtle);
  border: var(--border-gold);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  color: var(--color-gold-primary);
  font-weight: 600;
  margin-bottom: var(--space-4);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.page-header-title {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.page-header-desc {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* =====================================================
   Table Component
   ===================================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.data-table thead {
  background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg-tertiary));
}

.data-table th {
  padding: var(--space-4) var(--space-5);
  text-align: right;
  font-weight: 700;
  color: var(--color-gold-primary);
  font-size: var(--font-size-xs);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(201,162,39,0.2);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-subtle);
  color: var(--color-text-secondary);
  transition: var(--transition-fast);
}

.data-table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover td {
  background: rgba(201,162,39,0.04);
  color: var(--color-text-primary);
}

.data-table tbody tr:last-child td { border-bottom: none; }

/* =====================================================
   Modal Component
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-card);
  border: var(--border-glass);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition-spring);
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-gold-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
  border: var(--border-subtle);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 1.2rem;
}

.modal-close:hover { background: rgba(192,57,43,0.2); color: var(--color-red-alert); }

.modal-body  { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* =====================================================
   Toast Notifications
   ===================================================== */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-card);
  border-right: 3px solid;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.6;
  transform-origin: right center;
  animation: toastProgress linear forwards;
  animation-duration: var(--toast-duration, 3500ms);
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.toast.success { background: rgba(39,174,96,0.15); border-color: var(--color-green-ok); color: #2ecc71; }
.toast.error   { background: rgba(192,57,43,0.15); border-color: var(--color-red-alert); color: #e74c3c; }
.toast.warning { background: rgba(230,126,34,0.15); border-color: var(--color-orange-warn); color: #f39c12; }
.toast.info    { background: rgba(201,162,39,0.15); border-color: var(--color-gold-primary); color: var(--color-gold-light); }

.toast.removing { animation: toastOut 0.3s ease forwards; }

/* =====================================================
   Loading States
   ===================================================== */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(201,162,39,0.2);
  border-top-color: var(--color-gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* =====================================================
   Empty State
   ===================================================== */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

/* =====================================================
   Utility Classes
   ===================================================== */
.hidden   { display: none !important; }
.visible  { display: block !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.no-select { user-select: none; }
.cursor-pointer { cursor: pointer; }

/* Spacing */
.mt-4  { margin-top: var(--space-4); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.p-4   { padding: var(--space-4); }
.p-6   { padding: var(--space-6); }

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-border, rgba(201,162,39,0.2)), transparent);
  margin: var(--space-6) 0;
}

/* Gold Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glow Text */
.glow-text {
  text-shadow: 0 0 20px var(--color-gold-glow), 0 0 40px rgba(201,162,39,0.2);
}

/* Gold border shimmer line */
.gold-line {
  height: 2px;
  background: linear-gradient(to right, transparent, var(--color-gold-primary), transparent);
  border: none;
  margin: var(--space-6) 0;
}

/* =====================================================
   Animations
   ===================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}

@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(201,162,39,0.2); }
  50%       { box-shadow: 0 0 30px rgba(201,162,39,0.5); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes borderFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Animate on scroll classes */
.animate-fade-up   { animation: fadeInUp 0.6s ease both; }
.animate-fade-in   { animation: fadeIn 0.5s ease both; }
.animate-scale-in  { animation: scaleIn 0.4s ease both; }
.animate-slide-right { animation: slideInRight 0.5s ease both; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* =====================================================
   Responsive Breakpoints
   ===================================================== */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 100%; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .page-header-title { font-size: var(--font-size-2xl); }
  .page-wrapper { padding: var(--space-6) var(--space-4); }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 var(--space-4); }
  .page-header-title { font-size: var(--font-size-xl); }
  .section-title { font-size: var(--font-size-xl); }
  .btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--font-size-base); }
  .modal { margin: var(--space-4); max-width: calc(100% - 2rem); }
}

/* Print styles */
@media print {
  .navbar, .sidebar, .sidebar-overlay, #toast-container { display: none; }
  .page-content { padding-top: 0; }
}

/* FontAwesome Integration and RTL Spacing */
.fa-solid, .fa-regular, .fa-brands, .fa-light, .fa-thin {
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
}

