/* OpenSentinel interactive web demo — mirrors desktop UI colors */
:root {
  --bg: #0a1220;
  --sidebar: #0b1528;
  --sidebar-border: #1e3a5f;
  --nav: #152a47;
  --nav-hover: #1e3a5f;
  --nav-border: #243956;
  --nav-active: #2563eb;
  --nav-active-border: #3b82f6;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --card: #0e1a30;
  --card-border: #1e3a5f;
  --hero-bg: #0d2818;
  --hero-border: #166534;
  --hero-status: #4ade80;
  --hero-sub: #a7f3d0;
  --strip: #1d4ed8;
  --strip-progress: #93c5fd;
  --log-bg: #091326;
  --log-text: #93c5fd;
  --accent: #2563eb;
  --font: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sidebar-w: 256px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: #050a12;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

.demo-banner {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  background: #1e293b;
  color: #cbd5e1;
  border-bottom: 1px solid #334155;
}
.demo-banner a {
  color: #7dd3fc;
}

.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg);
}

.scan-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 54px;
  padding: 0 18px;
  background: var(--strip);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.scan-strip[hidden] {
  display: none !important;
}

.scan-progress-wrap {
  width: 220px;
  height: 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 7px;
  overflow: hidden;
}

.scan-progress-bar {
  height: 100%;
  width: 30%;
  background: var(--strip-progress);
  border-radius: 7px;
  transform-origin: left center;
  animation: scan-pulse 1.1s ease-in-out infinite;
}

@keyframes scan-pulse {
  0%,
  100% {
    transform: scaleX(0.25);
    opacity: 0.85;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
}

@media (max-width: 800px) {
  .app-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100% !important;
    min-height: auto;
  }
  .nav-list {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
  .nav-btn {
    flex: 1 1 auto;
    min-width: 100px;
  }
}

.sidebar {
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 14px 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-title {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
}

.brand-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-sep {
  height: 1px;
  background: var(--sidebar-border);
  margin: 0 14px 8px;
}

.nav-list {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 0 12px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--nav-border);
  background: var(--nav);
  color: #e8f1ff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.nav-btn:hover {
  background: var(--nav-hover);
}

.nav-btn.active {
  background: var(--nav-active);
  border-color: var(--nav-active-border);
  color: #fff;
  font-weight: 700;
}

.nav-ico {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 8px 14px 16px;
  font-size: 11px;
  color: var(--text-dim);
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.page-top {
  flex-shrink: 0;
  padding: 16px 20px;
  margin: 0 0 14px;
  background: #0f1f3d;
  border: 1px solid #2e6d8e;
  border-radius: 12px;
}

.page-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
}

.page-rt {
  margin: 0;
  font-size: 13px;
  color: #6ee7b7;
}

.page-panels {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.page {
  display: none;
  animation: fade 0.2s ease;
}

.page.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero-card {
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 12px;
}

.hero-status {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--hero-status);
}

.hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--hero-sub);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.panel-text {
  min-height: 200px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  font-size: 13px;
  color: #dcebff;
  white-space: pre-wrap;
  font-family: inherit;
  overflow: auto;
}

.panel-text.readonly {
  user-select: text;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px 16px;
}

.card-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.card-desc {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  max-width: 920px;
}

.field-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

.field-input,
.field-select {
  width: 100%;
  max-width: 560px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #0a1220;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-scan {
  flex: 1 1 120px;
  background: var(--accent);
  color: #fff;
}

.btn-scan:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  margin-bottom: 12px;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-secondary {
  background: #334155;
  color: #e2e8f0;
  margin-top: 8px;
}

.btn-secondary:hover:not(:disabled) {
  filter: brightness(1.12);
}

.log-area {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--log-bg);
  color: var(--log-text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.log-area.fill {
  min-height: 360px;
  flex: 1;
}

.sub-title {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}

.threat-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.threat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #0f172a;
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.threat-meta {
  flex: 1 1 200px;
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.4;
}

.threat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.threat-actions button {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.threat-actions .q {
  background: #334155;
  color: #e2e8f0;
}

.threat-actions .d {
  background: #7f1d1d;
  color: #fecaca;
}

.threat-actions .i {
  background: #334155;
  color: #cbd5e1;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 13px;
  cursor: pointer;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.app-footer {
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-ver {
  color: var(--text-dim);
}
