/**
 * DetectionStatus styles
 * @countermeasure/web-components/security/detection-status
 */

/* ============================================================================
   DETECTION STATUS BASE
   ============================================================================ */
.cmm-detection-status {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ============================================================================
   DETECTION STATUS CONTROLS
   ============================================================================ */
.cmm-detection-status__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cmm-detection-status__search {
  flex: 1;
  min-width: 12rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid hsl(var(--border, 0 0% 90%));
  border-radius: var(--radius-sm, 0.25rem);
  background-color: hsl(var(--background, 0 0% 100%));
  color: hsl(var(--foreground, 0 0% 10%));
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-fast, 150ms);
}

.cmm-detection-status__search:focus {
  border-color: hsl(var(--primary, 220 90% 56%));
  box-shadow: 0 0 0 2px hsl(var(--primary, 220 90% 56%) / 0.2);
}

.cmm-detection-status__filter {
  padding: 0.375rem 0.625rem;
  border: 1px solid hsl(var(--border, 0 0% 90%));
  border-radius: var(--radius-sm, 0.25rem);
  background-color: hsl(var(--background, 0 0% 100%));
  color: hsl(var(--foreground, 0 0% 10%));
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
}

/* ============================================================================
   DETECTION STATUS TABLE
   ============================================================================ */
.cmm-detection-status__table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid hsl(var(--border, 0 0% 90%));
  border-radius: var(--radius, 0.5rem);
  overflow: hidden;
}

.cmm-detection-status__header {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: hsl(var(--muted-foreground, 0 0% 50%));
  background-color: hsl(var(--muted, 0 0% 96%));
  border-bottom: 1px solid hsl(var(--border, 0 0% 90%));
  white-space: nowrap;
  user-select: none;
}

.cmm-detection-status__header--sorted {
  color: hsl(var(--foreground, 0 0% 10%));
}

/* ============================================================================
   DETECTION STATUS ROWS
   ============================================================================ */
.cmm-detection-status__row {
  transition: background-color var(--transition-fast, 150ms);
}

.cmm-detection-status__row:hover {
  background-color: hsl(var(--muted, 0 0% 96%) / 0.5);
}

.cmm-detection-status__row:not(:last-child) .cmm-detection-status__cell {
  border-bottom: 1px solid hsl(var(--border, 0 0% 90%));
}

.cmm-detection-status__cell {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground, 0 0% 10%));
  vertical-align: middle;
}

.cmm-detection-status__empty {
  padding: 2rem;
  text-align: center;
  color: hsl(var(--muted-foreground, 0 0% 50%));
  font-size: 0.875rem;
}

/* ============================================================================
   DETECTION STATUS NAME CELL
   ============================================================================ */
.cmm-detection-status__name {
  display: block;
  font-weight: 500;
  line-height: 1.3;
}

.cmm-detection-status__source {
  display: block;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground, 0 0% 50%));
  line-height: 1.3;
}

/* ============================================================================
   DETECTION STATUS DOT INDICATORS
   ============================================================================ */
.cmm-detection-status__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.375rem;
  flex-shrink: 0;
  vertical-align: middle;
}

.cmm-detection-status__dot--active {
  background-color: hsl(142 71% 45%);
}

.cmm-detection-status__dot--disabled {
  background-color: hsl(var(--muted-foreground, 0 0% 50%));
}

.cmm-detection-status__dot--testing {
  background-color: hsl(38 92% 50%);
}

.cmm-detection-status__dot--error {
  background-color: hsl(0 84% 60%);
}

.cmm-detection-status__status-label {
  font-size: 0.8125rem;
  vertical-align: middle;
}

/* ============================================================================
   DETECTION STATUS SEVERITY BADGES
   ============================================================================ */
.cmm-detection-status__severity {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.4375rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.cmm-detection-status__severity--critical {
  background-color: hsl(0 68% 34%);
  color: hsl(0 0% 100%);
}

.cmm-detection-status__severity--high {
  background-color: hsl(24 84% 34%);
  color: hsl(0 0% 100%);
}

.cmm-detection-status__severity--medium {
  background-color: hsl(38 92% 32%);
  color: hsl(0 0% 100%);
}

.cmm-detection-status__severity--low {
  background-color: hsl(189 78% 30%);
  color: hsl(0 0% 100%);
}

.cmm-detection-status__severity--info {
  background-color: hsl(var(--muted-foreground, 0 0% 50%) / 0.22);
  color: hsl(var(--foreground, 0 0% 10%));
}

/* ============================================================================
   DETECTION STATUS TAGS
   ============================================================================ */
.cmm-detection-status__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.cmm-detection-status__tag {
  display: inline-flex;
  padding: 0 0.25rem;
  border-radius: var(--radius-sm, 0.25rem);
  background-color: hsl(var(--muted, 0 0% 96%));
  font-size: 0.625rem;
  color: hsl(var(--muted-foreground, 0 0% 50%));
}
