/**
 * UI/UX Pro Max Design System
 * Data-driven design based on professional research
 * Style: Soft UI Evolution + Minimalism
 */

/* ========================================
   TYPOGRAPHY - Modern Professional
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Open Sans', sans-serif;

  /* SaaS Color System (Research-based) */
  --color-primary: #2563EB;    /* blue-600 - Trust blue */
  --color-secondary: #3B82F6;  /* blue-500 - Lighter blue */
  --color-cta: #F97316;        /* orange-500 - High contrast CTA */
  --color-bg: #F8FAFC;         /* slate-50 - Subtle background */
  --color-text: #1E293B;       /* slate-800 - High contrast text */
  --color-border: #E2E8F0;     /* slate-200 - Subtle borders */

  /* Extended Palette */
  --color-primary-hover: #1d4ed8;  /* blue-700 */
  --color-primary-light: #60a5fa;  /* blue-400 */
  --color-cta-hover: #ea580c;      /* orange-600 */

  /* Semantic Colors */
  --color-success: #10b981;    /* emerald-500 */
  --color-warning: #f59e0b;    /* amber-500 */
  --color-error: #ef4444;      /* red-500 */
  --color-info: #3b82f6;       /* blue-500 */

  /* Chart Colors (20% opacity fills) */
  --color-chart-primary: #0080FF;
  --color-chart-primary-fill: rgba(0, 128, 255, 0.2);

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

  /* Border Radius */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-full: 9999px;

  /* Shadows - Soft UI Evolution */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12);

  /* Transitions (Research: 200-300ms) */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;

  /* Z-Index Scale */
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-modal: 30;
  --z-toast: 40;
  --z-tooltip: 50;
}

/* ========================================
   BASE STYLES
   ======================================== */

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings use Poppins */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   CARD COMPONENTS
   ======================================== */

.card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  padding: 1.5rem; /* 24px - equivalent to p-6 */
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-2px);
}

/* ========================================
   BUTTON COMPONENTS
   ======================================== */

/* Base button styles - apply to all button variants */
.btn,
[class*="btn-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem; /* Space between icon and text */
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-cta {
  background-color: var(--color-cta);
  color: white;
}

.btn-cta:hover {
  background-color: var(--color-cta-hover);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-secondary {
  background-color: white;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg);
  border-color: var(--color-primary);
}

/* ========================================
   BADGE COMPONENTS
   ======================================== */

/* Base badge styles */
.badge,
[class*="badge-"] {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-primary {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.badge-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

.badge-secondary {
  background-color: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

/* ========================================
   TABLE COMPONENTS
   ======================================== */

.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead {
  background-color: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
  background-color: var(--color-bg);
}

.table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
}

/* ========================================
   NAVIGATION COMPONENTS
   ======================================== */

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
  background-color: var(--color-primary);
  color: white;
}

.nav-item svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Text Utilities */
.text-heading { font-family: var(--font-heading); }
.text-body { font-family: var(--font-body); }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Transitions */
.transition-fast { transition: all var(--transition-fast); }
.transition-base { transition: all var(--transition-base); }
.transition-slow { transition: all var(--transition-slow); }

/* Shadows */
.shadow-soft-sm { box-shadow: var(--shadow-sm); }
.shadow-soft-md { box-shadow: var(--shadow-md); }
.shadow-soft-lg { box-shadow: var(--shadow-lg); }

/* Z-Index */
.z-dropdown { z-index: var(--z-dropdown); }
.z-sticky { z-index: var(--z-sticky); }
.z-modal { z-index: var(--z-modal); }
.z-toast { z-index: var(--z-toast); }
.z-tooltip { z-index: var(--z-tooltip); }

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Use Tailwind-style responsive padding */
.responsive-padding {
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .responsive-padding {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .responsive-padding {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
