/* OpenClaw Detector - Static HTML Styles */

:root {
  /* Light mode */
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(230, 25%, 10%);
  --card: hsl(0, 0%, 98%);
  --card-foreground: hsl(230, 25%, 10%);
  --primary: hsl(250, 100%, 60%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(230, 15%, 92%);
  --secondary-foreground: hsl(230, 25%, 15%);
  --muted: hsl(230, 15%, 95%);
  --muted-foreground: hsl(215, 20%, 45%);
  --destructive: hsl(0, 80%, 50%);
  --destructive-foreground: hsl(0, 0%, 100%);
  --border: hsl(230, 15%, 88%);
  --radius: 0.5rem;
}

html.dark {
  --background: hsl(230, 25%, 10%);
  --foreground: hsl(210, 40%, 98%);
  --card: hsl(230, 25%, 13%);
  --card-foreground: hsl(210, 40%, 98%);
  --primary: hsl(250, 100%, 67%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(230, 25%, 18%);
  --secondary-foreground: hsl(210, 40%, 98%);
  --muted: hsl(230, 20%, 22%);
  --muted-foreground: hsl(215, 25%, 63%);
  --destructive: hsl(0, 80%, 58%);
  --destructive-foreground: hsl(0, 0%, 100%);
  --border: hsl(230, 20%, 25%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--card);
  backdrop-filter: blur(8px);
}

.logo {
  height: 3rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-ghost:hover {
  background-color: var(--secondary);
}

.btn-outline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-outline:hover {
  background-color: var(--secondary);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-icon:hover {
  background-color: var(--secondary);
}

/* Icons */
.icon {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

/* Theme toggle icons: moon in light mode (switch to dark), sun in dark mode (switch to light) */
.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

html.dark .sun-icon {
  display: block;
}

html.dark .moon-icon {
  display: none;
}

/* Main Content */
.main-content {
  padding: 2rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--muted-foreground);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: max-content;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: start;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
}

.stat-primary {
  background-color: hsla(250, 100%, 60%, 0.05);
  border: 1px solid hsla(250, 100%, 60%, 0.2);
}

html.dark .stat-primary {
  background-color: hsla(250, 100%, 67%, 0.05);
  border-color: hsla(250, 100%, 67%, 0.2);
}

.stat-destructive {
  background-color: hsla(0, 80%, 50%, 0.1);
  border: 1px solid hsla(0, 80%, 50%, 0.3);
  min-width: 25rem;
}

html.dark .stat-destructive {
  background-color: hsla(0, 80%, 58%, 0.1);
  border-color: hsla(0, 80%, 58%, 0.3);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.stat-primary .stat-icon {
  background-color: hsla(250, 100%, 60%, 0.1);
}

.stat-primary .stat-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--primary);
}

.stat-destructive .stat-icon {
  background-color: hsla(0, 80%, 50%, 0.2);
}

.stat-destructive .stat-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--destructive);
}

.stat-icon.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-primary .stat-value {
  color: var(--primary);
}

.stat-destructive .stat-value {
  color: var(--destructive);
}

.stat-label {
  font-size: 0.875rem;
}

.stat-primary .stat-label {
  color: hsla(250, 100%, 60%, 0.7);
}

.stat-destructive .stat-label {
  color: var(--destructive);
  font-weight: 500;
}

/* Table */
.table-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background-color: var(--secondary);
}

html.dark .data-table thead {
  background-color: hsla(230, 25%, 18%, 0.5);
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--foreground);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.table-row {
  cursor: pointer;
  transition: background-color 0.2s;
}

.table-row:hover {
  background-color: var(--secondary);
}

html.dark .table-row:hover {
  background-color: hsla(230, 25%, 18%, 0.5);
}

.cell-with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.font-medium {
  font-weight: 500;
}

.text-muted {
  color: var(--muted-foreground);
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
  z-index: 40;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background-color: var(--card);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.detail-value {
  font-weight: 500;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  line-height: 1.5;
}

.detail-row-block {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.detail-value-code {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.25rem;
  font-family:
    ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
}

.skill-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  margin: 0.125rem;
  font-size: 0.75rem;
  background-color: var(--secondary);
  border-radius: 0.25rem;
  color: var(--secondary-foreground);
}

/* Drawer footer action (Remediation Guide button) */
.drawer-footer-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-remediation {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-remediation:hover {
  opacity: 0.9;
}

/* Back button (inside drawer) */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-back:hover {
  color: var(--foreground);
}

/* Remediation guide panel */
.remediation-guide {
  margin-top: 0;
}

.remediation-intro {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.remediation-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 1.25rem 0;
}

.remediation-step {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 1rem;
  line-height: 1.6;
  counter-increment: step;
}

.remediation-step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-foreground);
  background-color: var(--primary);
  border-radius: 50%;
}

.remediation-step strong {
  color: var(--foreground);
}

.remediation-step code {
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  background-color: var(--secondary);
  border-radius: 0.25rem;
  color: var(--secondary-foreground);
}

.remediation-note {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-style: italic;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Drawer footer – Contact button */
.drawer-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.875rem 1rem;
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-contact:hover {
  background-color: var(--secondary);
}

.btn-contact .icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .btn-outline span {
    display: none;
  }

  .main-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.875rem;
  }

  .drawer {
    max-width: 100%;
  }
}
