/**
 * AG Grid Shared Theme Overrides
 * Used by: screen.html, chat.html, people.html
 * Extracted from screen.css to avoid duplication across pages.
 */

/* AG Grid Customization */
.ag-theme-alpine {
  --ag-header-background-color: #f9fafb;
  --ag-odd-row-background-color: #fafafa;
  --ag-row-hover-color: #fde8eb;
  --ag-selected-row-background-color: #fde8eb;
  --ag-font-size: 12px;
  --ag-header-height: 40px;
  --ag-row-height: 36px;
  --ag-checkbox-checked-color: #C41230;
  --ag-checkbox-unchecked-color: #d1d5db;
  --ag-checkbox-indeterminate-color: #C41230;
}

/* Fix AG Grid checkbox styling with pure CSS (no icon font dependency) */
.ag-theme-alpine .ag-checkbox-input-wrapper {
  width: 18px;
  height: 18px;
  position: relative;
  cursor: pointer;
  border: 2px solid var(--ag-checkbox-unchecked-color, #d1d5db);
  border-radius: 3px;
  background: #fff;
  transition: all 0.15s ease;
}

.ag-theme-alpine .ag-checkbox-input-wrapper:hover {
  border-color: var(--ag-checkbox-checked-color, #C41230);
}

.ag-theme-alpine .ag-checkbox-input-wrapper input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

/* Checked state - AG Grid uses .ag-checked class on wrapper */
.ag-theme-alpine .ag-checkbox-input-wrapper.ag-checked {
  background: var(--ag-checkbox-checked-color, #C41230);
  border-color: var(--ag-checkbox-checked-color, #C41230);
}

/* Checkmark icon using CSS */
.ag-theme-alpine .ag-checkbox-input-wrapper.ag-checked::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  display: block !important;
}

.ag-theme-alpine .ag-checkbox-input-wrapper input[type="checkbox"]:focus-visible + .ag-checkbox-input-wrapper,
.ag-theme-alpine .ag-checkbox-input-wrapper:focus-within {
  box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.15);
}

/* Hide AG Grid's default icon pseudo-elements (but not our custom ::before) */
.ag-theme-alpine .ag-checkbox-input-wrapper::after {
  display: none !important;
}

.ag-theme-alpine .ag-checkbox-input-wrapper:not(.ag-checked)::before {
  display: none !important;
}

/* Density modes */
.density-compact .ag-theme-alpine {
  --ag-row-height: 28px;
  --ag-font-size: 11px;
}

.density-comfortable .ag-theme-alpine {
  --ag-row-height: 48px;
  --ag-font-size: 13px;
}

/* Header label styling */
.ag-header-cell-label {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Cell styling — conditional formatting with background tints */
.cell-positive {
  color: #047857 !important;
  font-weight: 500;
  background-color: rgba(16, 185, 129, 0.08);
}

.cell-negative {
  color: #b91c1c !important;
  font-weight: 500;
  background-color: rgba(239, 68, 68, 0.08);
}

.cell-company-link {
  color: #C41230;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}

.cell-company-link:hover {
  text-decoration: underline;
}

.cell-muted {
  color: #6b7280;
}

/* Search highlighting */
.search-highlight {
  background: #fef08a;
  padding: 1px 2px;
  border-radius: 2px;
}
