/* ================================================================
   DinaZen Window Manager — dinazen-windows.css
   ================================================================
   Windows-style floating windows
   Taskbar CSS is scoped in .razor.css files
   ================================================================ */

:root {
	/* ── Window ── */
	--dnz-win-titlebar-h: 32px;
	--dnz-win-radius: 6px;
	--dnz-win-bg: #fff;
	--dnz-win-border: rgba(0, 0, 0, .12);
	--dnz-win-shadow: 0 4px 16px rgba(0, 0, 0, .10), 0 1px 4px rgba(0, 0, 0, .06);
	--dnz-win-shadow-focused: 0 8px 32px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .10);
	--dnz-win-titlebar-bg: #f3f3f3;
	--dnz-win-titlebar-bg-active: #fff;
	--dnz-win-titlebar-border: rgba(0, 0, 0, .06);

	/* ── Taskbar height (used by maximized windows) ── */
	--dnz-taskbar-h: 56px;
}


/* ================================================================
   WINDOW HOST
   ================================================================ */

.dnz-window-host {
	position: fixed;
	inset: 0;
	z-index: 1200;
	pointer-events: none;
	overflow: hidden;
}


/* ================================================================
   WINDOW
   ================================================================ */

.dnz-window {
	position: absolute;
	display: flex;
	flex-direction: column;
	background: var(--dnz-win-bg);
	border-radius: var(--dnz-win-radius);
	border: 1px solid var(--dnz-win-border);
	box-shadow: var(--dnz-win-shadow);
	overflow: hidden;
	pointer-events: auto;
	transition: box-shadow 200ms ease, border-radius 200ms ease;
	will-change: transform;
}

.dnz-window.dnz-win-focused {
	box-shadow: var(--dnz-win-shadow-focused);
}

.dnz-window.dnz-win-minimized {
	display: none;
}

.dnz-window.dnz-win-maximized {
	left: 0 !important;
	top: 0 !important;
	width: 100% !important;
	height: calc(100% - var(--dnz-taskbar-h) - 18px) !important;
	border-radius: 0;
}


/* ── Titlebar ── */

.dnz-win-titlebar {
	height: var(--dnz-win-titlebar-h);
	min-height: var(--dnz-win-titlebar-h);
	display: flex;
	align-items: center;
	padding: 0 0 0 12px;
	gap: 8px;
	background: var(--dnz-win-titlebar-bg);
	border-bottom: 1px solid var(--dnz-win-titlebar-border);
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}

.dnz-win-focused .dnz-win-titlebar {
	background: var(--dnz-win-titlebar-bg-active);
}

.dnz-win-titlebar:active {
	cursor: grabbing;
}

/* ── Window control buttons (Windows-style, right-aligned) ── */

.dnz-win-controls {
	display: flex;
	align-items: stretch;
	flex-shrink: 0;
	height: 100%;
}

.dnz-win-btn {
	width: 46px;
	height: 100%;
	border: none;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: #666;
	transition: background 120ms, color 120ms;
}

.dnz-win-btn svg {
	width: 10px;
	height: 10px;
}

.dnz-win-btn:hover {
	background: rgba(0, 0, 0, .06);
	color: #333;
}

.dnz-win-btn-close:hover {
	background: #e81123;
	color: #fff;
}

.dnz-window:not(.dnz-win-focused) .dnz-win-btn {
	color: #aaa;
}

/* ── Title area (left-aligned, Windows-style) ── */

.dnz-win-title {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	overflow: hidden;
}

.dnz-win-title-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	border-radius: 3px;
}

.dnz-win-title-text {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	line-height: 1.15;
}

.dnz-win-title-sub {
	font-size: 10px;
	font-weight: 400;
	color: #888;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 280px;
	letter-spacing: .02em;
}

.dnz-win-title-main {
	font-size: 12px;
	font-weight: 500;
	color: #1a1a1a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 320px;
}

.dnz-window:not(.dnz-win-focused) .dnz-win-title-main {
	color: #999;
}

.dnz-window:not(.dnz-win-focused) .dnz-win-title-sub {
	color: #bbb;
}

/* ── Title text sizes ── */


/* ── Window body ── */

.dnz-win-body {
	flex: 1;
	overflow: auto;
	min-height: 0;
}


/* ── Resize handles ── */

.dnz-win-resize {
	position: absolute;
	z-index: 1;
	pointer-events: auto;
}

/* Edge handles */
.dnz-win-resize[data-dir="n"] { top: -3px; left: 8px; right: 8px; height: 6px; cursor: n-resize; }
.dnz-win-resize[data-dir="s"] { bottom: -3px; left: 8px; right: 8px; height: 6px; cursor: s-resize; }
.dnz-win-resize[data-dir="e"] { right: -3px; top: 8px; bottom: 8px; width: 6px; cursor: e-resize; }
.dnz-win-resize[data-dir="w"] { left: -3px; top: 8px; bottom: 8px; width: 6px; cursor: w-resize; }

/* Corner handles */
.dnz-win-resize[data-dir="ne"] { top: -3px; right: -3px; width: 12px; height: 12px; cursor: ne-resize; }
.dnz-win-resize[data-dir="nw"] { top: -3px; left: -3px; width: 12px; height: 12px; cursor: nw-resize; }
.dnz-win-resize[data-dir="se"] { bottom: -3px; right: -3px; width: 12px; height: 12px; cursor: se-resize; }
.dnz-win-resize[data-dir="sw"] { bottom: -3px; left: -3px; width: 12px; height: 12px; cursor: sw-resize; }

/* Hide resize handles when maximized */
.dnz-win-maximized .dnz-win-resize { display: none; }
