/*
 * A self-contained recreation of the classic jQuery UI "smoothness" button
 * look. Doesn't touch anything Bootstrap owns (no .btn-*, no .modal, etc -
 * checked against bootstrap-5.3.8.min.css directly) so the two can sit on
 * the same page without fighting each other.
 */

.ui-button
{
	display: inline-block;
	position: relative;
	padding: 0.4em 1em;
	margin: 0 0.2em 0.2em 0;
	border: 1px solid #c5c5c5;
	background: #f6f6f6;
	color: #454545;
	font-family: inherit;
	font-size: 1em;
	line-height: 1.4;
	text-align: center;
	text-decoration: none !important;
	vertical-align: middle;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	user-select: none;
}

.ui-corner-all
{
	border-radius: 4px;
}

a.ui-button
{
	display: inline-block;
}

.ui-button:hover,
.ui-button.ui-state-hover
{
	background: #ededed;
	border-color: #cccccc;
	color: #2b2b2b;
}

.ui-button.ui-state-active,
.ui-button:active
{
	background: #e2e2e2;
	border-color: #a5a5a5;
	color: #1f1f1f;
}

.ui-button.ui-state-focus
{
	outline: 2px solid rgba(0, 123, 255, 0.4);
	outline-offset: 1px;
}

.ui-button.ui-state-disabled,
.ui-button:disabled
{
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* Two buttons side by side (e.g. Save / Cancel) shouldn't have a visible
   gap-double-up from both the left button's right-margin AND button spacing
   you might add yourself - harmless either way, just a sensible default. */
.ui-button + .ui-button
{
	margin-left: 0;
}

/*
 * Dark mode - keyed on Bootstrap 5.3's own [data-bs-theme="dark"] attribute
 * (see theme.js for how/when that gets set), so this plugin follows the same
 * light/dark switch as the rest of the page rather than needing its own.
 */
[data-bs-theme="dark"] .ui-button
{
	border-color: #4d4d4d;
	background: #3a3a3a;
	color: #e4e4e4;
}

[data-bs-theme="dark"] .ui-button:hover,
[data-bs-theme="dark"] .ui-button.ui-state-hover
{
	background: #454545;
	border-color: #5c5c5c;
	color: #ffffff;
}

[data-bs-theme="dark"] .ui-button.ui-state-active,
[data-bs-theme="dark"] .ui-button:active
{
	background: #2b2b2b;
	border-color: #6e6e6e;
	color: #ffffff;
}

[data-bs-theme="dark"] .ui-button.ui-state-focus
{
	outline-color: rgba(90, 170, 255, 0.5);
}
