@use "../../styles/abstracts" as *;

.devPanelContainer {
	@include scrollbar;

	position: fixed;
	z-index: var(--dev-panel-z-index);
	border-radius: var(--dev-panel-border-radius);
	box-shadow: var(--dev-panel-shadow);
	width: var(--dev-panel-max-width);
	min-width: var(--dev-panel-min-width);
	user-select: none;
	font-family: var(--dev-panel-font-family);
	font-size: var(--dev-panel-font-size-sm);
	line-height: var(--dev-panel-line-height-normal);
	touch-action: none;
	background: var(--dev-panel-foreground-color);
	border: 1px solid var(--dev-panel-border-color);

	& * {
		box-sizing: border-box;
	}

	.header {
		position: sticky;
		top: 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: var(--dev-panel-spacing-md) var(--dev-panel-spacing-lg);
		background: var(--dev-panel-foreground-color);
		color: var(--dev-panel-text-color);
		cursor: move;
		border-bottom: 1px solid var(--dev-panel-border-color);
		height: var(--dev-panel-header-height);
		border-radius: var(--dev-panel-border-radius) var(--dev-panel-border-radius) 0 0;
		z-index: 1;
	}

	.title {
		font-size: var(--dev-panel-font-size-sm);
		font-weight: var(--dev-panel-font-weight-semibold);
		display: flex;
		align-items: center;
		gap: var(--dev-panel-spacing-md);
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		color: var(--dev-panel-text-color);
		pointer-events: none;
	}

	.button {
		background: none;
		border: none;
		color: var(--dev-panel-text-color-muted);
		font-size: var(--dev-panel-font-size-md);
		cursor: pointer;
		padding: var(--dev-panel-spacing-sm);
		border-radius: var(--dev-panel-border-radius-md);
		transition: var(--dev-panel-transition);
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 24px;
		min-height: 24px;

		&:hover {
			background: var(--dev-panel-surface-color-hover);
			color: var(--dev-panel-text-color);
		}

		&:active {
			transform: scale(0.95);
			background: var(--dev-panel-surface-color-active);
		}

		&:focus {
			outline: 2px solid var(--dev-panel-accent-color);
			outline-offset: 2px;
		}

		&:focus:not(:focus-visible) {
			outline: none;
		}

		> svg {
			display: block;
			width: 16px;
			height: 16px;
			transition: transform var(--dev-panel-transition);

			&.collapsed {
				transform: rotate(180deg);
			}

			path {
				fill: currentColor;
			}
		}
	}
}

.content {
	max-height: calc(var(--dev-panel-max-height) - var(--dev-panel-header-height));
	background-color: var(--dev-panel-background-color);
	border-radius: 0 0 var(--dev-panel-border-radius) var(--dev-panel-border-radius);
	overflow-x: hidden;
	overflow-y: auto;
	max-height: var(--dev-panel-max-height);
}
