@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --font-sans: var(--font-cairo);
  --font-mono: var(--font-geist-mono);

  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);

  --color-gold-50: #fbf7e8;
  --color-gold-100: #f5ead0;
  --color-gold-200: #ecd99b;
  --color-gold-300: #e0c263;
  --color-gold-400: #d2ae3d;
  --color-gold-500: #c9a227;
  --color-gold-600: #a98418;
  --color-gold-700: #7a5c00;
  --color-gold-800: #5a4400;
  --color-gold-900: #3d2f00;

  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-muted: var(--sidebar-muted);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);

  --color-success: var(--success);
  --color-success-foreground: var(--success-foreground);
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-info: var(--info);
  --color-info-foreground: var(--info-foreground);

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --background: #faf8f3;
  --foreground: #1f2937;

  --card: #ffffff;
  --card-foreground: #1f2937;

  --popover: #ffffff;
  --popover-foreground: #1f2937;

  --primary: #c9a227;
  --primary-foreground: #ffffff;

  --secondary: #f3efe4;
  --secondary-foreground: #1f2937;

  --muted: #f3efe4;
  --muted-foreground: #6b7280;

  --accent: #f5ead0;
  --accent-foreground: #7a5c00;

  --destructive: #dc2626;
  --destructive-foreground: #ffffff;

  --border: #e7e2d8;
  --input: #e7e2d8;
  --ring: #c9a227;

  --radius: 0.75rem;

  --sidebar: #0f1117;
  --sidebar-foreground: #d6d3cc;
  --sidebar-muted: #8a8578;
  --sidebar-border: #1e2029;
  --sidebar-accent: #1a1d26;
  --sidebar-accent-foreground: #c9a227;

  --success: #15803d;
  --success-foreground: #ffffff;
  --warning: #d97706;
  --warning-foreground: #ffffff;
  --info: #475569;
  --info-foreground: #ffffff;
}

@layer base {
  * {
    @apply border-border;
  }
  html {
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  body {
    @apply bg-background text-foreground;
    font-family: var(--font-cairo), "Cairo", "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
  }

  /* Arabic numeral tabular alignment for financial values */
  .tabular-nums {
    font-variant-numeric: tabular-nums;
  }

  /* Subtle scrollbar */
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: #e0dbd0;
    border-radius: 6px;
    border: 2px solid var(--background);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #c9c3b4;
  }
}

/* Thin divider helpers */
.divider-soft {
  background: linear-gradient(90deg, transparent, #e7e2d8, transparent);
  height: 1px;
}

/* Custom animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-shimmer {
  animation: shimmer 2s infinite;
  background-size: 200% 100%;
}

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