/* 
EPSee Design System
Professional UI overrides and custom components
*/

/* ===== DESIGN TOKENS ===== */
:root {
  /* Typography Scale */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Type Scale (1.25 ratio) */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  
  /* Spacing Scale (8px base) */
  --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 */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  
  /* Border Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 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);
  
  /* Brand Colors */
  --brand-primary: #0066CC;
  --brand-primary-dark: #004C99;
  --brand-primary-light: #3385D6;
  --brand-accent: #00D4AA;
  --brand-accent-dark: #00A885;
  
  /* Semantic Colors */
  --color-success: #10B981;
  --color-success-bg: #ECFDF5;
  --color-warning: #F59E0B;
  --color-warning-bg: #FFFBEB;
  --color-danger: #EF4444;
  --color-danger-bg: #FEF2F2;
  --color-info: #3B82F6;
  --color-info-bg: #EFF6FF;
  
  /* Neutrals */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
}

/* ===== BASE TYPOGRAPHY ===== */
body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

.text-secondary {
  color: var(--gray-600);
  font-size: var(--text-sm);
}

.text-muted {
  color: var(--gray-500);
}

/* ===== CARD SYSTEM ===== */
.card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  background: white;
}

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

.card-header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-5) var(--space-6);
  font-weight: 600;
  font-size: var(--text-lg);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: var(--space-4) var(--space-6);
}

/* Card Variants */
.card-elevated {
  box-shadow: var(--shadow-lg);
  border: none;
}

.card-featured {
  border: 2px solid var(--brand-primary);
  box-shadow: var(--shadow-xl);
  position: relative;
}

.card-featured::before {
  content: "RECOMMENDED";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-primary);
  color: white;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ===== BUTTON SYSTEM ===== */
.btn {
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  transition: all 0.2s ease;
  border: none;
  font-size: var(--text-base);
  line-height: 1.5;
}

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

.btn-primary:hover {
  background: var(--brand-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* ===== BADGE SYSTEM ===== */
.badge {
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

/* ===== ALERT SYSTEM ===== */
.alert {
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background: var(--color-success-bg);
  border-left-color: var(--color-success);
  color: var(--gray-800);
}

.alert-warning {
  background: var(--color-warning-bg);
  border-left-color: var(--color-warning);
  color: var(--gray-800);
}

.alert-danger {
  background: var(--color-danger-bg);
  border-left-color: var(--color-danger);
  color: var(--gray-800);
}

.alert-info {
  background: var(--color-info-bg);
  border-left-color: var(--color-info);
  color: var(--gray-800);
}

/* ===== FORM SYSTEM ===== */
.form-label {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--gray-700);
  font-size: var(--text-sm);
}

.form-control, .form-select {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  outline: none;
}

.form-text {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: var(--space-2);
}

/* ===== TABLE SYSTEM ===== */
.table {
  font-size: var(--text-sm);
}

.table thead th {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-300);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  color: var(--gray-700);
  padding: var(--space-4);
}

.table tbody tr {
  border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

.table tbody td {
  padding: var(--space-4);
  vertical-align: middle;
}

/* ===== NAVBAR SYSTEM ===== */
.navbar {
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) 0;
}

.navbar-brand {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

.nav-link {
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--gray-100);
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--gray-300);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-3);
}

.empty-state-text {
  color: var(--gray-500);
  max-width: 400px;
  margin: 0 auto var(--space-6);
}

/* ===== UTILITY CLASSES ===== */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gray-300), transparent);
  margin: var(--space-12) 0;
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: var(--space-20) 0;
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  
  .card-body {
    padding: var(--space-4);
  }
  
  .btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
  }
}

/* ===== 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 states */
*:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

/* ===== HERO GRADIENTS ===== */
.hero-gradient {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 50%, #003366 100%);
  position: relative;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(0, 212, 170, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero-gradient > * {
  position: relative;
  z-index: 1;
}

/* ===== SPACING UTILITIES ===== */
.py-6 {
  padding-top: var(--space-24) !important;
  padding-bottom: var(--space-24) !important;
}

@media (min-width: 992px) {
  .py-lg-6 {
    padding-top: var(--space-24) !important;
    padding-bottom: var(--space-24) !important;
  }
}

/* ===== FILTER BAR ===== */
.filter-bar {
  gap: var(--space-3);
}

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .form-control,
  .filter-bar .form-select {
    width: 100%;
  }
}

/* ===== TABLE RESPONSIVE UTILS ===== */
@media (max-width: 768px) {
  .table-condensed-sm thead {
    display: none;
  }
  .table-condensed-sm tr {
    display: block;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--space-3);
    padding: var(--space-3) 0;
  }
  .table-condensed-sm td {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border: none;
    font-size: var(--text-sm);
  }
  .table-condensed-sm td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-600);
    margin-right: var(--space-3);
  }
}

/* ===== SECTION DIVIDERS ===== */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gray-300) 20%, var(--gray-300) 80%, transparent);
  border: none;
  margin: var(--space-8) 0;
}

/* Pathway visuals */
.pathway-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.pathway-step { position: relative; }

.pathway-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 50px;
  width: 2px;
  height: calc(100% - 40px);
  background: #dee2e6;
}

/* Skeleton loader */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #e9ecef;
  border-radius: 6px;
}
.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150px;
  height: 100%;
  width: 150px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(300%); }
}

