// =============================================================================
// Mixins
// =============================================================================

// Scrollbar styling mixin
@mixin scrollbar {
	scrollbar-width: thin;
	scrollbar-color: var(--dev-panel-scrollbar-thumb-color) var(--dev-panel-scrollbar-track-color);

	&::-webkit-scrollbar {
		width: var(--dev-panel-scrollbar-width);
		height: var(--dev-panel-scrollbar-width);
	}

	&::-webkit-scrollbar-track {
		background: var(--dev-panel-scrollbar-track-color);
		border-radius: var(--dev-panel-border-radius-md);
	}

	&::-webkit-scrollbar-thumb {
		background: var(--dev-panel-scrollbar-thumb-color);
		border-radius: var(--dev-panel-border-radius-md);
		transition: var(--dev-panel-transition-fast);

		&:hover {
			background: var(--dev-panel-scrollbar-thumb-hover-color);
		}
	}

	&::-webkit-scrollbar-corner {
		background: var(--dev-panel-scrollbar-track-color);
	}
}

// Focus ring mixin
@mixin focus-ring {
	&:focus {
		outline: 2px solid var(--dev-panel-accent-color);
		outline-offset: 2px;
	}

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

// Interactive element mixin
@mixin interactive {
	transition: var(--dev-panel-transition);
	cursor: pointer;

	&:hover {
		opacity: var(--dev-panel-opacity-80);
	}

	&:active {
		transform: scale(0.98);
	}

	&:disabled {
		opacity: var(--dev-panel-opacity-50);
		cursor: not-allowed;
		pointer-events: none;
	}
}

// Button base styles mixin
@mixin button-base {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--dev-panel-spacing-sm);
	padding: var(--dev-panel-spacing-sm) var(--dev-panel-spacing-lg);
	font-family: var(--dev-panel-font-family);
	font-size: var(--dev-panel-font-size-sm);
	font-weight: var(--dev-panel-font-weight-medium);
	line-height: var(--dev-panel-line-height-tight);
	border: var(--dev-panel-input-border-width) solid transparent;
	border-radius: var(--dev-panel-border-radius);
	background: transparent;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
	user-select: none;
	transition: var(--dev-panel-transition);
	cursor: pointer;

	&:disabled {
		opacity: var(--dev-panel-opacity-50);
		cursor: not-allowed;
		pointer-events: none;
	}
}

// Input base styles mixin
@mixin input-base {
	display: block;
	width: 100%;
	height: var(--dev-panel-inputs-height-sm);
	padding: var(--dev-panel-spacing-sm) var(--dev-panel-spacing-md);
	font-family: var(--dev-panel-font-family);
	font-size: var(--dev-panel-font-size-sm);
	line-height: var(--dev-panel-line-height-normal);
	color: var(--dev-panel-input-text-color);
	background-color: var(--dev-panel-input-background-color);
	border: var(--dev-panel-input-border-width) solid var(--dev-panel-input-border-color);
	border-radius: var(--dev-panel-border-radius);
	transition: var(--dev-panel-transition);

	&::placeholder {
		color: var(--dev-panel-input-placeholder-color);
	}

	&:hover:not(:disabled) {
		border-color: var(--dev-panel-input-border-color-hover);
	}

	&:focus {
		outline: none;
		border-color: var(--dev-panel-input-border-color-focus);
		box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
	}

	&:disabled {
		opacity: var(--dev-panel-opacity-50);
		background-color: var(--dev-panel-surface-color);
		border-color: var(--dev-panel-border-color);
		cursor: not-allowed;
	}
}

// Reset button styles mixin
@mixin reset-button {
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
}
