:root {
	/* Color Palette */
	--bg-primary: #121212;
	--bg-secondary: #1e1e1e;
	--bg-tertiary: #2c2c2c;

	--text-primary: #e0e0e0;
	--text-secondary: #a0a0a0;
	--text-muted: #666666;

	--accent-color: #3b82f6;
	/* Blue */

	/* Status Colors */
	--status-healthy: #10b981;
	--status-degraded: #f59e0b;
	--status-outage: #ef4444;
	--status-none: #3f3f46;

	/* Spacing & Layout */
	--container-width: 800px;
	--border-radius: 8px;
	--card-padding: 24px;
}

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

body {
	background-color: var(--bg-primary);
	color: var(--text-primary);
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	line-height: 1.6;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
	padding: 40px 20px;
}

.container {
	width: 100%;
	max-width: var(--container-width);
}

/* Header */
header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 40px;
}

.logo-area {
	display: flex;
	align-items: center;
	gap: 12px;
}

.logo-area h1 {
	font-weight: 700;
	font-size: 1.5rem;
	letter-spacing: -0.02em;
}

.logo {
	width: 42px;
	height: auto;
}

/* Global Summary */
#global-summary {
	margin-bottom: 30px;
}

.summary-card {
	background: var(--bg-secondary);
	padding: 20px;
	border-radius: var(--border-radius);
	border: 1px solid var(--bg-tertiary);
	display: flex;
	align-items: center;
	gap: 15px;
}

.summary-card.healthy {
	background: rgba(16, 185, 129, 0.1);
	border-color: rgba(16, 185, 129, 0.2);
	color: #34d399;
}

.summary-card.error {
	background: rgba(239, 68, 68, 0.1);
	border-color: rgba(239, 68, 68, 0.2);
	/* No generic color here, specifics in children */
}

.status-icon {
	font-size: 24px;
}

/* Main Content */
main {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.site {
	background: var(--bg-secondary);
	border-radius: var(--border-radius);
	padding: var(--card-padding);
	border: 1px solid var(--bg-tertiary);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.site-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--bg-tertiary);
	padding-bottom: 15px;
}

.site-header h2 {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0;
}

.site-uptime {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--status-healthy);
	background: rgba(16, 185, 129, 0.1);
	padding: 4px 10px;
	border-radius: 20px;
}

/* Endpoint */
.endpoint {
	margin-bottom: 24px;
}

.endpoint:last-child {
	margin-bottom: 0;
}

.endpoint-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 8px;
}

.endpoint-header h3 {
	font-size: 1rem;
	font-weight: 500;
	color: var(--text-primary);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.endpoint-meta {
	font-size: 0.85rem;
	color: var(--text-secondary);
}

.link-icon {
	color: var(--text-muted);
	font-size: 16px;
	text-decoration: none;
	transition: color 0.2s;
}

.link-icon:hover {
	color: var(--text-primary);
}

/* Status Bar */
status-bar {
	display: flex;
	gap: 3px;
	height: 32px;
	/* We don't use 'overflow: hidden' so tooltips can float out if needed, 
       but usually tooltips need absolute positioning relative to a parent.
       Here we'll keep it simple. */
}

status-bar-entry {
	flex: 1;
	background: var(--status-none);
	border-radius: 2px;
	position: relative;
	transition: opacity 0.2s;
	cursor: pointer;
}

status-bar-entry:hover {
	opacity: 0.8;
}

status-bar-entry[data-status="healthy"] {
	background: var(--status-healthy);
}

status-bar-entry[data-status="degraded"] {
	background: var(--status-degraded);
}

status-bar-entry[data-status="outage"] {
	background: var(--status-outage);
}

/* Tooltip */
status-bar-entry .tooltip {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-8px);
	background: #333;
	color: white;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 0.8rem;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s, transform 0.2s;
	z-index: 10;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
	text-align: center;
}

status-bar-entry .tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border-width: 5px;
	border-style: solid;
	border-color: #333 transparent transparent transparent;
}

status-bar-entry:hover .tooltip {
	opacity: 1;
	transform: translateX(-50%) translateY(-4px);
}

.tooltip-time {
	display: block;
	font-weight: 600;
	margin-bottom: 2px;
	color: #e0e0e0;
}

.tooltip-metric {
	color: #a0a0a0;
}

/* Footer */
footer {
	margin-top: 60px;
	text-align: center;
	color: var(--text-muted);
	font-size: 0.9rem;
}

footer a {
	color: var(--text-secondary);
	text-decoration: none;
	border-bottom: 1px dotted var(--text-muted);
	transition: color 0.2s, border-color 0.2s;
}

footer a:hover {
	color: var(--accent-color);
	border-bottom-color: var(--accent-color);
}

/* Error Notice */
error-notice {
	display: block;
	margin-bottom: 20px;
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
	padding: 12px 16px;
	border-radius: var(--border-radius);
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.issue-list {
	list-style: none;
	margin-top: 5px;
}

.issue-list li {
	margin-bottom: 4px;
}

error-notice:empty {
	display: none;
}

/* Global sizing and overflow protection */
html,
body {
	width: 100%;
	overflow-x: hidden;
	/* Prevent horizontal scroll */
}

@media screen and (max-width: 600px) {
	body {
		padding: 20px 10px;
		display: block;
		/* Switch from flex to block on mobile for simpler centering */
	}

	.container {
		width: 100%;
		margin: 0 auto;
		/* Center the container */
		max-width: 100%;
	}

	header {
		flex-direction: column;
		gap: 15px;
		text-align: center;
		width: 100%;
	}

	.logo-area {
		justify-content: center;
	}

	/* Wrap header content if needed */
	.site-header {
		flex-wrap: wrap;
		gap: 8px;
	}

	.site-header h2 {
		font-size: 1.1rem;
	}

	/* Tighter status bars for mobile */
	status-bar {
		gap: 1px;
		min-width: 0;
		/* Prevent overflow */
	}

	.site {
		padding: 16px 12px;
		/* Slightly less padding */
	}

	.logo-area h1 {
		font-size: 1.4rem;
	}

	/* Adjust header status */
	#header-status {
		font-size: 0.9rem;
		width: 100%;
		display: flex;
		justify-content: center;
	}
}