:root {
	--desktop-teal: #008080;
	--win-bg: #c0c0c0;
	--win-mid: #b5b5b5;
	--win-dark: #808080;
	--win-darker: #404040;
	--win-light: #ffffff;
	--win-black: #000000;
	--title-active-left: #000080;
	--title-active-right: #1084d0;
	--title-inactive: #7f7f7f;
	--taskbar: #c0c0c0;
	--hyper: #0000ee;
	--visited: #551a8b;
	--accent: #ffd400;
	--selection-bg: #e0e0e0;
	--selection-text: #000000;
}

html,
body {
	height: 100%;
	margin: 0;
	background: url("/assets/wallpaper-v2.png") center center / cover no-repeat,
		repeating-linear-gradient(
			0deg,
			rgba(255, 255, 255, 0.04) 0 1px,
			transparent 1px 2px
		),
		radial-gradient(
			circle at 20% 10%,
			rgba(255, 255, 255, 0.06),
			transparent 35%
		),
		var(--desktop-teal);
	color: #000;
	font: 14px/1.25 Tahoma, "MS Sans Serif", Verdana, Arial, sans-serif;
	user-select: none;
	-webkit-font-smoothing: none;
	-moz-osx-font-smoothing: grayscale;
	image-rendering: pixelated;
	overflow: hidden;
	position: relative;
}

/* CRT Scanlines overlay */
body::after {
	content: "";
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: url("/assets/scanlines.png") repeat;
	pointer-events: none;
	z-index: 9999;
	opacity: 0.15;
	mix-blend-mode: multiply;
}

/* Text selection styling */
::selection {
	background: var(--selection-bg);
	color: var(--selection-text);
}
::-moz-selection {
	background: var(--selection-bg);
	color: var(--selection-text);
}

a {
	color: var(--hyper);
	text-decoration: none;
}
a:visited {
	color: var(--visited);
}
a:hover {
	text-decoration: underline;
}

/* Taskbar */
#taskbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	height: 36px;
	background: var(--taskbar);
	border-top: 2px solid var(--win-light);
	box-shadow: inset 0 2px 0 var(--win-mid), inset 0 -2px 0 var(--win-dark);
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 3px 6px;
	z-index: 1000;
}

.start-button {
	min-width: 86px;
	height: 28px;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 10px;
	background: var(--win-bg);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker)
		var(--win-light);
	box-shadow: inset -1px -1px 0 var(--win-dark), inset 1px 1px 0 var(--win-mid);
	font-weight: bold;
	cursor: pointer;
}
.start-button:active {
	border-color: var(--win-darker) var(--win-light) var(--win-light)
		var(--win-darker);
	box-shadow: inset 1px 1px 0 var(--win-dark), inset -1px -1px 0 var(--win-mid);
}

.start-icon {
	width: 18px;
	height: 18px;
	background: #fff url('/assets/bitagain-logo.png') center center / cover no-repeat;
	border: 1px solid #063;
	box-shadow: inset 1px 1px 0 #0fc, inset -1px -1px 0 #084;
}

.task-area {
	display: flex;
	gap: 6px;
	align-items: center;
	flex: 1;
	overflow: auto;
	padding-right: 6px;
}
.task-btn {
	height: 28px;
	min-width: 130px;
	max-width: 240px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	background: var(--win-bg);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker)
		var(--win-light);
	box-shadow: inset -1px -1px 0 var(--win-dark), inset 1px 1px 0 var(--win-mid);
	padding: 0 8px;
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}
.task-btn.active {
	background: #e7e7e7;
	border-color: var(--win-darker) var(--win-light) var(--win-light)
		var(--win-darker);
	box-shadow: inset 1px 1px 0 var(--win-dark), inset -1px -1px 0 var(--win-mid);
}

.clock {
	width: 86px;
	height: 28px;
	background: var(--win-bg);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker)
		var(--win-light);
	box-shadow: inset -1px -1px 0 var(--win-dark), inset 1px 1px 0 var(--win-mid);
	display: flex;
	align-items: center;
	justify-content: center;
	font-feature-settings: "tnum";
	cursor: pointer;
}
.clock:active {
	border-color: var(--win-darker) var(--win-light) var(--win-light)
		var(--win-darker);
	box-shadow: inset 1px 1px 0 var(--win-dark), inset -1px -1px 0 var(--win-mid);
}

