@import "tailwindcss";

/* Scope utilities inside the plugin root so they reliably override WP admin
   selectors without leaking into the rest of wp-admin. */
@variant llar (&:is(#integrum-security-scanner-app, #integrum-security-scanner-app *));

@theme {
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-200: #c7d2fe;
  --color-primary-300: #a5b4fc;
  --color-primary-400: #818cf8;
  --color-primary-500: #6366f1;
  --color-primary-600: #4f46e5;
  --color-primary-700: #4338ca;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;
}

/*
 * Runtime styles for nodes built by assets/js/admin.js.
 *
 * These classes cannot be replaced with Tailwind utilities because the JS
 * references them by name when constructing the results tree, severity
 * badges and scan-progress elements at runtime.
 */

#integrum-security-scanner-app {
  --iss-muted: #64748b;
  --iss-danger: #dc2626;
  --iss-tree-hover: #f8fafc;
}

/* Spinner on the Start button while the manifest is being built server-side
   and the page has not yet reloaded with the active job. */
.integrum-security-scanner .iss-scan-actions__start.is-loading {
  position: relative;
}
.integrum-security-scanner .iss-scan-actions__start.is-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: iss-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes iss-spin {
  to { transform: rotate(360deg); }
}

/* Results tree ----------------------------------------------------------- */
.integrum-security-scanner .iss-tree {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: 0;
}

.integrum-security-scanner .iss-tree__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
}

.integrum-security-scanner .iss-tree__list.is-root {
  padding-left: 0;
}

.integrum-security-scanner .iss-tree__folder {
  margin: 2px 0;
}

.integrum-security-scanner .iss-tree__toggle {
  color: var(--iss-muted);
  cursor: pointer;
  display: inline-block;
  text-align: center;
  width: 14px;
}

.integrum-security-scanner .iss-tree__folder-name {
  color: #1e293b;
  font-weight: 600;
}

.integrum-security-scanner .iss-tree__folder-name.has-problems {
  color: var(--iss-danger);
}

.integrum-security-scanner .iss-tree__file {
  border-radius: 6px;
  margin: 1px 0 1px 14px;
  padding: 5px 8px;
  transition: background-color .15s ease;
}

.integrum-security-scanner .iss-tree__file:hover {
  background: var(--iss-tree-hover);
}

.integrum-security-scanner .iss-tree__file-name {
  color: #334155;
  margin-right: 8px;
}

.integrum-security-scanner .iss-tree__threat {
  color: var(--iss-muted);
  font-style: normal;
  margin-left: 6px;
}

.integrum-security-scanner .iss-tree__file.is-suspicious {
  background: #fff7ed;
}

.integrum-security-scanner .iss-tree__file.is-infected {
  background: #fef2f2;
  color: #b91c1c;
}

/* Severity badges -------------------------------------------------------- */
.integrum-security-scanner .iss-sev {
  border-radius: 9999px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-left: 6px;
  padding: 2px 8px;
  text-transform: uppercase;
}

.integrum-security-scanner .iss-sev--critical { background: #b91c1c; }
.integrum-security-scanner .iss-sev--high     { background: #dc2626; }
.integrum-security-scanner .iss-sev--medium   { background: #d97706; }
.integrum-security-scanner .iss-sev--low      { background: #0284c7; }
.integrum-security-scanner .iss-sev--info     { background: #64748b; }
