/* Deck words table & container */
.deck-table-toolbar {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.deck-scroll-hint {
	color: #94a3b8;
	font-size: 0.8rem;
	user-select: none;
	display: flex;
	align-items: center;
}

.deck-table-container {
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
	margin-bottom: 1.5rem;
	border-radius: 4px;
	-webkit-overflow-scrolling: touch;
	overflow-x: auto;
	overflow-y: hidden;
	max-width: 100%;
}

@media screen and (min-width: 769px) {
	.deck-table-container.table-container,
	.deck-table-container {
		overflow-x: visible;
		overflow-y: visible;
	}
}

.deck-table-container::-webkit-scrollbar {
	height: 6px;
}

.deck-table-container::-webkit-scrollbar-track {
	background: transparent;
}

.deck-table-container::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.25);
	border-radius: 3px;
}

body.light-mode .deck-table-container,
.page-index .deck-table-container {
	scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

body.light-mode .deck-table-container::-webkit-scrollbar-thumb,
.page-index .deck-table-container::-webkit-scrollbar-thumb {
	background-color: rgba(0, 0, 0, 0.25);
}

.deck-words-table {
	width: 100%;
	min-width: 680px;
	margin: 0 auto;
	text-align: left;
}

.deck-words-table th {
	vertical-align: middle;
}

.deck-words-table .select-col {
	width: 44px;
	min-width: 44px;
	text-align: center;
	vertical-align: middle;
}

.deck-words-table .select-col input[type="checkbox"] {
	cursor: pointer;
	transform: scale(1.15);
	vertical-align: middle;
}

.deck-words-table .audio-col {
	width: 44px;
	min-width: 44px;
	text-align: center;
	vertical-align: middle;
}

.deck-words-table .thai-col {
	white-space: nowrap;
}

.deck-words-table .trans-col {
	white-space: nowrap;
}

.deck-words-table .class-col {
	white-space: nowrap;
}

/* Add Words to Deck Modal & Search Results Table */
#addWords_modal_div {
	box-sizing: border-box;
	max-width: 100vw;
	overflow: hidden;
}

#addWords_modal_div .modal-card {
	box-sizing: border-box;
	width: calc(100% - 32px);
	max-width: calc(100% - 32px);
	margin: 0 auto !important;
	max-height: calc(100vh - 160px);
	max-height: min(72dvh, calc(100dvh - 150px));
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

@media screen and (min-width: 768px) {
	#addWords_modal_div .modal-card {
		width: 92%;
		max-width: 780px;
		max-height: calc(100vh - 80px);
		max-height: min(85dvh, calc(100dvh - 80px));
	}
}

@media screen and (min-width: 1024px) {
	#addWords_modal_div .modal-card {
		width: 88%;
		max-width: 960px;
		max-height: calc(100vh - 60px);
		max-height: min(88dvh, calc(100dvh - 60px));
	}
}

@media screen and (min-width: 1408px) {
	#addWords_modal_div .modal-card {
		width: 80%;
		max-width: 1040px;
	}
}

@media screen and (max-width: 767px) {
	#addWords_modal_div {
		padding: 10px 8px;
		/* Extra bottom clearance to float above mobile Safari bottom address bar & home indicator */
		padding-bottom: max(1rem, calc(env(safe-area-inset-bottom, 20px) + 55px));
		align-items: center;
		justify-content: center;
	}
	#addWords_modal_div .modal-card {
		width: calc(100% - 32px);
		max-width: calc(100% - 32px);
		margin: 0 auto !important;
		max-height: calc(100vh - 180px);
		max-height: min(70dvh, calc(100dvh - 160px));
	}
	#addWords_modal_div .modal-card-head {
		padding: 0.65rem 0.75rem;
	}
	#addWords_modal_div .modal-card-foot {
		padding: 0.65rem 0.75rem;
	}
	#addWords_modal_div .modal-card-body {
		padding: 0.75rem 0.75rem;
	}
	#addWords_modal_div .modal-card-title {
		font-size: 1.05rem;
	}
}

#addWords_modal_div .modal-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	min-width: 0;
	width: 100%;
	flex-shrink: 0;
}

#addWords_modal_div .modal-card-title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#addWords_modal_div .modal-card-head .delete {
	flex-shrink: 0;
	margin-left: 0.5rem;
}

#addWords_modal_div .modal-card-body {
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%;
	width: 100%;
	overflow-x: hidden;
	overflow-y: auto;
}

.add-words-search-field {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	gap: 0.35rem;
	margin-bottom: 0.75rem;
}

.add-words-search-field.field.is-grouped > .control:not(:last-child) {
	margin-right: 0;
}

.add-words-search-field .add-words-search-label {
	white-space: nowrap;
	margin-bottom: 0;
	margin-right: 0.2rem;
	font-size: 0.95rem;
	flex-shrink: 0;
}

.add-words-search-field .control.is-expanded {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
}

.add-words-search-field .control.is-expanded .input {
	width: 100%;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
	font-size: 16px; /* Prevents iOS Safari from auto-zooming viewport on focus */
}

.add-words-search-field .control:last-child {
	flex-shrink: 0;
}

.add-words-search-field #searchBtn {
	white-space: nowrap;
	flex-shrink: 0;
}

.add-words-modal-foot {
	justify-content: flex-end;
	box-sizing: border-box;
	min-width: 0;
	width: 100%;
	flex-shrink: 0;
}

.add-words-table-toolbar {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.add-words-scroll-hint {
	color: #94a3b8;
	font-size: 0.8rem;
	user-select: none;
	display: flex;
	align-items: center;
}

.add-words-table-container {
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
	margin-bottom: 0.5rem;
	border-radius: 4px;
	-webkit-overflow-scrolling: touch;
	overflow-x: auto;
	overflow-y: hidden;
	max-width: 100%;
}

.add-words-table-container::-webkit-scrollbar {
	height: 6px;
}

.add-words-table-container::-webkit-scrollbar-track {
	background: transparent;
}

.add-words-table-container::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.25);
	border-radius: 3px;
}

body.light-mode .add-words-table-container,
.page-index .add-words-table-container {
	scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

body.light-mode .add-words-table-container::-webkit-scrollbar-thumb,
.page-index .add-words-table-container::-webkit-scrollbar-thumb {
	background-color: rgba(0, 0, 0, 0.25);
}

.add-words-results-table {
	width: 100%;
	min-width: 560px;
	margin: 0 auto;
	text-align: left;
}

.add-words-results-table th {
	vertical-align: middle;
}

.add-words-results-table td {
	vertical-align: middle;
}

.add-words-results-table .select-col {
	width: 44px;
	min-width: 44px;
	text-align: center;
	vertical-align: middle;
}

.add-words-results-table .select-col input[type="checkbox"] {
	cursor: pointer;
	transform: scale(1.15);
	vertical-align: middle;
}

.add-words-results-table .thai-col {
	white-space: nowrap;
}

.add-words-results-table .trans-col {
	white-space: nowrap;
}

.add-words-results-table .match-col {
	white-space: nowrap;
	text-align: center;
}
