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

:root {
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-300: #6ee7b7;
  --primary-400: #34d399;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
}

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

body {
  direction: rtl;
  text-align: right;
  background-color: #f8fafc;
  color: #0f172a;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

html.dark body {
  background-color: #0b0f19;
  color: #f1f5f9;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
html.dark ::-webkit-scrollbar-track {
  background: #111827;
}
::-webkit-scrollbar-thumb {
  background: #10b981;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #059669;
}

/* Hide scrollbar on mobile drawer */
#mobile-drawer-content::-webkit-scrollbar {
  width: 4px;
}
#mobile-drawer-content::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.4);
  border-radius: 4px;
}

/* Animations */
@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(50%, 0, 0); }
}

.animate-ticker {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker 35s linear infinite;
}

.animate-ticker:hover {
  animation-play-state: paused;
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pulse-live {
  animation: pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Glassmorphism & Cards */
.card-financial {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

html.dark .card-financial {
  background-color: #111827;
  border-color: #1f2937;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.card-financial:hover {
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.08), 0 4px 6px -2px rgba(16, 185, 129, 0.04);
}

.card-gold {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}

html.dark .card-gold {
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  border: 1px solid #78350f;
}

/* Tables */
.table-financial {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-financial th {
  background-color: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.85rem 1rem;
  text-align: right;
  border-bottom: 2px solid #cbd5e1;
}

html.dark .table-financial th {
  background-color: #1f2937;
  color: #94a3b8;
  border-bottom: 2px solid #374151;
}

.table-financial td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 0.95rem;
}

html.dark .table-financial td {
  border-bottom: 1px solid #1f2937;
}

.table-financial tr:hover td {
  background-color: #f8fafc;
}

html.dark .table-financial tr:hover td {
  background-color: #1a2234;
}

/* Badges */
.badge-emerald {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

html.dark .badge-emerald {
  background-color: rgba(6, 78, 59, 0.4);
  color: #6ee7b7;
  border-color: #065f46;
}

.badge-gold {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

html.dark .badge-gold {
  background-color: rgba(120, 53, 15, 0.3);
  color: #fcd34d;
  border-color: #92400e;
}

/* Form Controls */
.input-financial {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-financial:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

html.dark .input-financial {
  background-color: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

html.dark .input-financial:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

/* Mobile Bottom Nav Spacer */
.has-bottom-nav {
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .has-bottom-nav {
    padding-bottom: 0;
  }
}
