/* ═══════════════════════════════════════════════════════════════════════════
   security-hub.css  —  Nexxus Security Hub dashboard styles
   Premium dark theme with neon-cyan accents, glassmorphism, and full a11y.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (scoped) ─────────────────────────────────────── */
:root {
  --shub-bg-card:      rgba(0, 255, 200, 0.03);
  --shub-bg-card-hover:rgba(0, 255, 200, 0.06);
  --shub-border:       rgba(0, 255, 200, 0.12);
  --shub-border-hover: rgba(0, 255, 200, 0.3);
  --shub-cyan:         #00f5ff;
  --shub-green:        #00c864;
  --shub-red:          #ff3232;
  --shub-orange:       #ff9600;
  --shub-yellow:       #ffdc00;
  --shub-purple:       #9944ff;
  --shub-text:         #e0e0e0;
  --shub-text-muted:   #8899aa;
  --shub-radius:       12px;
  --shub-radius-sm:    8px;
  --shub-transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shub-glow:         0 0 20px rgba(0, 245, 255, 0.15);
  --shub-glow-strong:  0 0 40px rgba(0, 245, 255, 0.25);
}

/* ── Screen-reader only ─────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── High-Contrast override ─────────────────────────────────────────────── */
body.high-contrast .shub-system-card,
body.high-contrast .shub-scan-panel,
body.high-contrast .shub-setting-group {
  border-color: #fff;
  background: #000;
}
body.high-contrast .shub-metric__value,
body.high-contrast .shub-stat__val,
body.high-contrast .shub-section-title {
  color: #fff;
}

/* ── Reduce-motion override ─────────────────────────────────────────────── */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.shub-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 140px 2rem 60px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0,245,255,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(153,68,255,0.04) 0%, transparent 60%);
}
.shub-hero__inner { position: relative; z-index: 1; }
.shub-hero__badge {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}
.shub-shield-icon {
  font-size: 3.5rem;
  display: block;
  filter: drop-shadow(0 0 20px rgba(0,245,255,0.4));
}
.shub-pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  border: 2px solid var(--shub-cyan);
  border-radius: 50%;
  opacity: 0;
  animation: shub-pulse 2.5s ease-out infinite;
}
@keyframes shub-pulse {
  0%   { opacity: 0.6; transform: scale(0.8); }
  100% { opacity: 0;   transform: scale(2.2); }
}
.shub-hero__title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--shub-cyan);
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
  text-shadow: 0 0 30px rgba(0,245,255,0.3);
}
.shub-hero__subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  color: var(--shub-text-muted);
  margin: 0 0 1.5rem;
}
.shub-hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--shub-green);
  background: rgba(0,200,100,0.08);
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  border: 1px solid rgba(0,200,100,0.2);
}
.shub-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.shub-status-dot--ok { background: var(--shub-green); box-shadow: 0 0 8px var(--shub-green); }
.shub-status-dot--warn { background: var(--shub-orange); box-shadow: 0 0 8px var(--shub-orange); }
.shub-status-dot--critical { background: var(--shub-red); box-shadow: 0 0 8px var(--shub-red); }

