:root {
	--bg-dark: #121212;
	--bg-darker: #0a0a0a;
	--bg-light: #1e1e1e;
	--accent: #4a6fa5;
	--accent-hover: #5a8ad8;
	--text-primary: #f0f0f0;
	--text-secondary: #b0b0b0;
	--border: #333;
	--border-light: #444;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--bg-dark);
	color: var(--text-primary);
	font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
	line-height: 1.6;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

h1 {
	text-align: center;
	margin: 20px 0;
	color: var(--text-primary);
	font-weight: 300;
	letter-spacing: 0.5px;
}

#controls {
	background-color: var(--bg-light);
	padding: 20px;
	border-radius: 8px;
	max-width: 800px;
	width: 50%;  
	margin: 0 auto 20px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.control-group {
	margin-bottom: 15px;
}

.control-group label {
	display: block;
	margin-bottom: 5px;
	color: var(--text-secondary);
	font-size: 0.9rem;
}

input[type="file"],
input[type="text"] {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: 4px;
	background-color: var(--bg-darker);
	color: var(--text-primary);
	margin-bottom: 10px;
	box-sizing: border-box;
}

input[type="file"]:focus,
input[type="text"]:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.3);
}

.checkbox-container {
	display: flex;
	align-items: center;
	margin: 10px 0;
}

.checkbox-container input {
	margin-right: 8px;
}

#runBtn {
	background-color: var(--accent);
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1rem;
	width: 100%;
	transition: background-color 0.2s;
}

#runBtn:hover {
	background-color: var(--accent-hover);
}

#runBtn:disabled {
	background-color: #555;
	cursor: not-allowed;
	opacity: 0.7;
}

#viewer {
	background-color: var(--bg-darker);
	padding: 20px;
	border-radius: 8px;
	margin: 20px auto;
	max-width: 95%;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.result-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0 auto;
	background-color: var(--bg-light);
	padding: 20px;
	border-radius: 6px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	max-width: 800px;
	width: 100%;
}

canvas {
	image-rendering: pixelated;
	border: 1px solid var(--border);
	border-radius: 4px;
	margin-bottom: 10px;
	max-width: 100%;
}

.colorbar {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-left: 15px;
}

.colorbar canvas {
	width: 20px;
	height: 100%;
	border-radius: 3px;
}

.colorbar-label {
	font-size: 0.75rem;
	text-align: center;
	color: var(--text-secondary);
	margin: 5px 0;
}

.angle-label {
	font-size: 0.85rem;
	margin-top: 10px;
	color: var(--text-secondary);
	font-weight: 500;
	text-align: center;
}

/* Angle selector styles */
#angleSelectorContainer {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 25px 0;
}

#angleSelector {
	width: 350px;
	height: 350px;
	border-radius: 50%;
	background-color: var(--bg-darker);
	position: relative;
	cursor: crosshair;
	border: 2px solid var(--border-light);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#anglePreview {
	position: absolute;
	background-color: rgba(0, 0, 0, 0.8);
	padding: 8px 12px;
	border-radius: 4px;
	pointer-events: none;
	display: none;
	color: white;
	font-size: 0.9rem;
	z-index: 10;
}

#currentAngle {
	margin-top: 15px;
	font-size: 1.1rem;
	color: var(--text-primary);
	background-color: var(--bg-light);
	padding: 8px 15px;
	border-radius: 20px;
	font-weight: 500;
}

#angleIndicator {
	position: absolute;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: #ff4757;
	transform: translate(-50%, -50%);
	display: none;
	box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.5);
	z-index: 5;
}

.result-display {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	#controls {
		padding: 15px;
	}
	#angleSelector {
		width: 200px;
		height: 200px;
	}
	.result-display {
		flex-direction: column;
	}
	.colorbar {
		margin-left: 0;
		margin-top: 15px;
		flex-direction: row;
	}
	.colorbar canvas {
		width: 100%;
		height: 20px;
	}
	.colorbar-label {
		margin: 0 10px;
	}
}

/* Scrollbar styling */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}
::-webkit-scrollbar-track {
	background: var(--bg-light);
}
::-webkit-scrollbar-thumb {
	background: var(--border-light);
	border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
	background: var(--accent);
}

.tooltip-icon {
	display: inline-block;
	width: 16px;
	height: 16px;
	background-color: var(--accent);
	color: var(--text-primary);
	border-radius: 50%;
	text-align: center;
	font-size: 12px;
	line-height: 16px;
	margin-left: 5px;
	cursor: help;
	position: relative;
}

.tooltip-text {
	visibility: hidden;
	width: 200px;
	background-color: var(--bg-light);
	color: var(--text-primary);
	text-align: center;
	border-radius: 6px;
	padding: 8px;
	position: absolute;
	z-index: 1;
	bottom: 125%;
	left: 50%;
	transform: translateX(-50%);
	opacity: 0;
	transition: opacity 0.3s;
	border: 1px solid var(--border);
	font-size: 0.8rem;
	font-weight: normal;
	pointer-events: none;
}

.tooltip-icon:hover .tooltip-text {
	visibility: visible;
	opacity: 1;
}

.tooltip-text::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border-width: 5px;
	border-style: solid;
	border-color: var(--bg-light) transparent transparent transparent;
}

/* Author link styles */
.author-link {
	text-align: center;
	margin-top: -15px;
	margin-bottom: 20px;
}

.author-link a {
	color: var(--text-secondary);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: color 0.2s;
	font-size: 0.9rem;
}

.author-link a:hover {
	color: var(--accent);
}

.author-link svg {
	width: 16px;
	height: 16px;
}