/* Atomic Proof – Frontend Code Block Styling
 *
 * Professional code windows with language header, line numbers,
 * and copy-to-clipboard button. Used on single cve_proof post pages.
 * Prism.js "Tomorrow Night" theme provides syntax highlighting colors.
 */

/* ==============================================
   Code Window Container
   ============================================== */
.atomic-proof-code-window {
	position: relative;
	margin: 1.5em 0;
	border-radius: 8px;
	overflow: hidden;
	background: #1d1f21;
	border: 1px solid #373b41;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Header bar — language label + copy button */
.atomic-proof-code-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 16px;
	background: #282a2e;
	border-bottom: 1px solid #373b41;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 12px;
	min-height: 36px;
}

/* Traffic-light dots (decorative – like a terminal/IDE window) */
.atomic-proof-code-dots {
	display: flex;
	gap: 6px;
	align-items: center;
}

.atomic-proof-code-dots span {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

.atomic-proof-code-dots span:nth-child(1) { background: #ff5f56; }
.atomic-proof-code-dots span:nth-child(2) { background: #ffbd2e; }
.atomic-proof-code-dots span:nth-child(3) { background: #27c93f; }

/* Language label */
.atomic-proof-code-lang {
	color: #969896;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 11px;
}

/* Copy button */
.atomic-proof-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 12px;
	border: 1px solid #4a4d52;
	border-radius: 4px;
	background: transparent;
	color: #969896;
	font-size: 12px;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
	line-height: 1.4;
}

.atomic-proof-copy-btn:hover {
	background: #373b41;
	color: #c5c8c6;
	border-color: #5a5d63;
}

.atomic-proof-copy-btn:active {
	background: #4a4d52;
}

.atomic-proof-copy-btn.copied {
	color: #27c93f;
	border-color: #27c93f;
}

/* Copy icon (SVG inline) */
.atomic-proof-copy-btn svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
	flex-shrink: 0;
}

/* ==============================================
   Code Body – Prism.js Overrides
   ============================================== */
.atomic-proof-code-window pre[class*="language-"] {
	margin: 0;
	padding: 16px;
	background: #1d1f21;
	border: none;
	border-radius: 0;
	font-size: 13px;
	line-height: 1.65;
	overflow-x: auto;
	max-height: 600px;
	overflow-y: auto;
	tab-size: 4;
}

.atomic-proof-code-window pre[class*="language-"] code {
	background: none;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', Consolas, Monaco, 'Courier New', monospace;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
}

/* Line numbers styling */
.atomic-proof-code-window pre.line-numbers {
	padding-left: 3.8em;
	counter-reset: linenumber;
}

.atomic-proof-code-window .line-numbers-rows {
	border-right: 1px solid #373b41;
	padding-right: 8px;
}

.atomic-proof-code-window .line-numbers-rows > span::before {
	color: #4a4d52;
}

/* Scrollbar styling for code blocks */
.atomic-proof-code-window pre::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

.atomic-proof-code-window pre::-webkit-scrollbar-track {
	background: #1d1f21;
}

.atomic-proof-code-window pre::-webkit-scrollbar-thumb {
	background: #4a4d52;
	border-radius: 4px;
}

.atomic-proof-code-window pre::-webkit-scrollbar-thumb:hover {
	background: #5a5d63;
}

/* ==============================================
   Single CVE Post Template
   ============================================== */
.atomic-proof-single {
	max-width: 900px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Section headings */
.atomic-proof-section-heading {
	font-size: 1.25em;
	font-weight: 700;
	margin: 2em 0 0.75em;
	padding-bottom: 0.4em;
	border-bottom: 2px solid #e5e7eb;
	color: #1d2327;
}

/* Vulnerability details card */
.atomic-proof-detail-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 24px;
	margin-bottom: 2em;
}

.atomic-proof-detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px 24px;
}

.atomic-proof-detail-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.atomic-proof-detail-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6b7280;
}

.atomic-proof-detail-value {
	font-size: 15px;
	color: #1d2327;
	font-weight: 500;
}

.atomic-proof-detail-value code {
	background: #f3f4f6;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 13px;
}

/* Severity badge (frontend) */
.atomic-proof-badge {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #fff;
}

.atomic-proof-badge--critical { background: #dc2626; }
.atomic-proof-badge--high     { background: #d97706; }
.atomic-proof-badge--medium   { background: #f59e0b; color: #1d2327; }
.atomic-proof-badge--low      { background: #16a34a; }

/* Description block */
.atomic-proof-description {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 16px 20px;
	margin: 1em 0 2em;
	line-height: 1.7;
	font-size: 15px;
	color: #374151;
}

/* Analysis content (Markdown from AI) */
.atomic-proof-analysis {
	line-height: 1.8;
	font-size: 16px;
	color: #1d2327;
}

.atomic-proof-analysis h2,
.atomic-proof-analysis h3,
.atomic-proof-analysis h4 {
	margin-top: 1.5em;
	margin-bottom: 0.5em;
}

.atomic-proof-analysis p {
	margin-bottom: 1em;
}

.atomic-proof-analysis ul,
.atomic-proof-analysis ol {
	margin-bottom: 1em;
	padding-left: 1.5em;
}

/* No-content message */
.atomic-proof-empty {
	color: #9ca3af;
	font-style: italic;
	padding: 12px 0;
}

/* Meta footer */
.atomic-proof-meta-footer {
	margin-top: 3em;
	padding: 16px 20px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	font-size: 13px;
	color: #6b7280;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
}

.atomic-proof-meta-footer span {
	white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
	.atomic-proof-detail-grid {
		grid-template-columns: 1fr;
	}

	.atomic-proof-code-header {
		flex-wrap: wrap;
		gap: 8px;
	}

	.atomic-proof-code-dots {
		display: none;
	}

	.atomic-proof-meta-footer {
		flex-direction: column;
	}
}