/* ── Main container ─────────────────────────────────────────────────────── */
.shub-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}
.shub-section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--shub-cyan);
  margin: 3rem 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--shub-border);
}
.shub-section-desc {
  color: var(--shub-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ── Metrics bar ────────────────────────────────────────────────────────── */
.shub-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.shub-metric {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--shub-bg-card);
  border: 1px solid var(--shub-border);
  border-radius: var(--shub-radius-sm);
  padding: 1rem 1.2rem;
  transition: border-color var(--shub-transition), box-shadow var(--shub-transition);
}
.shub-metric:hover {
  border-color: var(--shub-border-hover);
  box-shadow: var(--shub-glow);
}
.shub-metric__icon { font-size: 1.6rem; flex-shrink: 0; }
.shub-metric__body { display: flex; flex-direction: column; }
.shub-metric__value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--shub-cyan);
  line-height: 1.2;
}
.shub-metric__label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  color: var(--shub-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── System cards ───────────────────────────────────────────────────────── */
.shub-systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}
.shub-system-card {
  background: var(--shub-bg-card);
  border: 1px solid var(--shub-border);
  border-radius: var(--shub-radius);
  padding: 1.5rem;
  transition: border-color var(--shub-transition), box-shadow var(--shub-transition), transform var(--shub-transition);
}
.shub-system-card:hover {
  border-color: var(--shub-border-hover);
  box-shadow: var(--shub-glow);
  transform: translateY(-2px);
}
.shub-system-card--sync {
  border-color: rgba(153, 68, 255, 0.2);
  background: rgba(153, 68, 255, 0.03);
}
.shub-system-card--sync:hover {
  border-color: rgba(153, 68, 255, 0.4);
  box-shadow: 0 0 20px rgba(153, 68, 255, 0.15);
}
.shub-system-card__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.shub-system-card__icon { font-size: 1.4rem; flex-shrink: 0; }
.shub-system-card__name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--shub-text);
  flex: 1;
}
.shub-system-card__status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.shub-status--active {
  color: var(--shub-green);
  background: rgba(0, 200, 100, 0.1);
  border: 1px solid rgba(0, 200, 100, 0.2);
}
.shub-status--inactive {
  color: var(--shub-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.shub-status--alert {
  color: var(--shub-red);
  background: rgba(255, 50, 50, 0.1);
  border: 1px solid rgba(255, 50, 50, 0.2);
}
.shub-system-card__desc {
  font-size: 0.85rem;
  color: var(--shub-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.shub-system-card__stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.shub-stat { text-align: center; flex: 1; }
.shub-stat__val {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--shub-cyan);
}
.shub-stat__lbl {
  font-size: 0.7rem;
  color: var(--shub-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.shub-system-card__actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.shub-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--shub-transition);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.shub-btn:focus-visible {
  outline: 2px solid var(--shub-cyan);
  outline-offset: 2px;
}
.shub-btn--primary {
  background: var(--shub-cyan);
  color: #000;
  border-color: var(--shub-cyan);
}
.shub-btn--primary:hover { opacity: 0.85; box-shadow: 0 0 15px rgba(0,245,255,0.3); }
.shub-btn--ghost {
  background: transparent;
  color: var(--shub-cyan);
  border-color: var(--shub-border);
}
.shub-btn--ghost:hover {
  border-color: var(--shub-cyan);
  background: rgba(0, 245, 255, 0.05);
}
.shub-btn--danger {
  background: transparent;
  color: var(--shub-red);
  border-color: rgba(255,50,50,0.3);
}
.shub-btn--danger:hover {
  border-color: var(--shub-red);
  background: rgba(255,50,50,0.08);
}
.shub-btn--wide { width: 100%; }
.shub-btn--sm { font-size: 0.7rem; padding: 0.4rem 0.8rem; }

/* ── Input fields ───────────────────────────────────────────────────────── */
.shub-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--shub-border);
  border-radius: 6px;
  color: var(--shub-text);
  transition: border-color var(--shub-transition);
  width: 100%;
}
.shub-input:focus {
  border-color: var(--shub-cyan);
  outline: none;
  box-shadow: 0 0 10px rgba(0,245,255,0.1);
}
.shub-input--sm { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
.shub-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.shub-input-group .shub-input { flex: 1; }

/* ── Live Threat Feed ───────────────────────────────────────────────────── */
.shub-threat-feed { margin-top: 2rem; }
.shub-feed-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.shub-filter-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.35rem 0.8rem;
  border-radius: 100px;
  border: 1px solid var(--shub-border);
  background: transparent;
  color: var(--shub-text-muted);
  cursor: pointer;
  transition: all var(--shub-transition);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.shub-filter-btn:hover { border-color: var(--shub-cyan); color: var(--shub-text); }
.shub-filter-btn--active,
.shub-filter-btn[aria-pressed="true"] {
  background: rgba(0, 245, 255, 0.1);
  border-color: var(--shub-cyan);
  color: var(--shub-cyan);
}
.shub-filter-btn:focus-visible {
  outline: 2px solid var(--shub-cyan);
  outline-offset: 2px;
}
.shub-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  cursor: pointer;
}
.shub-toggle__label {
  font-size: 0.75rem;
  color: var(--shub-text-muted);
}
.shub-feed-list {
  max-height: 500px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--shub-border);
  border-radius: var(--shub-radius-sm);
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--shub-border) transparent;
}
.shub-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  transition: background var(--shub-transition);
  border-left: 3px solid transparent;
}
.shub-feed-item:hover { background: rgba(255,255,255,0.03); }
.shub-feed-item--critical { border-left-color: var(--shub-red); color: #ff6666; }
.shub-feed-item--high { border-left-color: var(--shub-orange); color: #ffb040; }
.shub-feed-item--medium { border-left-color: var(--shub-yellow); color: #ffe640; }
.shub-feed-item--low { border-left-color: var(--shub-cyan); color: var(--shub-cyan); }
.shub-feed-item--blocked { border-left-color: var(--shub-purple); color: #bb88ff; }
.shub-feed-item--info { border-left-color: var(--shub-text-muted); color: var(--shub-text-muted); }
.shub-feed-item__time {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--shub-text-muted);
  min-width: 55px;
}
.shub-feed-item__icon { flex-shrink: 0; font-size: 0.9rem; }
.shub-feed-item__text { flex: 1; }
.shub-feed-item__source {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--shub-text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  border: 1px solid var(--shub-border);
  white-space: nowrap;
}

/* ── Scan Controls ──────────────────────────────────────────────────────── */
.shub-scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.shub-scan-panel {
  background: var(--shub-bg-card);
  border: 1px solid var(--shub-border);
  border-radius: var(--shub-radius);
  padding: 1.5rem;
}
.shub-scan-panel__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--shub-text);
  margin-bottom: 0.5rem;
}
.shub-scan-panel__desc {
  font-size: 0.85rem;
  color: var(--shub-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.shub-scan-result {
  margin-top: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
}
.shub-test-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.shub-test-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--shub-border);
  background: transparent;
  color: var(--shub-text-muted);
  cursor: pointer;
  transition: all var(--shub-transition);
}
.shub-test-btn:hover {
  border-color: var(--shub-cyan);
  color: var(--shub-cyan);
  background: rgba(0,245,255,0.05);
}
.shub-test-btn:focus-visible {
  outline: 2px solid var(--shub-cyan);
  outline-offset: 2px;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.shub-progress-container { margin-top: 1rem; }
.shub-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}
.shub-progress-bar__fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--shub-cyan), var(--shub-green));
  border-radius: 3px;
  transition: width 0.3s ease;
}
.shub-progress-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--shub-text-muted);
  display: block;
  margin-top: 0.4rem;
}

