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

:root {
  /* Enhanced Typography System */
  --font-size: 16px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Professional Fintech Color Palette */
  --background: #fafbfc;
  --foreground: #1a202c;
  --card: #ffffff;
  --card-foreground: #1a202c;
  --popover: #ffffff;
  --popover-foreground: #1a202c;
  
  /* Primary Nigerian Fintech Blue - More professional */
  --primary: #0066cc;
  --primary-foreground: #ffffff;
  --primary-50: #e6f2ff;
  --primary-100: #b3d9ff;
  --primary-200: #80c0ff;
  --primary-300: #4da6ff;
  --primary-400: #1a8cff;
  --primary-500: #0066cc;
  --primary-600: #0052a3;
  --primary-700: #003d7a;
  --primary-800: #002952;
  --primary-900: #001429;
  
  /* Growth Green - More sophisticated */
  --secondary: #00875a;
  --secondary-foreground: #ffffff;
  --secondary-50: #e6f7f1;
  --secondary-100: #b3e8d1;
  --secondary-200: #80d9b1;
  --secondary-300: #4dca91;
  --secondary-400: #1abb71;
  --secondary-500: #00875a;
  --secondary-600: #006b48;
  --secondary-700: #004f36;
  --secondary-800: #003324;
  --secondary-900: #001712;
  
  /* Accent Orange - More refined */
  --accent: #ff6b35;
  --accent-foreground: #ffffff;
  --accent-50: #fff0ec;
  --accent-100: #ffd4c4;
  --accent-200: #ffb89c;
  --accent-300: #ff9c74;
  --accent-400: #ff814c;
  --accent-500: #ff6b35;
  --accent-600: #e55a2b;
  --accent-700: #cc4921;
  --accent-800: #b23817;
  --accent-900: #99270d;
  
  /* Neutral palette for better hierarchy */
  --muted: #f7f9fc;
  --muted-foreground: #64748b;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --warning: #f59e0b;
  --warning-foreground: #ffffff;
  --success: #10b981;
  --success-foreground: #ffffff;
  
  /* Enhanced border and surface colors */
  --border: #e2e8f0;
  --input: transparent;
  --input-background: #f8fafc;
  --switch-background: #cbd5e1;
  --ring: #0066cc;
  
  /* Professional shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Chart colors */
  --chart-1: #0066cc;
  --chart-2: #00875a;
  --chart-3: #ff6b35;
  --chart-4: #8b5cf6;
  --chart-5: #f59e0b;
  
  /* Enhanced radius system */
  --radius: 0.75rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-3xl: 1.5rem;
  
  /* Typography weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Sidebar */
  --sidebar: #ffffff;
  --sidebar-foreground: #1a202c;
  --sidebar-primary: #0066cc;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #f7f9fc;
  --sidebar-accent-foreground: #334155;
  --sidebar-border: #e2e8f0;
  --sidebar-ring: #0066cc;
}

.dark {
  /* Professional Dark Mode - Navy base */
  --background: #0f172a;
  --foreground: #f8fafc;
  --card: #1e293b;
  --card-foreground: #f8fafc;
  --popover: #1e293b;
  --popover-foreground: #f8fafc;
  
  /* Adjusted primary for dark mode */
  --primary: #3b82f6;
  --primary-foreground: #ffffff;
  --primary-50: #1e3a8a;
  --primary-100: #1d4ed8;
  --primary-200: #2563eb;
  --primary-300: #3b82f6;
  --primary-400: #60a5fa;
  --primary-500: #93c5fd;
  --primary-600: #bfdbfe;
  --primary-700: #dbeafe;
  --primary-800: #eff6ff;
  --primary-900: #f0f9ff;
  
  /* Enhanced secondary for dark mode */
  --secondary: #10b981;
  --secondary-foreground: #ffffff;
  --secondary-50: #064e3b;
  --secondary-100: #065f46;
  --secondary-200: #047857;
  --secondary-300: #059669;
  --secondary-400: #10b981;
  --secondary-500: #34d399;
  --secondary-600: #6ee7b7;
  --secondary-700: #9df1c7;
  --secondary-800: #c6f6d5;
  --secondary-900: #ecfdf5;
  
  /* Enhanced accent for dark mode */
  --accent: #f97316;
  --accent-foreground: #ffffff;
  --accent-50: #7c2d12;
  --accent-100: #9a3412;
  --accent-200: #c2410c;
  --accent-300: #ea580c;
  --accent-400: #f97316;
  --accent-500: #fb923c;
  --accent-600: #fdba74;
  --accent-700: #fed7aa;
  --accent-800: #ffedd5;
  --accent-900: #fff7ed;
  
  /* Dark mode surface colors */
  --muted: #334155;
  --muted-foreground: #94a3b8;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --warning: #eab308;
  --warning-foreground: #0f172a;
  --success: #22c55e;
  --success-foreground: #ffffff;
  
  /* Dark mode borders and inputs */
  --border: #334155;
  --input: rgba(255, 255, 255, 0.05);
  --input-background: rgba(255, 255, 255, 0.05);
  --switch-background: #475569;
  --ring: #3b82f6;
  
  /* Dark mode shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
  
  /* Dark mode chart colors */
  --chart-1: #3b82f6;
  --chart-2: #10b981;
  --chart-3: #f97316;
  --chart-4: #a855f7;
  --chart-5: #eab308;
  
  /* Dark mode sidebar */
  --sidebar: #0f172a;
  --sidebar-foreground: #f8fafc;
  --sidebar-primary: #3b82f6;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #1e293b;
  --sidebar-accent-foreground: #cbd5e1;
  --sidebar-border: #334155;
  --sidebar-ring: #3b82f6;
}