/* Start menu */
#start-menu {
	position: fixed;
	left: 6px;
	bottom: 36px;
	width: 260px;
	background: var(--win-bg);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker)
		var(--win-light);
	box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
	display: none;
	z-index: 1200;
}
.menu-header {
	padding: 8px;
	color: #fff;
	background: linear-gradient(
		90deg,
		var(--title-active-left),
		var(--title-active-right)
	);
	font-weight: bold;
	letter-spacing: 0.3px;
}
.menu-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px;
	border-top: 1px solid var(--win-mid);
	cursor: pointer;
}
.menu-item:hover {
	background: #e7e7e7;
}
.menu-item .mini-icon {
	width: 18px;
	height: 18px;
	border: 1px solid var(--win-dark);
	background: linear-gradient(135deg, #ffd, #cc0);
}

/* Desktop icons */
.desktop {
	position: fixed;
	inset: 0;
	padding: 14px 10px 50px 10px;
}

/* Desktop selection rectangle */
.selection-rect {
	position: absolute;
	border: 1px dashed #000;
	background: rgba(224, 224, 224, 0.4);
	pointer-events: none;
	z-index: 100;
	display: none;
}
.icon-wrap {
	width: 86px;
	margin: 8px;
	color: #fff;
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
	cursor: default;
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: background-color 0.15s ease;
}

.icon-wrap.selected {
	background: rgba(224, 224, 224, 0.6);
	border: 1px dotted #000;
	padding: 2px;
	margin: 6px;
}
.icon-wrap .icon {
	width: 48px;
	height: 48px;
	margin: 0 auto 6px;
	background: #fff3;
	border: 1px solid #0005;
	display: grid;
	place-items: center;
	backdrop-filter: blur(0.2px);
}
.icon-wrap .label {
	background: rgba(0, 0, 0, 0.35);
	padding: 3px 6px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 2px;
	white-space: nowrap;
	display: block;
	text-align: center;
}
.icon-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 120px;
}

/* Windows */
.window {
	position: absolute;
	background: var(--win-bg);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker)
		var(--win-light);
	box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
	min-width: 300px;
}
.window.hidden {
	display: none;
}
.window.active {
	outline: 1px dotted #000;
}
.titlebar {
	height: 22px;
	display: flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-weight: bold;
	padding: 0 4px;
	background: linear-gradient(
		90deg,
		var(--title-active-left),
		var(--title-active-right)
	);
	cursor: move;
}
.titlebar.inactive {
	background: var(--title-inactive);
	color: #e6e6e6;
}
.title-icon {
	width: 16px;
	height: 16px;
	background: #fff url('/assets/bitagain-logo.png') center center / cover no-repeat;
	border: 1px solid #630;
}
.title-text {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.win-controls {
	display: flex;
	gap: 2px;
}
.ctrl {
	width: 18px;
	height: 18px;
	background: var(--win-bg);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker)
		var(--win-light);
	box-shadow: inset -1px -1px 0 var(--win-dark), inset 1px 1px 0 var(--win-mid);
	display: grid;
	place-items: center;
	cursor: pointer;
	color: #000;
	font-weight: bold;
}
.ctrl:active {
	border-color: var(--win-darker) var(--win-light) var(--win-light)
		var(--win-darker);
	box-shadow: inset 1px 1px 0 var(--win-dark), inset -1px -1px 0 var(--win-mid);
}
.ctrl-max {
	font-weight: 900;
	font-size: 16px;
	line-height: 1;
}
.window .content {
	padding: 8px;
}

.group {
	border: 2px solid;
	border-color: var(--win-dark) var(--win-light) var(--win-light)
		var(--win-dark);
	padding: 8px;
	background: #e6e6e6;
	margin: 6px 0;
}
.group legend {
	font-size: 11px;
	padding: 0 6px;
	background: var(--win-bg);
	border: 1px solid var(--win-mid);
	margin-left: 6px;
}