/* ── Settings ───────────────────────────────────────────────────────────── */
.shub-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.shub-setting-group {
  background: var(--shub-bg-card);
  border: 1px solid var(--shub-border);
  border-radius: var(--shub-radius);
  padding: 1.5rem;
}
.shub-setting-group__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--shub-cyan);
  margin-bottom: 1rem;
  padding: 0;
}
.shub-radio-label,
.shub-switch-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--shub-text-muted);
  transition: color var(--shub-transition);
}
.shub-radio-label:hover,
.shub-switch-label:hover { color: var(--shub-text); }
.shub-radio-text,
.shub-switch-text { flex: 1; }

/* Custom toggle switch */
.shub-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  flex-shrink: 0;
  transition: background var(--shub-transition);
}
.shub-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--shub-text-muted);
  border-radius: 50%;
  transition: all var(--shub-transition);
}
.shub-switch-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.shub-switch-label input:checked + .shub-switch { background: rgba(0,245,255,0.3); }
.shub-switch-label input:checked + .shub-switch::after {
  left: 18px;
  background: var(--shub-cyan);
}
.shub-switch-label input:focus-visible + .shub-switch {
  outline: 2px solid var(--shub-cyan);
  outline-offset: 2px;
}

/* ── Learned Threats Table ──────────────────────────────────────────────── */
.shub-table-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.shub-table-controls .shub-input { max-width: 300px; }
.shub-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--shub-border);
  border-radius: var(--shub-radius-sm);
}
.shub-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}
.shub-table th {
  background: rgba(0,245,255,0.05);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--shub-cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--shub-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.shub-table th:hover { background: rgba(0,245,255,0.08); }
.shub-table td {
  padding: 0.6rem 1rem;
  color: var(--shub-text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.shub-table tr:hover td { background: rgba(255,255,255,0.02); }
.shub-table .sev-critical { color: var(--shub-red); font-weight: 700; }
.shub-table .sev-high { color: var(--shub-orange); font-weight: 600; }
.shub-table .sev-medium { color: var(--shub-yellow); }
.shub-table .sev-low { color: var(--shub-cyan); }
.shub-badge-verified {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: rgba(0,200,100,0.1);
  border: 1px solid rgba(0,200,100,0.25);
  color: var(--shub-green);
}
.shub-badge-unverified {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--shub-text-muted);
}

/* ── Modals ──────────────────────────────────────────────────────────────── */
.shub-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.shub-modal[hidden] { display: none; }
.shub-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.shub-modal__content {
  position: relative;
  background: #0a0e14;
  border: 1px solid var(--shub-border-hover);
  border-radius: var(--shub-radius);
  padding: 2rem;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shub-glow-strong);
}
.shub-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--shub-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color var(--shub-transition);
}
.shub-modal__close:hover { color: var(--shub-text); }
.shub-modal__close:focus-visible {
  outline: 2px solid var(--shub-cyan);
  outline-offset: 2px;
}
.shub-modal__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: var(--shub-cyan);
  margin-bottom: 1rem;
}
.shub-modal__body {
  font-size: 0.85rem;
  color: var(--shub-text-muted);
  line-height: 1.6;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .shub-main { padding: 0 1rem 4rem; }
  .shub-metrics { grid-template-columns: repeat(2, 1fr); }
  .shub-systems-grid { grid-template-columns: 1fr; }
  .shub-scan-grid { grid-template-columns: 1fr; }
  .shub-settings-grid { grid-template-columns: 1fr; }
  .shub-hero { padding: 120px 1rem 40px; min-height: 280px; }
  .shub-system-card__stats { flex-wrap: wrap; }
  .shub-feed-controls { gap: 0.3rem; }
}
@media (max-width: 480px) {
  .shub-metrics { grid-template-columns: 1fr; }
  .shub-input-group { flex-direction: column; }
}

/* ── Focus-visible for keyboard users ───────────────────────────────────── */
.shub-system-card:focus-within { box-shadow: var(--shub-glow); border-color: var(--shub-border-hover); }
.shub-feed-list:focus-visible { outline: 2px solid var(--shub-cyan); outline-offset: -2px; }
.shub-table-wrap:focus-visible { outline: 2px solid var(--shub-cyan); outline-offset: -2px; }