@theme inline {
  --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-primary-50: var(--primary-50);
  --color-primary-100: var(--primary-100);
  --color-primary-200: var(--primary-200);
  --color-primary-300: var(--primary-300);
  --color-primary-400: var(--primary-400);
  --color-primary-500: var(--primary-500);
  --color-primary-600: var(--primary-600);
  --color-primary-700: var(--primary-700);
  --color-primary-800: var(--primary-800);
  --color-primary-900: var(--primary-900);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary-50: var(--secondary-50);
  --color-secondary-100: var(--secondary-100);
  --color-secondary-200: var(--secondary-200);
  --color-secondary-300: var(--secondary-300);
  --color-secondary-400: var(--secondary-400);
  --color-secondary-500: var(--secondary-500);
  --color-secondary-600: var(--secondary-600);
  --color-secondary-700: var(--secondary-700);
  --color-secondary-800: var(--secondary-800);
  --color-secondary-900: var(--secondary-900);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent-50: var(--accent-50);
  --color-accent-100: var(--accent-100);
  --color-accent-200: var(--accent-200);
  --color-accent-300: var(--accent-300);
  --color-accent-400: var(--accent-400);
  --color-accent-500: var(--accent-500);
  --color-accent-600: var(--accent-600);
  --color-accent-700: var(--accent-700);
  --color-accent-800: var(--accent-800);
  --color-accent-900: var(--accent-900);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-success: var(--success);
  --color-success-foreground: var(--success-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-input-background: var(--input-background);
  --color-switch-background: var(--switch-background);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: var(--radius-sm);
  --radius-md: var(--radius-md);
  --radius-lg: var(--radius-lg);
  --radius-xl: var(--radius-xl);
  --radius-2xl: var(--radius-2xl);
  --radius-3xl: var(--radius-3xl);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground antialiased;
    /* Professional font stack for fintech */
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1, "ss02" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* Enhanced Naira and currency symbol rendering */
  .currency-symbol, 
  .naira-symbol {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "tnum" 1;
    font-variant-numeric: tabular-nums;
    text-rendering: optimizeLegibility;
  }

  /* Professional scrollbars */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: var(--muted);
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--muted-foreground);
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
  }

  /* Selection styling */
  ::selection {
    background: var(--primary);
    color: var(--primary-foreground);
  }

  /* Focus-visible improvements */
  [data-focus-visible-added] {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
  }
}

/**
 * Enhanced professional typography system
 */
@layer base {
  :where(:not(:has([class*=" text-"]), :not(:has([class^="text-"])))) {
    h1 {
      font-size: var(--text-4xl);
      font-weight: var(--font-weight-bold);
      line-height: 1.2;
      letter-spacing: -0.025em;
    }

    h2 {
      font-size: var(--text-3xl);
      font-weight: var(--font-weight-semibold);
      line-height: 1.3;
      letter-spacing: -0.025em;
    }

    h3 {
      font-size: var(--text-2xl);
      font-weight: var(--font-weight-semibold);
      line-height: 1.4;
      letter-spacing: -0.025em;
    }

    h4 {
      font-size: var(--text-xl);
      font-weight: var(--font-weight-medium);
      line-height: 1.4;
    }

    h5 {
      font-size: var(--text-lg);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h6 {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    p {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.6;
      color: var(--muted-foreground);
    }

    label {
      font-size: var(--text-sm);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
      color: var(--foreground);
    }

    button {
      font-size: var(--text-sm);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
      letter-spacing: 0.025em;
    }

    input, textarea, select {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
    }

    small {
      font-size: var(--text-xs);
      font-weight: var(--font-weight-normal);
      line-height: 1.4;
      color: var(--muted-foreground);
    }

    /* Professional data display */
    .text-display-large {
      font-size: var(--text-6xl);
      font-weight: var(--font-weight-extrabold);
      line-height: 1.1;
      letter-spacing: -0.05em;
    }

    .text-display {
      font-size: var(--text-5xl);
      font-weight: var(--font-weight-bold);
      line-height: 1.1;
      letter-spacing: -0.04em;
    }

    .text-headline {
      font-size: var(--text-2xl);
      font-weight: var(--font-weight-semibold);
      line-height: 1.3;
      letter-spacing: -0.025em;
    }

    .text-body-large {
      font-size: var(--text-lg);
      font-weight: var(--font-weight-normal);
      line-height: 1.6;
    }

    .text-body {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.6;
    }

    .text-caption {
      font-size: var(--text-sm);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
      color: var(--muted-foreground);
    }

    .text-label {
      font-size: var(--text-sm);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
      letter-spacing: 0.025em;
    }
  }
}

html {
  font-size: var(--font-size);
}

/* Professional notification animations */
@keyframes slide-in-from-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-out-to-right {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.animate-in {
  animation-fill-mode: both;
}

.slide-in-from-right {
  animation: slide-in-from-right 300ms ease-out;
}

.fade-in {
  animation: fade-in 200ms ease-out;
}

.scale-in {
  animation: scale-in 200ms ease-out;
}

.shimmer {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  background-size: 200px 100%;
}

.duration-300 {
  animation-duration: 300ms;
}

.duration-200 {
  animation-duration: 200ms;
}

/* Professional glass morphism effects */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Professional card hover effects */
.card-hover {
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Professional gradient backgrounds */
.gradient-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
}

.gradient-secondary {
  background: linear-gradient(135deg, var(--secondary-600), var(--secondary-400));
}

.gradient-accent {
  background: linear-gradient(135deg, var(--accent-600), var(--accent-400));
}

/* Professional loading states */
.loading-skeleton {
  background: linear-gradient(90deg, var(--muted), var(--muted-foreground), var(--muted));
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}