/* Incident Response & Chaos Simulator Styles */
:root {
	--sim-bg: #0d1117;
	--sim-panel-bg: #161b22;
	--sim-border: #30363d;
	--sim-text: #c9d1d9;
	--sim-text-bright: #f0f6fc;
	--sim-accent: #58a6ff;
	--sim-green: #3fb950;
	--sim-amber: #d29922;
	--sim-red: #f85149;
}

.sim-body {
	background-color: var(--sim-bg);
	color: var(--sim-text);
}

.sim-main {
	margin-top: 2rem;
	margin-bottom: 4rem;
}

.sim-header {
	margin-bottom: 2rem;
	border-bottom: 1px solid var(--sim-border);
	padding-bottom: 1.5rem;
}

.sim-eyebrow {
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--sim-accent);
	margin-bottom: 0.5rem;
}

.sim-title {
	font-size: 2.2rem;
	font-weight: 800;
	color: var(--sim-text-bright);
	line-height: 1.2;
	margin-bottom: 0.75rem;
}

.sim-subtitle {
	font-size: 1.05rem;
	line-height: 1.6;
	color: #8b949e;
	max-width: 950px;
}

/* Telemetry HUD */
.sim-hud {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 1rem;
	background: var(--sim-panel-bg);
	border: 1px solid var(--sim-border);
	border-radius: 10px;
	padding: 1.25rem 1.5rem;
	margin-bottom: 2rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hud-col {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.hud-label {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #8b949e;
}

.hud-status-badge {
	display: inline-block;
	background: rgba(248, 81, 73, 0.15);
	color: var(--sim-red);
	border: 1px solid rgba(248, 81, 73, 0.35);
	padding: 0.35rem 0.75rem;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 700;
	font-family: 'Fira Code', monospace;
	width: fit-content;
}

.hud-status-badge.ok {
	background: rgba(63, 185, 80, 0.15);
	color: var(--sim-green);
	border-color: rgba(63, 185, 80, 0.35);
}

.sla-bar-wrap {
	width: 100%;
	height: 12px;
	background: #21262d;
	border-radius: 6px;
	overflow: hidden;
	margin-top: 0.2rem;
}

.sla-fill {
	height: 100%;
	background: var(--sim-green);
	transition: width 0.4s ease, background-color 0.4s ease;
}

.sla-text {
	font-family: 'Fira Code', monospace;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--sim-text-bright);
}

.sim-scenario-select {
	background: #0d1117;
	color: var(--sim-text-bright);
	border: 1px solid var(--sim-border);
	border-radius: 6px;
	padding: 0.45rem 0.75rem;
	font-size: 0.85rem;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
}

.sim-btn.reset {
	background: #21262d;
	color: var(--sim-text-bright);
	border: 1px solid var(--sim-border);
	border-radius: 6px;
	padding: 0.5rem 1rem;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	margin-top: auto;
	transition: all 0.2s ease;
}

.sim-btn.reset:hover {
	background: #30363d;
	border-color: #8b949e;
}

/* Workspace Grid */
.sim-workspace-grid {
	display: grid;
	grid-template-columns: 1fr 1.3fr;
	gap: 1.5rem;
}

@media (max-width: 990px) {
	.sim-workspace-grid {
		grid-template-columns: 1fr;
	}
}

/* Left Brief Column */
.sim-brief-col {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.brief-card {
	background: var(--sim-panel-bg);
	border: 1px solid var(--sim-border);
	border-radius: 10px;
	padding: 1.25rem 1.5rem;
}

.brief-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	border-bottom: 1px solid #21262d;
	padding-bottom: 0.85rem;
	margin-bottom: 1rem;
}

.brief-alert-icon {
	font-size: 1.6rem;
}

.brief-header h3 {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--sim-text-bright);
	margin: 0;
}

.brief-timestamp {
	font-family: 'Fira Code', monospace;
	font-size: 0.75rem;
	color: #8b949e;
}

.brief-body {
	font-size: 0.92rem;
	line-height: 1.6;
	color: var(--sim-text);
}

.brief-body p {
	margin-bottom: 0.75rem;
}

.brief-body code {
	background: #0d1117;
	color: var(--sim-accent);
	padding: 0.15rem 0.4rem;
	border-radius: 4px;
	font-family: 'Fira Code', monospace;
	font-size: 0.85rem;
	border: 1px solid #21262d;
}

/* Action Buttons */
.suggested-actions-card {
	background: var(--sim-panel-bg);
	border: 1px solid var(--sim-border);
	border-radius: 10px;
	padding: 1.25rem 1.5rem;
}

.suggested-actions-card h4 {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--sim-text-bright);
	margin-bottom: 0.35rem;
}

.actions-hint {
	font-size: 0.8rem;
	color: #8b949e;
	margin-bottom: 0.85rem;
}

