/* ============================================================
   Bioworx — Utility Classes
   Grid layouts, spacing, animations, status badges
   ============================================================ */

/* ── Grid Layout Utility ── */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 1024px) {
  .grid-layout {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Container Widths ── */
.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Text Helpers ── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.15rem; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-bold { font-weight: 700; }
.text-semibold { font-weight: 600; }

/* ── Spacing Helpers ── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ── Flex Helpers ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ── Status Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.badge--success {
  background: #D1FAE5;
  color: #065F46;
}
.badge--warning {
  background: #FEF3C7;
  color: #92400E;
}
.badge--danger {
  background: #FEE2E2;
  color: #991B1B;
}
.badge--info {
  background: #DBEAFE;
  color: #1E40AF;
}

/* ── Loading Spinner ── */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary-light);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Animations ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}
.animate-slide-up {
  animation: slideUp 0.3s ease forwards;
}
.animate-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* ── Hidden / Visible ── */
.hidden { display: none !important; }
.visible { display: block; }
@media (max-width: 640px) {
  .hidden-mobile { display: none !important; }
}
@media (min-width: 641px) {
  .visible-mobile { display: none !important; }
}

/* ── Print Styles ── */
@media print {
  .breadcrumb, .ad-placeholder, .cta-section, .live-data { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
