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

:root {
  --primary: #1e3a8a;       /* Baladi Navy */
  --primary-hover: #172554;
  --secondary: #059669;     /* Green accent */
  --accent: #d97706;        /* Amber */
  --danger: #dc2626;        /* Red */
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
}

* {
  font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: #1e293b;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Modern Glassmorphism & Shadow */
.glass-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
}

.card-shadow {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.card-hover {
  transition: all 0.2s ease-in-out;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Status Badges */
.badge-active {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-cancelled {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-warning {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-info {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Nav Item Active State */
.nav-item.active {
  background-color: #1e3a8a;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.3);
}
.nav-item.active i {
  color: #ffffff !important;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* Print Stylesheet for Reports */
@media print {
  body {
    background-color: #ffffff;
    color: #000000;
  }
  .no-print, header, aside, #sidebar, .modal, button, .action-buttons {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  th, td {
    border: 1px solid #000 !important;
    padding: 8px !important;
  }
}

/* =========================================================
   Mobile App & PWA Responsive Styling
   ========================================================= */
@media (max-width: 1023px) {
  #sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    z-index: 50;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.35);
    background: #ffffff;
    transition: transform 0.25s ease-in-out;
  }
  #sidebar.hidden {
    display: none !important;
  }
  #sidebar:not(.hidden) {
    display: flex !important;
  }
}

/* Mobile Bottom Navigation Button Active State */
.mobile-nav-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-btn.active {
  color: #1e3a8a !important;
}
.mobile-nav-btn.active i {
  color: #1e3a8a !important;
  transform: translateY(-1px);
}
.mobile-nav-btn.active span {
  font-weight: 900 !important;
  color: #1e3a8a !important;
}

/* Safe area insets for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #mobile-bottom-nav {
    padding-bottom: calc(0.375rem + env(safe-area-inset-bottom));
  }
}

