/* soc.css — SOC large-screen dashboard styles
 *
 * Designed for wall-mounted displays:
 * - High contrast, readable from 3-5 meters
 * - Large fonts, no small text
 * - Dark theme only (reduces glare in SOC rooms)
 * - Full-screen layout, no scrolling
 * - Animated threat indicators
 * - Auto-rotating panels
 *
 * All colors use CSS variables from theme.css.
 * SOC-specific variables defined below for easy theming.
 */

/* ── SOC-specific variables ── */
:root {
    /* SOC background (deep dark for wall displays) */
    --soc-bg: #0a0e1a;
    --soc-text: var(--text-primary);
    --soc-text-muted: var(--text-muted);
    --soc-border: var(--border);
    --soc-card-bg: var(--bg-secondary);
    --soc-card-border: var(--border);

    /* Severity palette (shared with badges) */
    --soc-sev-critical: var(--danger);
    --soc-sev-high: var(--warning);
    --soc-sev-medium: #eab308;
    --soc-sev-low: var(--success);

    /* Threat level palette */
    --soc-threat-normal: #4ade80;
    --soc-threat-elevated: #facc15;
    --soc-threat-high: #fb923c;
    --soc-threat-critical: #f87171;

    /* Value colors for metric display */
    --soc-val-green: #4ade80;
    --soc-val-yellow: #facc15;
    --soc-val-orange: #fb923c;
    --soc-val-red: #f87171;
    --soc-val-blue: #60a5fa;
    --soc-val-cyan: #22d3ee;
    --soc-val-white: #f0f0f0;

    /* SOC accent */
    --soc-accent: var(--accent);
    --soc-accent-bg: var(--accent-light);
}

/* SOC pages force dark theme for optimal screen readability */
.soc-page {
    background: var(--soc-bg);
    color: var(--soc-text);
    min-height: calc(100vh - 60px);
    font-family: var(--font-sans);
    padding: 12px 16px;
}

/* Fullscreen mode — hide sidebar */
.soc-fullscreen .sidebar { display: none !important; }
.soc-fullscreen .content { padding: 0; }
.soc-fullscreen .soc-page { padding: 20px; }

/* ── Header Bar ── */
.soc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--soc-border);
    margin-bottom: 16px;
}

.soc-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.soc-clock {
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--soc-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ── Threat Level Indicator ── */
.threat-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.threat-normal {
    background: rgba(34, 197, 94, 0.15);
    color: var(--soc-threat-normal);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.threat-elevated {
    background: rgba(234, 179, 8, 0.15);
    color: var(--soc-threat-elevated);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.threat-high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--soc-threat-high);
    border: 1px solid rgba(249, 115, 22, 0.3);
    animation: pulse-border 2s ease-in-out infinite;
}

.threat-critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--soc-threat-critical);
    border: 1px solid rgba(239, 68, 68, 0.5);
    animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(239, 68, 68, 0.5); }
    50% { border-color: rgba(239, 68, 68, 1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
}

/* ── Threat Pulse Dot ── */
.threat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: soc-pulse-dot 2s ease-in-out infinite;
}

.threat-dot-normal { background: var(--soc-threat-normal); }
.threat-dot-elevated { background: var(--soc-threat-elevated); }
.threat-dot-high { background: var(--soc-threat-high); animation-duration: 1.5s; }
.threat-dot-critical { background: var(--soc-threat-critical); animation-duration: 0.8s; }

@keyframes soc-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── SOC Metric Cards ── */
.soc-grid {
    display: grid;
    gap: 12px;
}

.soc-grid-5 { grid-template-columns: repeat(5, 1fr); }
.soc-grid-4 { grid-template-columns: repeat(4, 1fr); }
.soc-grid-3 { grid-template-columns: repeat(3, 1fr); }
.soc-grid-2 { grid-template-columns: repeat(2, 1fr); }

.soc-metric {
    background: var(--soc-card-bg);
    border: 1px solid var(--soc-card-border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.soc-metric-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--soc-text-muted);
    margin-bottom: 4px;
}

.soc-metric-value {
    font-size: 2.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.soc-metric-sub {
    font-size: 12px;
    color: var(--soc-text-muted);
    margin-top: 2px;
}

/* Value colors */
.val-green { color: var(--soc-val-green); }
.val-yellow { color: var(--soc-val-yellow); }
.val-orange { color: var(--soc-val-orange); }
.val-red { color: var(--soc-val-red); }
.val-blue { color: var(--soc-val-blue); }
.val-cyan { color: var(--soc-val-cyan); }
.val-white { color: var(--soc-val-white); }

/* ── SOC Panels ── */
.soc-panel {
    background: var(--soc-card-bg);
    border: 1px solid var(--soc-card-border);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.soc-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.soc-panel-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--soc-text-muted);
    font-weight: 600;
}

.soc-panel-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--soc-accent-bg);
    color: var(--soc-val-blue);
}

/* ── Severity Bar Chart ── */
.severity-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 100px;
    padding-top: 8px;
}

.severity-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.severity-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.severity-bar-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--soc-text-muted);
}

