/* ==========================================================================
   SENTINEL SOC - Modern Dark Theme Design System
   ========================================================================== */

:root {
  --bg-primary: #070a12;
  --bg-secondary: #0d121f;
  --bg-card: #131b2e;
  --bg-card-hover: #18233c;
  --bg-card-accent: rgba(30, 41, 59, 0.7);
  --border: #1e293b;
  --border-focus: #38bdf8;
  --border-glow: rgba(56, 189, 248, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #00f0ff;
  --accent-blue: #38bdf8;
  --accent-emerald: #00e5a0;
  --accent-green: #10b981;
  --accent-red: #ff3366;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;

  --sev-critical: #ff3366;
  --sev-high: #f97316;
  --sev-medium: #eab308;
  --sev-low: #06b6d4;
  --sev-info: #10b981;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.25);
  --glow-red: 0 0 20px rgba(255, 51, 102, 0.3);
  --glow-green: 0 0 20px rgba(0, 229, 160, 0.25);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(0, 229, 160, 0.05) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glassmorphism helpers */
.glass {
  background: rgba(19, 27, 46, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

.glass-card {
  background: rgba(19, 27, 46, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   Header & Navbar
   -------------------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(0, 229, 160, 0.12);
  border: 1px solid rgba(0, 229, 160, 0.35);
  color: var(--accent-emerald);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 229, 160, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 229, 160, 0); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.15);
}

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

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.btn-github {
  background: #24292f;
  color: #fff;
  border: 1px solid #30363d;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-github:hover {
  background: #2f363d;
  border-color: #8b949e;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Container & Tabs Layout
   -------------------------------------------------------------------------- */
.main-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   KPI Metric Cards
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent-blue));
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kpi-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kpi-icon {
  font-size: 1.1rem;
  color: var(--card-accent, var(--text-muted));
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kpi-sub.highlight {
  color: var(--card-accent, var(--accent-emerald));
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   SOC Console Grid (Live Alert Feed + Charts)
   -------------------------------------------------------------------------- */
.soc-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 1.5rem;
}

.control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-cyber {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-cyber:hover {
  background: rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
  transform: translateY(-1px);
}

.btn-cyber.danger {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-red);
  border-color: rgba(255, 51, 102, 0.4);
}

.btn-cyber.danger:hover {
  background: rgba(255, 51, 102, 0.25);
  box-shadow: 0 0 16px rgba(255, 51, 102, 0.35);
}

.select-cyber {
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.select-cyber:focus {
  border-color: var(--accent-cyan);
}

/* Feed Table */
.feed-box {
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.feed-header {
  padding: 1rem 1.25rem;
  background: rgba(24, 35, 60, 0.85);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feed-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-responsive {
  overflow-x: auto;
  max-height: 520px;
}

.soc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.soc-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 0.75rem 1rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.soc-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
  color: var(--text-muted);
}

.soc-table tbody tr {
  cursor: pointer;
  transition: var(--transition);
}

.soc-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

.soc-table tbody tr.row-critical {
  background: rgba(255, 51, 102, 0.08);
}
.soc-table tbody tr.row-critical:hover {
  background: rgba(255, 51, 102, 0.16);
}

/* Badges */
.badge-sev {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.badge-sev.CRITICAL { background: rgba(255, 51, 102, 0.2); color: var(--sev-critical); border: 1px solid var(--sev-critical); }
.badge-sev.HIGH     { background: rgba(249, 115, 22, 0.2); color: var(--sev-high); border: 1px solid var(--sev-high); }
.badge-sev.MEDIUM   { background: rgba(234, 179, 8, 0.2); color: var(--sev-medium); border: 1px solid var(--sev-medium); }
.badge-sev.LOW      { background: rgba(6, 182, 212, 0.2); color: var(--sev-low); border: 1px solid var(--sev-low); }
.badge-sev.INFO     { background: rgba(16, 185, 129, 0.2); color: var(--sev-info); border: 1px solid var(--sev-info); }

.ip-tag {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  font-size: 0.8rem;
}

.mitre-tag {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Risk Bar Component */
.risk-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
}

.risk-bar-track {
  width: 50px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

/* Right Side: Charts & Status */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.chart-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
}

.chart-box {
  height: 220px;
  position: relative;
}

/* Defense in depth list */
.status-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.status-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}
.status-indicator.green { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.status-indicator.cyan  { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.status-indicator.purple{ background: var(--accent-purple); box-shadow: 0 0 8px var(--accent-purple); }

.status-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.status-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Threat Hunter Playground Tab
   -------------------------------------------------------------------------- */
.hunter-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.75rem;
}

.form-box {
  padding: 1.75rem;
}

.preset-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.btn-preset {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-preset:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.btn-preset.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.input-cyber {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  outline: none;
  transition: var(--transition);
}

.input-cyber:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.btn-analyze {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #00f0ff 100%);
  color: #040914;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
}

/* Verdict Display */
.verdict-box {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.verdict-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--card-border, var(--border));
  background: rgba(15, 23, 42, 0.8);
  position: relative;
  overflow: hidden;
}

.verdict-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.verdict-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.evidence-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.evidence-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
}

.playbook-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.playbook-box h5 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.playbook-box ol {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* --------------------------------------------------------------------------
   Virtual Cyber Range Tab
   -------------------------------------------------------------------------- */
.range-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.75rem;
}

.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.scenario-item {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scenario-info h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.scenario-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.scenario-bar-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  min-width: 140px;
}

.scenario-bar-wrap {
  width: 140px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.scenario-bar-fill {
  height: 100%;
  background: var(--accent-emerald);
  border-radius: var(--radius-full);
}

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

.stat-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.stat-table tr:last-child td {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   Model Intelligence Tab
   -------------------------------------------------------------------------- */
.model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.benchmark-card {
  padding: 1.5rem;
}

.benchmark-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #fff;
}

.benchmark-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.875rem;
}

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

/* --------------------------------------------------------------------------
   Modal Window
   -------------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 20, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .soc-layout, .hunter-grid, .range-grid, .model-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .fields-grid {
    grid-template-columns: 1fr;
  }
}
