/* 
1. table
2. dialog
3. panel
4. scrollbar
 */

/* Simple Class */
.hidden {
	display: none !important;
}

.text-left {
	text-align: left;
}

.text-right {
	text-align: right;
}

.text-center {
	text-align: center;
}

.mobile-only {
	display: none;
}

table {
	width: 100%;
	border-collapse: collapse;
}

button,
[role="button"] {
	padding: 8px 10px;
	background-color: transparent;
	border: 1px solid #d8d7da;
	font-weight: 600;
	border-radius: 3px;
	cursor: pointer;
	user-select: none;

	&.primary {
		color: white;
		background-color: #48acc9;
		border: none;

		&:hover {
			background-color: #3a8ba2;
		}
	}

	&.secondary {
		color: white;
		background-color: #f29135;
		border: none;

		&:hover {
			background-color: #be722a;
		}
	}

	&.danger {
		color: white;
		background-color: #dc3545;
		border: none;

		&:hover{
			background-color: #c82333;
		}
	}

	&.cancel {
		color: white;
		background-color: #6c757d;
		border: none;

		&:hover {
			background-color: #5a6268;
		}
	}

	&[disabled] {
		color: white;
		background-color: #6c757d;
		border: none;
		cursor: not-allowed;

		&:hover {
			background-color: #6c757d;
		}
	}
}

/* Dialog css */
dialog {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-height: 95%;
	height: 650px;
	width: 60%;
	border: 0;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
	border-bottom: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 5px;
	padding: 0;
	overflow-y: auto;

	&::-webkit-scrollbar, ::-webkit-scrollbar {
		width: 0;
		height: 0;
	}

	.header {
		padding: 15px;
		border: 1px solid #e5e5e5;
	}

	.body {
		padding: 15px;
		display: flex;
		flex-direction: column;
		row-gap: 1rem;
	}

	.footer {
		padding: 15px;
		text-align: right;
		border-top: 1px solid #e5e5e5;

		position:sticky;
		bottom: 0;
		left: 0;
		right: 0;
		background-color: white;
	}
}

::backdrop {
	background-image: linear-gradient(to bottom, black, black);
	opacity: 0.75;
}

body:has(dialog[open]) {
	overflow: hidden;
}

.panel {
	border-radius: 1rem;
	overflow: hidden;
	background-color: white;

	display: flex; 
	flex-direction: column;

	&>* {
		padding: 20px 30px;
	}

	.header {
		background-color: #054973;
		color: white;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.body {
		padding: 20px 30px;
		flex: 1 1 0;
	}

	.footer {
		padding: 20px 30px;
	}
}

/* Scrollbar */
::-webkit-scrollbar {
	/* width */
	width: 7px;
	height: 7px;
}

::-webkit-scrollbar-track {
	/* Track */
	background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
	/* Handle */
	background: #888;
	border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
	/* Handle on hover */
	background: #555;
}

/* Input number */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

@media screen and (max-width: 991px) {
	.mobile-only {
		display: initial;
	}

	.desktop-only {
		display: none;
	}
	
	dialog {
		width: 90%;
	}
}