.severity-bar-count {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sev-critical { background: var(--soc-sev-critical); }
.sev-high { background: var(--soc-sev-high); }
.sev-medium { background: var(--soc-sev-medium); }
.sev-low { background: var(--soc-sev-low); }

/* ── Engine Status Table ── */
.soc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.soc-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--soc-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--soc-card-border);
}

.soc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--soc-card-bg);
    color: var(--soc-text);
}

.soc-table tr:hover td {
    background: var(--soc-accent-bg);
}

/* ── Live Event Feed ── */
.event-feed {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) var(--soc-card-bg);
}

.event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--soc-border);
    font-size: 13px;
    animation: soc-fadeIn 0.3s ease;
}

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

.event-time {
    color: var(--soc-text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 65px;
}

.event-type {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 55px;
    text-align: center;
}

.event-block {
    background: rgba(239, 68, 68, 0.2);
    color: var(--soc-threat-critical);
}

.event-allow {
    background: rgba(34, 197, 94, 0.15);
    color: var(--soc-threat-normal);
}

.event-detail {
    color: var(--text-secondary);
    flex: 1;
}

/* ── Fullscreen toggle ── */
.soc-fullscreen-btn {
    background: var(--soc-accent-bg);
    color: var(--soc-val-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
}

.soc-fullscreen-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* ── Chart container ── */
.soc-chart {
    width: 100%;
    height: 200px;
}

.soc-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ── Engine Performance rows ── */
.engine-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light, rgba(255, 255, 255, 0.06));
    font-size: 13px;
}

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

.engine-name {
    flex: 1;
    color: var(--soc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.engine-stat {
    min-width: 70px;
    text-align: right;
    color: var(--soc-val-blue);
    font-family: var(--font-mono);
    font-size: 12px;
    margin-left: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   SOC Dashboard v2 — Enterprise redesign
   Professional, dark-theme optimized, Apple-like aesthetics
   ═══════════════════════════════════════════════════════════════ */

/* v2 page wrapper — tighter spacing, subtle refinements */
.soc-v2 {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── KPI Grid: 5 equal columns ── */
.soc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* ── Chart Grid: 3 equal columns ── */
.soc-chart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ── Panel Grid: 3 equal columns ── */
.soc-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ── Stat Row: 4 equal columns (network stats, protocol stats) ── */
.soc-stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* ── Individual stat item within stat row ── */
.soc-stat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
}

.soc-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    margin-top: 4px;
}

/* ── Taller chart container (for donut on threat page) ── */
.soc-chart-tall {
    height: 280px;
}

/* ── Threat Level Banner (full-width, soc-threats page) ── */
.soc-threat-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-radius: 10px;
    margin-top: 12px;
    transition: all 0.4s ease;
}

.soc-threat-banner.threat-normal {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.soc-threat-banner.threat-elevated {
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.soc-threat-banner.threat-high {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.35);
    animation: banner-pulse 2s ease-in-out infinite;
}

.soc-threat-banner.threat-critical {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.5);
    animation: banner-pulse 1s ease-in-out infinite;
}

@keyframes banner-pulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 24px rgba(239, 68, 68, 0.15); }
}

.soc-threat-banner-label {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.soc-threat-banner.threat-normal .soc-threat-banner-label { color: var(--soc-threat-normal); }
.soc-threat-banner.threat-elevated .soc-threat-banner-label { color: var(--soc-threat-elevated); }
.soc-threat-banner.threat-high .soc-threat-banner-label { color: var(--soc-threat-high); }
.soc-threat-banner.threat-critical .soc-threat-banner-label { color: var(--soc-threat-critical); }

.soc-threat-banner-sub {
    font-size: 13px;
    color: var(--soc-text-muted);
    margin-left: auto;
}

/* ── Inline threat level text (soc main page, inside severity panel) ── */
.soc-threat-level-inline {
    margin-top: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--soc-text-muted);
}

/* ── Responsive ── */
@media (max-width: 1440px) {
    .soc-kpi-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
    .soc-chart-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .soc-panel-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (max-width: 1280px) {
    .soc-kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .soc-chart-grid { grid-template-columns: repeat(2, 1fr); }
    .soc-panel-grid { grid-template-columns: repeat(2, 1fr); }
    .soc-grid-5 { grid-template-columns: repeat(3, 1fr); }
    .soc-metric-value { font-size: 1.6rem; }
    .soc-stat-value { font-size: 1.3rem; }
}

@media (max-width: 1024px) {
    .soc-stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Severity Horizontal Bars ── */
.sev-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.sev-bar-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--soc-text-muted);
    width: 70px;
    flex-shrink: 0;
    text-align: right;
}
.sev-bar-track {
    flex: 1;
    height: 18px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}
.sev-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}
.sev-bar-count {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    width: 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .soc-kpi-grid,
    .soc-chart-grid,
    .soc-panel-grid { grid-template-columns: 1fr; }
    .soc-grid-5, .soc-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .soc-stat-row { grid-template-columns: repeat(2, 1fr); }
    .soc-threat-banner { flex-direction: column; text-align: center; }
    .soc-threat-banner-sub { margin-left: 0; }
}
