
@use 'mixins.scss';
@use 'common.scss';

div.dt-buttons {
	div.btn-group {
		position: initial;
	}

	span.dt-button-spacer {
		&.empty {
			margin: 1px;
		}

		&.bar {
			&:empty {
				height: inherit;
			}
		}
	}

	.btn.processing {
		@include mixins.dtb-processing();
	}
}

div.dt-button-collection {
	position: absolute;
	min-width: 200px;
	margin-top: 4px;
	z-index: 2002;

	// Need to move the dropdown styling to the container to allow for the title
	background-color: var(--bs-body-bg);
	border: var(--bs-border-width) solid var(--bs-border-color);
	border-radius: var(--bs-border-radius);
	box-shadow: var(--bs-box-shadow);

	div.dt-button-collection-title {
		padding: 0.75em 0 0.25em;
	}

	.dropdown-menu {
		position: relative;
		display: block;
		width: 100%;

		// Moved to collection container
		background-color: transparent;
		border: none;
		border-radius: 0;
		box-shadow: none;
	}

	.dt-button {
		position: relative;

		&.dropdown-toggle {
			&::after {
				position: absolute;
				right: 12px;
				top: 14px;
			}
		}
	}

	div.dt-button-split {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-start;
		align-content: flex-start;
		align-items: stretch;

		> *:first-child {
			min-width: auto;
			flex: 1 0 50px;
		}

		button:last-child {
			min-width: 33px;
			flex: 0;
			background: transparent;
			border: none;
			line-height: 1rem;
			color: var(--bs-dropdown-link-color);
			padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
			overflow: visible;

			&:hover {
				color: var(--bs-dropdown-link-hover-color);
				background-color: var(--bs-dropdown-link-hover-bg);
			}
		}
	}

	@include mixins.dtb-fixed-collection();
}


div.dt-button-background {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999;
}

@media screen and (max-width: 767px) {
	div.dt-buttons {
		float: none;
		width: 100%;
		text-align: center;
		margin-bottom: 0.5em;

		a.btn {
			float: none;
		}
	}
}

div.dt-button-info {
	background-color: var(--bs-body-bg);
	border: 1px solid var(--bs-border-color-translucent);
}

:root[data-bs-theme="dark"] {
	div.dt-button-collection.fixed  {
		background-color: var(--bs-body-bg);
		border: 1px solid var(--bs-border-color-translucent);
	}
}
