/* Base Styles and Utilities */

/* Utilities (replace former inline styles; CSP-friendly — no inline styles).
   `.hidden` must beat component rules that set display (e.g.
   `.modal-overlay { display: flex }`, `.features-layout .mapping-panel`, up to
   specificity 0,2,0) so a `.hidden` element is actually hidden, while STILL
   yielding to an inline `element.style.display` set by JS to reveal it. The
   `:not(#_)` bumps specificity to (1,1,0) — above any class-based rule, below
   inline styles — so both hold without `!important` (which would block JS shows).
   `#_` never matches these elements. */
.hidden:not(#_) {
  display: none;
}
.mw-800 {
  max-width: 800px;
}
.mw-600 {
  max-width: 600px;
}
.mw-16r {
  max-width: 16rem;
}
.mw-32r {
  max-width: 32rem;
}
.minw-140 {
  min-width: 140px;
}

/* Global Font Application */
* {
  font-family: "Inter", sans-serif;
}

/* Global Body Styles */
body {
  background: var(--bg-body);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--gray-600);
}

/* Navigation */
.navbar {
  background-color: var(--bg-white) !important;
}

/* Utility Classes */
.d-none {
  display: none !important;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

/* Height Utilities */

.max-h-200 {
  max-height: 200px !important;
  overflow-y: auto;
}

.max-h-350 {
  max-height: 350px !important;
  overflow-y: auto;
}

.max-h-400 {
  max-height: 400px !important;
  overflow-y: auto;
}

/* Background Utilities */
.bg-light-subtle {
  background-color: var(--bg-light) !important;
}

/* Icon Utilities - Standard 1rem (16px) for most icons */
.icon { width: 1rem; height: 1rem; }
.icon-sm { width: 0.875rem; height: 0.875rem; }
.icon-xs { width: 0.75rem; height: 0.75rem; }
.icon-lg { width: 1.25rem; height: 1.25rem; }
.icon-xl { width: 1.5rem; height: 1.5rem; }
.icon-2xl { width: 2rem; height: 2rem; }
.icon-huge { width: 4rem; height: 4rem; }

/* Utility classes for icon sizing */
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }

/* Other Utilities */
.resize-vertical {
  resize: vertical;
}

.sticky-top {
  position: sticky;
  top: 0;
  z-index: var(--z-index-sticky);
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-blue);
  border-top-color: transparent;
  border-radius: var(--border-radius-pill);
  animation: var(--animation-spin);
  z-index: 100;
}

.btn.loading {
  position: relative;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--border-radius-pill);
  animation: var(--animation-spin);
}

/* Spinner */
.spinner-border {
  width: 2rem;
  height: 2rem;
}

/* Animation Classes */
.slide-down {
  animation: slideDown 0.3s ease-out;
}

/* Navigation Styles */
/* User icon styling for better visibility */
.nav-link .icon {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.nav-link:hover .icon {
  opacity: 1;
}

/* Ensure proper vertical alignment */
.nav-link {
  display: flex;
  align-items: center;
}

/* ============================================
   CSP-safe helpers
   style-src has no 'unsafe-inline', so JS may not emit style="..." in the
   markup it builds. These classes replace the inline styles that used to
   live in innerHTML strings. Sizing that depends on data (grid columns)
   is set through the CSSOM instead (el.style.gridTemplateColumns).
   ============================================ */

.spinner-inline {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  vertical-align: middle;
  animation: spin 1s linear infinite;
}

.svg-spin {
  display: inline;
  animation: spin 1s linear infinite;
}

.empty-note {
  text-align: center;
  color: var(--gray-400);
}

.td-indent {
  padding-left: 2rem;
}
