/*
 * RadiSense Design System - Minimal Context-Based Approach
 * Uses pure Bootstrap classes with RadiSense-specific context overrides
 * Focused only on what makes RadiSense unique
 */

/* ========================================
   DESIGN TOKENS (CSS Custom Properties)
   ======================================== */
:root {
  /* RadiSense brand colors - can override Bootstrap if needed */
  --rs-gradient-primary: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);

  /* Typography scale for consistent sizing */
  --rs-font-size-tiny: 0.7rem;

  /* Component sizing defaults */
  --rs-btn-tiny-padding: 0.25rem 0.5rem;
}

/* ========================================
   RADISENSE CARD HEADERS
   ======================================== */
.rs-card-header {
  background: var(--rs-gradient-primary) !important;
}

/* ========================================
   CONTEXT-BASED BUTTON SIZING
   ======================================== */
/* Table operation buttons - tiny and compact */
.rs-table-operations .btn {
  font-size: var(--rs-font-size-tiny);
  padding: var(--rs-btn-tiny-padding);
  white-space: nowrap;
}

/* Card header action buttons - slightly larger but still compact */
.rs-card-actions .btn {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

/* Filter action buttons - standard Bootstrap size */
.rs-filter-actions .btn {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

/* Pagination buttons - tiny for space efficiency */
.rs-pagination-actions .btn {
  font-size: var(--rs-font-size-tiny);
  padding: var(--rs-btn-tiny-padding);
}

/* ========================================
   TEXT SIZE UTILITIES
   ======================================== */
/* Tiny text for timestamps, help text, pagination info */
.rs-text-tiny {
  font-size: var(--rs-font-size-tiny) !important;
}

/* ========================================
   BADGE SIZE UTILITIES
   ======================================== */
/* Tiny badges for table status indicators */
.rs-badge-tiny {
  font-size: var(--rs-font-size-tiny) !important;
}

/* ========================================
   FORM HELP TEXT
   ======================================== */
/* Consistent tiny help text */
.rs-form-help {
  font-size: var(--rs-font-size-tiny);
  color: #6c757d;
  margin-top: 0.25rem;
}

/* ========================================
   MODERN THEME TOKENS & GLOBAL SURFACES
   ======================================== */
:root {
  /* Brand */
  --rs-primary: 3, 102, 214; /* #0366d6 */
  --rs-accent: 99, 102, 241; /* indigo-500 */

  /* Surfaces (light) */
  --rs-bg: #f6f7fb;
  --rs-surface: #ffffff;
  --rs-surface-rgb: 255, 255, 255;
  --rs-text: #0f172a;
  --rs-muted: #64748b;
  --rs-border: rgba(15, 23, 42, 0.08);

  /* Effects */
  --rs-shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.06);
  --rs-shadow-md: 0 10px 15px rgba(2, 6, 23, 0.08);

  /* Radii */
  --rs-radius-sm: 8px;
  --rs-radius-md: 12px;
  --rs-radius-lg: 16px;

  /* Sidebar */
  --rs-sidebar-gradient: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] {
  --rs-bg: #0b1220;
  --rs-surface: #0f172a;
  --rs-surface-rgb: 15, 23, 42;
  --rs-text: #e5e7eb;
  --rs-muted: #9ca3af;
  --rs-border: rgba(255, 255, 255, 0.08);
  --rs-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --rs-shadow-md: 0 10px 15px rgba(0, 0, 0, 0.45);
  --rs-sidebar-gradient: linear-gradient(180deg, #0b1220 0%, #111827 100%);
}

body { background-color: var(--rs-bg); color: var(--rs-text); }

a, .btn-link { color: rgb(var(--rs-primary)); }
.btn-primary {
  background-color: rgb(var(--rs-primary));
  border-color: rgb(var(--rs-primary));
}
.btn-primary:hover {
  background-color: rgba(var(--rs-primary), 0.9);
  border-color: rgba(var(--rs-primary), 0.9);
}

/* Softer borders */
.border, .form-control, .form-select, .dropdown-menu, .modal-content, .table, .card {
  border-color: var(--rs-border) !important;
}

/* Surfaces */
.card, .bg-white.border.rounded {
  background-color: var(--rs-surface) !important;
  border-radius: var(--rs-radius-md);
  box-shadow: var(--rs-shadow-sm);
}

/* Tables */
.table thead th { border-bottom-color: var(--rs-border); font-weight: 600; }
.table tbody tr + tr td { border-top-color: var(--rs-border); }
.table tbody tr:hover { background-color: rgba(var(--rs-primary), 0.03); }

/* Sticky header helper for long lists */
.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--rs-surface);
}

/* Right-aligned action cells */
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .cell-actions .btn { margin-left: 0.25rem; }

/* Forms */
.form-control, .form-select { background-color: var(--rs-surface); border-radius: 10px; }
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--rs-primary), 0.15);
  border-color: rgba(var(--rs-primary), 0.5);
}

/* Chips / Tags - mirrors chat mention chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background-color: color-mix(in srgb, rgb(var(--rs-primary)) 12%, transparent);
  color: rgb(var(--rs-primary));
  border: 1px solid color-mix(in srgb, rgb(var(--rs-primary)) 30%, transparent);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}
.chip i { font-size: 0.85em; margin-right: 0.25rem; }

/* Zebra rows utility (optional) */
.table.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(2, 6, 23, 0.02); }
[data-theme="dark"] .table.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, 0.02); }