.btn-95 {
	background: var(--win-bg);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker)
		var(--win-light);
	box-shadow: inset -1px -1px 0 var(--win-dark), inset 1px 1px 0 var(--win-mid);
	padding: 6px 10px;
	cursor: pointer;
	white-space: nowrap;
}
.btn-95:active {
	border-color: var(--win-darker) var(--win-light) var(--win-light)
		var(--win-darker);
	box-shadow: inset 1px 1px 0 var(--win-dark), inset -1px -1px 0 var(--win-mid);
}

.status {
	font-family: "Lucida Console", "Courier New", monospace;
	background: #000;
	color: #0f0;
	padding: 8px;
	height: 120px;
	overflow: auto;
	border: 2px inset var(--win-dark);
}

.hstrip {
	height: 18px;
	background: linear-gradient(#f5f5f5, #dcdcdc);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker)
		var(--win-light);
	box-shadow: inset -1px -1px 0 var(--win-dark), inset 1px 1px 0 var(--win-mid);
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 6px;
	margin: 6px 0;
}

.badge {
	display: inline-block;
	padding: 3px 6px;
	background: #000080;
	color: #fff;
	border: 1px solid var(--win-black);
	font-weight: bold;
	letter-spacing: 0.3px;
}

.table {
	width: 100%;
	border-collapse: collapse;
	background: #eee;
	border: 2px inset var(--win-dark);
}
.table th,
.table td {
	border: 1px solid var(--win-dark);
	padding: 6px;
	text-align: left;
	background: #fafafa;
}
.table th {
	background: #dcdcdc;
}

/* BSOD overlay */
#bsod {
	position: fixed;
	inset: 0;
	z-index: 2000;
	background: #0000aa;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font: 16px/1.5 "Lucida Console", "Courier New", monospace;
}
.bsod-inner {
	max-width: 900px;
	padding: 20px;
	text-shadow: 1px 1px 0 #000;
}
.bsod-title {
	font-size: 20px;
	margin-bottom: 12px;
}
.bsod-hr {
	height: 2px;
	background: #fff;
	margin: 12px 0;
}
.blink {
	animation: blink 1.2s steps(2, end) infinite;
}
@keyframes blink {
	50% {
		opacity: 0;
	}
}

/* Calendar styles */
.calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
	gap: 8px;
}

.calendar-header span {
	flex: 1;
	text-align: center;
	font-weight: bold;
}

.calendar-header button {
	padding: 4px 8px;
	min-width: 24px;
}

.calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 1px;
	background: var(--win-dark);
	border: 2px inset var(--win-dark);
	margin-bottom: 8px;
}

.calendar-day-header {
	background: #dcdcdc;
	padding: 4px 2px;
	text-align: center;
	font-weight: bold;
	font-size: 11px;
	border: 1px solid var(--win-mid);
}

.calendar-day {
	background: #fff;
	padding: 4px 2px;
	text-align: center;
	font-size: 11px;
	min-height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: 1px solid #f0f0f0;
}

.calendar-day:hover {
	background: #e7e7e7;
}

.calendar-day.other-month {
	color: #999;
	background: #f5f5f5;
}

.calendar-day.today {
	background: var(--title-active-left);
	color: #fff;
	font-weight: bold;
}

.calendar-day.selected {
	background: var(--accent);
	color: #000;
	font-weight: bold;
}

.calendar-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 11px;
}

.calendar-footer button {
	padding: 4px 8px;
	font-size: 11px;
}

#cal-today-info {
	flex: 1;
	color: #666;
}

/* Desktop context menu */
.context-menu {
	position: fixed;
	background: var(--win-bg);
	border: 2px solid;
	border-color: var(--win-light) var(--win-darker) var(--win-darker) var(--win-light);
	box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
	z-index: 1500;
	display: none;
	min-width: 180px;
}

.context-menu-item {
	padding: 6px 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	border-bottom: 1px solid var(--win-mid);
}

.context-menu-item:last-child {
	border-bottom: none;
}

.context-menu-item:hover {
	background: #316ac5;
	color: #fff;
}

.context-menu-item.disabled {
	color: #808080;
	cursor: default;
}

.context-menu-item.disabled:hover {
	background: transparent;
	color: #808080;
}

.context-menu-separator {
	height: 1px;
	background: var(--win-dark);
	margin: 2px 0;
	border: none;
}

.context-menu-icon {
	width: 16px;
	height: 16px;
	background: var(--win-mid);
	border: 1px solid var(--win-dark);
}
