/* ============================================
   Enterprise Theme for Bootstrap 5.3.8
   Professional UI Design System
   ============================================ */

/* ============================================
   LIGHT THEME (Default) - Professional Enterprise
   ============================================ */
:root,
[data-bs-theme="light"] {
  /* Primary Brand Colors */
  --bs-primary: #1a4d7a;
  --bs-primary-rgb: 26, 77, 122;

  --bs-secondary: #6B7280;
  --bs-secondary-rgb: 107, 114, 128;

  /* Semantic Colors */
  --bs-success: #059669;
  --bs-success-rgb: 5, 150, 105;

  --bs-warning: #D97706;
  --bs-warning-rgb: 217, 119, 6;

  --bs-danger: #DC2626;
  --bs-danger-rgb: 220, 38, 38;

  --bs-info: #0891B2;
  --bs-info-rgb: 8, 145, 178;

  /* Neutral Grays (Light Mode) */
  --bs-gray-50: #F9FAFB;
  --bs-gray-100: #F3F4F6;
  --bs-gray-200: #E5E7EB;
  --bs-gray-300: #D1D5DB;
  --bs-gray-400: #9CA3AF;
  --bs-gray-500: #6B7280;
  --bs-gray-600: #4B5563;
  --bs-gray-700: #374151;
  --bs-gray-800: #1F2937;
  --bs-gray-900: #111827;

  /* Body */
  --bs-body-bg: #FFFFFF;
  --bs-body-color: #1F2937;
  --bs-body-color-rgb: 31, 41, 55;

  /* Borders */
  --bs-border-color: #E5E7EB;
  --bs-border-color-translucent: rgba(0, 0, 0, 0.1);

  /* Surface colors for cards, etc. */
  --bs-secondary-bg: #F9FAFB;
  --bs-tertiary-bg: #F3F4F6;

  /* Component-specific - Less rounded, more professional */
  --bs-border-radius: 0.25rem;      /* 4px - less rounded */
  --bs-border-radius-sm: 0.2rem;    /* 3.2px */
  --bs-border-radius-lg: 0.3rem;    /* 4.8px */
  --bs-border-radius-xl: 0.5rem;    /* 8px */
  --bs-border-radius-xxl: 0.75rem;  /* 12px */

  /* Shadows - Subtle for professional look */
  --bs-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --bs-box-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --bs-box-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);

  /* Link colors */
  --bs-link-color: #1a4d7a;
  --bs-link-hover-color: #133a5c;

  /* Table colors */
  --bs-table-striped-bg: rgba(249, 250, 251, 0.5);
  --bs-table-hover-bg: rgba(243, 244, 246, 0.5);
}

/* ============================================
   DARK THEME - Professional Enterprise
   ============================================ */
[data-bs-theme="dark"] {
  /* Primary Brand Colors (brighter for dark bg) */
  --bs-primary: #3b82f6;
  --bs-primary-rgb: 59, 130, 246;

  --bs-secondary: #9CA3AF;
  --bs-secondary-rgb: 156, 163, 175;

  /* Semantic Colors (adjusted for dark mode) */
  --bs-success: #10b981;
  --bs-success-rgb: 16, 185, 129;

  --bs-warning: #F59E0B;
  --bs-warning-rgb: 245, 158, 11;

  --bs-danger: #EF4444;
  --bs-danger-rgb: 239, 68, 68;

  --bs-info: #06B6D4;
  --bs-info-rgb: 6, 182, 212;

  /* Neutral Grays (Dark Mode - inverted) */
  --bs-gray-50: #111827;
  --bs-gray-100: #1F2937;
  --bs-gray-200: #374151;
  --bs-gray-300: #4B5563;
  --bs-gray-400: #6B7280;
  --bs-gray-500: #9CA3AF;
  --bs-gray-600: #D1D5DB;
  --bs-gray-700: #E5E7EB;
  --bs-gray-800: #F3F4F6;
  --bs-gray-900: #F9FAFB;

  /* Body (Dark) */
  --bs-body-bg: #0F172A;           /* Very dark blue-gray */
  --bs-body-color: #F1F5F9;        /* Off-white text */
  --bs-body-color-rgb: 241, 245, 249;

  /* Borders (Dark) */
  --bs-border-color: #334155;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.1);

  /* Surface colors (Dark) */
  --bs-secondary-bg: #1E293B;      /* Slightly lighter than body */
  --bs-tertiary-bg: #334155;

  /* Shadows (subtle in dark mode) */
  --bs-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --bs-box-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --bs-box-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.4);

  /* Link colors */
  --bs-link-color: #60a5fa;
  --bs-link-hover-color: #93c5fd;

  /* Table colors */
  --bs-table-striped-bg: rgba(30, 41, 59, 0.5);
  --bs-table-hover-bg: rgba(51, 65, 85, 0.5);
}

/* ============================================
   Component Overrides (Apply to both themes)
   ============================================ */