.action-buttons-grid {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.action-btn {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #0d1117;
	border: 1px solid var(--sim-border);
	border-radius: 6px;
	padding: 0.55rem 0.85rem;
	color: var(--sim-text);
	font-family: 'Fira Code', monospace;
	font-size: 0.85rem;
	cursor: pointer;
	text-align: left;
	transition: all 0.2s ease;
}

.action-btn:hover {
	background: #21262d;
	border-color: var(--sim-accent);
	color: var(--sim-text-bright);
}

.btn-badge {
	font-size: 0.7rem;
	font-weight: 700;
	padding: 0.15rem 0.45rem;
	border-radius: 4px;
	background: #21262d;
	color: #8b949e;
}

.action-btn:hover .btn-badge {
	background: rgba(88, 166, 255, 0.2);
	color: var(--sim-accent);
}

/* Post-Mortem Card */
.postmortem-card {
	background: rgba(63, 185, 80, 0.08);
	border: 1px solid rgba(63, 185, 80, 0.4);
	border-radius: 10px;
	padding: 1.25rem 1.5rem;
}

.postmortem-badge {
	display: inline-block;
	background: rgba(63, 185, 80, 0.2);
	color: var(--sim-green);
	padding: 0.25rem 0.6rem;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 700;
	font-family: 'Fira Code', monospace;
	margin-bottom: 0.6rem;
}

.postmortem-card h4 {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--sim-text-bright);
	margin-bottom: 0.6rem;
}

.postmortem-content {
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--sim-text);
}

/* Authentic Terminal Window */
.terminal-window {
	background: #0d1117;
	border: 1px solid var(--sim-border);
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
	cursor: text;
}

.terminal-titlebar {
	background: #161b22;
	border-bottom: 1px solid var(--sim-border);
	padding: 0.6rem 0.85rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.terminal-dots {
	display: flex;
	gap: 6px;
}

.dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-host {
	font-family: 'Fira Code', monospace;
	font-size: 0.8rem;
	color: #8b949e;
}

.terminal-clear-btn {
	background: transparent;
	border: 1px solid #30363d;
	color: #8b949e;
	padding: 0.2rem 0.55rem;
	border-radius: 4px;
	font-size: 0.75rem;
	cursor: pointer;
}

.terminal-clear-btn:hover {
	color: var(--sim-text-bright);
	border-color: #8b949e;
}

/* Scrollable Screen */
.terminal-screen {
	padding: 1rem 1.25rem;
	height: 480px;
	overflow-y: auto;
	font-family: 'Fira Code', monospace;
	font-size: 0.88rem;
	line-height: 1.5;
	display: flex;
	flex-direction: column;
	outline: none;
}

.terminal-history-log {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.term-entry {
	margin-top: 0.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.term-entry .term-prompt {
	color: var(--sim-accent);
	font-weight: 700;
	flex-shrink: 0;
}

.term-entry .term-cmd-text {
	color: var(--sim-text-bright);
	font-weight: 600;
}

.term-output-block {
	white-space: pre-wrap;
	word-break: break-all;
	color: var(--sim-text);
	padding: 0.2rem 0;
}

.term-output-block.term-dim { color: #8b949e; }
.term-output-block.term-warn { color: var(--sim-amber); font-weight: 600; }
.term-output-block.term-err { color: var(--sim-red); font-weight: 600; }
.term-output-block.term-succ { color: var(--sim-green); font-weight: 700; }

/* Inline Active Line */
.terminal-active-line {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.6rem;
	padding-bottom: 0.5rem;
}

.terminal-active-line .terminal-prompt {
	color: var(--sim-accent);
	font-weight: 700;
	flex-shrink: 0;
}

.terminal-input {
	flex-grow: 1;
	background: transparent;
	border: none;
	outline: none;
	color: var(--sim-text-bright);
	font-family: 'Fira Code', monospace;
	font-size: 0.88rem;
	padding: 0;
	margin: 0;
	caret-color: var(--sim-accent);
}

.terminal-footer-hint {
	background: #161b22;
	border-top: 1px solid var(--sim-border);
	padding: 0.4rem 0.85rem;
	font-size: 0.72rem;
	color: #8b949e;
	text-align: right;
}

.terminal-footer-hint kbd {
	background: #21262d;
	border: 1px solid #30363d;
	padding: 0.1rem 0.35rem;
	border-radius: 3px;
	font-size: 0.7rem;
	color: var(--sim-text);
}

/* Educational Explanations in Terminal */
.term-output-block.term-explanation {
	color: #79c0ff;
	background: rgba(56, 189, 248, 0.08);
	border-left: 3px solid #38bdf8;
	padding: 0.55rem 0.85rem;
	border-radius: 0 6px 6px 0;
	margin: 0.45rem 0;
	line-height: 1.55;
	font-size: 0.84rem;
}

.btn-cmd-title {
	font-weight: 700;
	color: var(--sim-accent);
}

.btn-cmd-desc {
	font-size: 0.75rem;
	color: #8b949e;
	font-family: 'Inter', sans-serif;
	margin-top: 0.15rem;
}
/* Match the portfolio's light cards; keep the terminal as its own dark surface. */
body.sim-body {
    --sim-bg: #f8fafc;
    --sim-panel-bg: #ffffff;
    --sim-border: #d5e0eb;
    --sim-text: #334155;
    --sim-text-bright: #18334d;
    --sim-accent: #155b97;
    --sim-green: #18723b;
    --sim-red: #b42318;
    --sim-ui-accent: var(--s-primary, #155b97);
    --sim-ui-tint: var(--s-tint, #eef5fb);
    background: #ffffff;
}
body.sim-body .sim-subtitle { max-width: none; margin: 0 0 18px; color: #475569; }
body.sim-body .sim-eyebrow { color: var(--sim-ui-accent) !important; }
.sim-start-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 0; margin: 20px 0; list-style: none; counter-reset: sim-step; }
.sim-start-steps li { counter-increment: sim-step; background: var(--sim-ui-tint); border: 1px solid var(--sim-border); border-top: 3px solid var(--sim-ui-accent); border-radius: 8px; padding: 14px 16px; font-size: .9rem; color: #334155; }
.sim-start-steps strong { display: block; margin-bottom: 5px; color: #18334d; }
.sim-start-steps strong::before { content: counter(sim-step) '. '; }
.sim-practice-note { color: #526375; font-size: .85rem; line-height: 1.65; }
.sim-hud { grid-template-columns: 1fr 1fr minmax(0,1.6fr) auto; box-shadow: 0 3px 14px #152f4910; }
.hud-col, .sim-brief-col, .sim-terminal-col { min-width: 0; }
body.sim-body .hud-label, body.sim-body .actions-hint, body.sim-body .brief-timestamp, body.sim-body .btn-cmd-desc { color: #526375; }
body.sim-body .sim-scenario-select { width: 100%; min-width: 0; background: var(--sim-ui-tint); color: #18334d; border: 1px solid var(--sim-ui-accent); line-height: 1.5; }
body.sim-body .sim-btn.reset { background: var(--sim-ui-accent); color: #fff; border-color: var(--sim-ui-accent); }
body.sim-body .sim-btn.reset:hover { filter: brightness(.92); }
body.sim-body .brief-header { border-color: var(--sim-border); }
body.sim-body .brief-header h3, body.sim-body .suggested-actions-card h4 { background: var(--sim-ui-accent); color: #fff !important; padding: 9px 12px; border: 0; border-radius: 6px; line-height: 1.5; }
body.sim-body .brief-body code, body.sim-body .postmortem-content code { background: var(--sim-ui-tint); color: #234660; border-color: var(--sim-border); overflow-wrap: anywhere; }
body.sim-body .action-btn { background: #fff; color: #334155; border-color: var(--sim-border); gap: 10px; min-width: 0; }
body.sim-body .action-btn > div { min-width: 0; }
body.sim-body .action-btn:hover { background: var(--sim-ui-tint); border-color: var(--sim-ui-accent); }
body.sim-body .btn-cmd-title { display: block; color: #18334d; font-family: 'Fira Code', monospace; overflow-wrap: anywhere; font-size: .82rem; }
body.sim-body .btn-badge { flex-shrink: 0; color: #fff; background: var(--sim-ui-accent); }
.sim-fix-steps { border-top: 1px solid var(--sim-border); padding-top: 15px; margin-top: 18px; }
.sim-fix-steps summary { cursor: pointer; font-weight: 700; color: #18334d; padding: 6px 0; }
body.sim-body .postmortem-card h4 { color: #18334d !important; }
body.sim-body :is(button, select, summary, input):focus-visible { outline: 3px solid var(--sim-ui-accent); outline-offset: 3px; }
body.sim-body .terminal-window { --sim-text: #c9d1d9; --sim-text-bright: #f0f6fc; --sim-border: #30363d; --sim-accent: #79c0ff; --sim-green: #6bd883; --sim-red: #ff8b82; --sim-amber: #eac15b; color: var(--sim-text); box-shadow: 0 6px 20px #152f4925; }
body.sim-body .terminal-window input { color: #f0f6fc; background: transparent; min-width: 0; width: 100%; }
.terminal-titlebar { gap: 10px; }
.terminal-host { overflow-wrap: anywhere; text-align: center; }
.terminal-dots { flex-shrink: 0; }
.term-entry { flex-wrap: wrap; }
.term-cmd-text { overflow-wrap: anywhere; min-width: 0; }
@media(max-width:1100px) { .sim-hud { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) {
    .sim-start-steps, .sim-hud { grid-template-columns: minmax(0,1fr); }
    .sim-start-steps { gap: 8px; }
    .brief-card, .suggested-actions-card, .sim-hud { padding: 16px; }
    .terminal-screen { padding: 14px; }
    .terminal-active-line { flex-wrap: wrap; }
    .terminal-active-line .terminal-input { flex-basis: 100%; min-height: 36px; }
    .terminal-titlebar { padding: 10px; }
    .sim-title { font-size: 1.75rem; }
}