/* Buttons - More compact, professional */
.btn {
  --bs-btn-padding-y: 0.5rem;        /* 8px vertical */
  --bs-btn-padding-x: 1rem;          /* 16px horizontal */
  --bs-btn-font-size: 0.875rem;      /* 14px */
  --bs-btn-border-radius: var(--bs-border-radius);
  --bs-btn-box-shadow: none;         /* Remove default shadow */
}

.btn-sm {
  --bs-btn-padding-y: 0.375rem;      /* 6px vertical */
  --bs-btn-padding-x: 0.75rem;       /* 12px horizontal */
  --bs-btn-font-size: 0.8125rem;     /* 13px */
}

.btn-lg {
  --bs-btn-padding-y: 0.625rem;      /* 10px vertical */
  --bs-btn-padding-x: 1.25rem;       /* 20px horizontal */
  --bs-btn-font-size: 0.9375rem;     /* 15px */
}

/* Cards - Flatter, more compact */
.card {
  --bs-card-border-radius: var(--bs-border-radius);
  --bs-card-spacer-y: 1rem;          /* 16px padding */
  --bs-card-spacer-x: 1rem;
  --bs-card-border-color: var(--bs-border-color);
  --bs-card-box-shadow: var(--bs-box-shadow-sm);
  --bs-card-bg: var(--bs-body-bg);   /* Ensure cards use body background */
  --bs-card-color: var(--bs-body-color); /* Ensure cards use body text color */
}

/* Tables - Professional density */
.table {
  --bs-table-striped-bg: var(--bs-table-striped-bg);
  --bs-table-hover-bg: var(--bs-table-hover-bg);
  --bs-table-cell-padding-y: 0.75rem; /* More compact rows */
  --bs-table-cell-padding-x: 0.75rem;
  font-size: 0.875rem;                /* 14px */
}

.table-sm {
  --bs-table-cell-padding-y: 0.5rem;
  --bs-table-cell-padding-x: 0.5rem;
  font-size: 0.8125rem;               /* 13px */
}

/* Navbar - Darker, more professional */
.navbar {
  --bs-navbar-padding-y: 0.75rem;    /* 12px vertical */
  --bs-navbar-brand-font-size: 1.125rem; /* 18px */
}

/* Make primary navbar darker for professional look */
.navbar.bg-primary {
  --bs-bg-opacity: 1;
  background-color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .navbar.bg-primary {
  background-color: #1E293B !important; /* Darker in dark mode */
}

/* Badges - More subtle */
.badge {
  font-size: 0.75rem;                /* 12px */
  font-weight: 500;
  padding: 0.25rem 0.5rem;
}

/* Forms - Professional styling */
.form-control,
.form-select {
  font-size: 0.875rem;               /* 14px */
  border-radius: var(--bs-border-radius);
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Alerts - Less rounded */
.alert {
  border-radius: var(--bs-border-radius);
}

/* Modals - Less rounded */
.modal-content {
  border-radius: var(--bs-border-radius-lg);
}

/* Dropdowns - Less rounded */
.dropdown-menu {
  border-radius: var(--bs-border-radius);
  font-size: 0.875rem;               /* 14px */
}

/* Breadcrumbs - More subtle */
.breadcrumb {
  font-size: 0.8125rem;              /* 13px */
  margin-bottom: 1.5rem;             /* Add spacing below breadcrumb */
}

/* List groups - Professional spacing */
.list-group-item {
  font-size: 0.875rem;               /* 14px */
  padding: 0.75rem 1rem;
}

/* Progress bars - Theme aware */
.progress {
  height: 0.5rem;                    /* 8px height */
  border-radius: var(--bs-border-radius-sm);
  background-color: var(--bs-border-color); /* Use theme border color */
}

.progress-bar {
  transition: width 0.5s ease;       /* Smooth animation */
}

/* Pagination - More compact */
.pagination {
  font-size: 0.875rem;               /* 14px */
}

/* ============================================
   Typography Adjustments
   ============================================ */

body {
  font-size: 0.875rem;               /* 14px base font - enterprise standard */
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
}

small, .small {
  font-size: 0.75rem;                /* 12px */
}

/* ============================================
   Utility Enhancements
   ============================================ */

/* Text colors that respect theme */
.text-body {
  color: var(--bs-body-color) !important;
}

.text-muted {
  color: var(--bs-secondary) !important;
}

/* Background utilities */
.bg-body {
  background-color: var(--bs-body-bg) !important;
}

.bg-surface {
  background-color: var(--bs-secondary-bg) !important;
}

.bg-light {
  background-color: var(--bs-secondary-bg) !important;
  color: var(--bs-body-color) !important;
}

/* Border utilities */
.border {
  border-color: var(--bs-border-color) !important;
}

/* ============================================
   Smooth Theme Transitions
   ============================================ */

html[data-bs-theme] {
  transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

html[data-bs-theme] * {
  transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

/* Don't transition these elements to avoid jankiness */
a, button, .btn, input, select, textarea, .form-control, .form-select {
  transition: none;
}

a:hover, button:hover, .btn:hover {
  transition: all 0.15s ease-in-out;
}
