/* ------------------------- */
/* Common Tool Window Styles */
/* ------------------------- */
.terrain-height-tool-window.window-content {
	padding: 0.5rem;
}

.terrain-height-tool-window hr {
	margin: 8px;
	flex: 0 !important;
	width: 100%;
	border-top: 2px groove var(--color-border-dark-secondary);
	border-bottom: none;
}

.terrain-height-tool-window .tht-form-group:not(:first-child) {
	padding-top: 8px;
}

.terrain-height-tool-window .tht-form-group label {
	align-self: center;
}

.terrain-height-tool-window .tht-form-group input[disabled] {
	color: var(--color-text-light-7);
	text-decoration-line: line-through;
}

.terrain-height-tool-window .tht-form-group-hint {
	cursor: help;
}

.tht-radio-button input {
	display: none;
}

.tht-radio-button label {
	display: block;
	padding: 4px 8px;
	border: 1px solid var(--color-border-light-tertiary);
	border-left-width: 0;
	text-align: center;
	cursor: pointer;
}

.tht-radio-button input:checked + label {
	border-color: var(--color-border-highlight-alt);
    box-shadow: 0 0 6px inset var(--color-shadow-highlight);
}

.tht-radio-button:first-of-type label {
	border-top-left-radius: 3px;
	border-bottom-left-radius: 3px;
	border-left-width: 1px;
}

.tht-radio-button:last-of-type label {
	border-top-right-radius: 3px;
	border-bottom-right-radius: 3px;
}


/* --------------------- */
/* Terrain Type Palettes */
/* --------------------- */
ul.terrain-type-palette {
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-y: auto;
}

ul.terrain-type-palette li {
	padding: 4px;
	display: flex;
	border: 1px solid transparent;
	border-radius: 3px;
	margin-bottom: 4px;
}

ul.terrain-type-palette li,
ul.terrain-type-palette li * {
	cursor: pointer;
}

ul.terrain-type-palette li.active {
	border-color: var(--color-border-highlight-alt);
	box-shadow: 0 0 6px inset var(--color-shadow-highlight);
}

ul.terrain-type-palette li .preview-box {
	flex-shrink: 0;
	height: 28px;
	width: 28px;
	margin: 4px;
	border: 4px solid transparent;
}

ul.terrain-type-palette li .terrain-type-name {
	margin-left: 8px;
	flex-grow: 1;
	align-self: center;
}


/* --------------------- */
/* Terrain Erase Palette */
/* --------------------- */
#tht_terrainErasePalette .erase-range-input::placeholder {
	font: var(--fa-font-solid);
	color: #999999;
}


/* -------------------- */
/* Terrain Stack Viewer */
/* -------------------- */
#tht_terrainStackViewer {
	position: static;
	width: 240px;
	margin: 0 4px 4px auto;
}

#tht_terrainStackViewer .terrain-layer-block {
	margin: 2px 6px;
	padding: 4px 6px;
	border: 2px solid transparent;
	text-align: center;
}

#tht_terrainStackViewer .terrain-layer-block-title {
	margin: 0;
	font-size: var(--font-size-14);
}

#tht_terrainStackViewer .terrain-layer-block-height {
	margin: 0;
	font-size: var(--font-size-12);
}

#tht_terrainStackViewer .axis-line {
	stroke-width: 1;
	stroke: rgb(255 255 255 / 25%);
}

.theme-light #tht_terrainStackViewer .axis-line {
	stroke: rgb(0 0 0 / 25%);
}

#tht_terrainStackViewer .axis-line-label {
	font-size: 14px;
	fill: rgb(255 255 255 / 25%);
}

.theme-light #tht_terrainStackViewer .axis-line-label {
	fill: rgb(0 0 0 / 25%);
}

#tht_terrainStackViewer .shape-label,
#tht_terrainStackViewer .terrain-layer-block-title,
#tht_terrainStackViewer .terrain-layer-block-height {
	text-shadow: 0 0 3px #000000;
}


/* -------------------- */
/* Terrain Types Config */
/* -------------------- */
#tht_terrainTypesConfig,
#tht_terrainTypesConfig .window-content {
	overflow: visible;
}

#tht_terrainTypesConfig main {
	flex: 1 1 auto;
}

#tht_terrainTypesConfig hr {
	margin: 0.5rem 0;
	border-top: 1px solid rgb(135 135 135 / 25%);
	background: none;
}

#tht_terrainTypesConfig .sheet-tabs {
	border-color: rgb(135 135 135 / 25%);
}

#tht_terrainTypesConfig .terrain-type-list-container {
	flex: 1 1 0;
	display: flex;
	align-items: stretch;
	min-height: 0;
	gap: 1rem;
}

#tht_terrainTypesConfig .terrain-type-list,
#tht_terrainTypesConfig .terrain-type-edit-pane {
	overflow-y: auto;
}

#tht_terrainTypesConfig .terrain-type-list {
	flex: 0 0 320px;
	list-style: none;
	margin: 0;
	padding: 0;
}

#tht_terrainTypesConfig .terrain-type-list-vertical-separator {
	border-right: 4px double rgb(135 135 135 / 25%);
}

#tht_terrainTypesConfig .terrain-type-list > li {
	display: flex;
	gap: 0.25rem;
	padding: 0.3rem;
	margin-bottom: 0.25rem;
	cursor: pointer;
	align-items: center;
	border-top: 1px solid transparent;
	border-bottom: 1px solid transparent;
}

#tht_terrainTypesConfig .terrain-type-list > li > span {
	flex: 1 1 0;
}

#tht_terrainTypesConfig .terrain-type-list > li > button {
	flex: 0 0 24px;
	height: 24px;
	padding: 0;
	font-size: var(--font-size-12);
	line-height: 24px;
}

#tht_terrainTypesConfig .terrain-type-list > li > button > i {
	margin: 0;
}

#tht_terrainTypesConfig .terrain-type-list > li:hover {
	border-color: var(--color-border-dark-secondary);
}

#tht_terrainTypesConfig .terrain-type-list > li.active {
	border-color: var(--color-border-highlight);
}

#tht_terrainTypesConfig .terrain-type-edit-pane {
	flex: 1 1 0;
	padding-right: 0.5rem;
}

#tht_terrainTypesConfig textarea {
	min-height: auto;
	padding: 0.5rem 1rem;
	resize: vertical;
	field-sizing: content;
	background: var(--color-cool-4);
	border: 1px solid transparent;
}

.theme-light #tht_terrainTypesConfig textarea {
	background: rgba(0, 0, 0, 0.1);
	border: 1px solid var(--color-dark-6);
}

#tht_terrainTypesConfig .form-field-hint-icon {
	flex: 0 0 min-content;
	margin-left: 0.25rem;
	cursor: help;
}

#tooltip.tht_terrainTypesConfig_label-placeholder-tooltip {
	font-size: var(--font-size-14);
}

#tooltip.tht_terrainTypesConfig_label-placeholder-tooltip table {
	margin: 0;
}

#tooltip.tht_terrainTypesConfig_label-placeholder-tooltip table tr:nth-child(odd) {
	background-color: rgba(255, 255, 255, 0.05);
}

#tooltip.tht_terrainTypesConfig_label-placeholder-tooltip table tr:nth-child(even) {
	background-color: rgba(255, 255, 255, 0.1);
}


/* --------------------------- */
/* Terrain Types Import/Export */
/* --------------------------- */
#tht_terrainTypesImport .dialog-form,
#tht_terrainTypesExport .dialog-form {
	height: 100%;
}

#tht_terrainTypesImport .dialog-content,
#tht_terrainTypesExport .dialog-content {
	flex: 1 1 0;
}

#tht_terrainTypesImport textarea,
#tht_terrainTypesExport textarea {
	height: 100%;
	resize: none;
}

#tht_terrainTypesPresets .preset-list {
	list-style: none;
	margin: 0 40px 8px;
	padding: 0;
	overflow-y: auto;
	max-height: 500px;
}

#tht_terrainTypesPresets .preset-list li {
	display: flex;
	flex-direction: column;
	position: relative;
	padding: 6px;
	margin: 8px;
	min-height: 150px;
	border-radius: 3px;

	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.theme-dark #tht_terrainTypesPresets .preset-list li {
	border: 1px solid var(--color-border-dark-primary);
	box-shadow: 0px 0px 4px -1px rgb(0 0 0 / 50%),
		0px 0px 60px 0px rgb(0 0 0 / 15%) inset;
}

.theme-light #tht_terrainTypesPresets .preset-list li {
	border: 1px solid var(--color-border-light-primary);
	box-shadow: 0px 0px 4px -1px rgb(0 0 0 / 50%),
		0px 0px 60px 0px #FFFFFF inset;
}

#tht_terrainTypesPresets .preset-header {
	margin: -6px;
    padding: 6px;
}

.theme-dark #tht_terrainTypesPresets .preset-header {
	background: rgb(11 10 19 / 62%);
}

.theme-light #tht_terrainTypesPresets .preset-header {
	background: rgb(240 240 240 / 70%);
}

#tht_terrainTypesPresets .preset-name {
	font-size: 1.25rem;
}

#tht_terrainTypesPresets .preset-author {
	opacity: 0.8;
}

#tht_terrainTypesPresets .preset-import-buttons {
	text-align: right;
}

#tht_terrainTypesPresets .preset-import-buttons button {
	display: inline-block;
	width: auto;
}

.theme-light #tht_terrainTypesPresets .preset-import-buttons button {
	background: rgb(230 230 230 / 80%);
}


/* -------------------------- */
/* Line of Sight Ruler Config */
/* -------------------------- */
#tht_lineOfSightRulerConfig .form-group-stacked label {
	margin-bottom: 4px;
}

#tht_lineOfSightRulerConfig .form-group-stacked {
	margin-bottom: 8px;
}


/* -------------------------- */
/* Token Line of Sight Config */
/* -------------------------- */
#tht_tokenLineOfSightConfig .token-selection-container {
	display: flex;
	align-items: center;
	margin-bottom: 6px;
	padding: 2px;
	border-radius: 3px;
}

.theme-dark #tht_tokenLineOfSightConfig .token-selection-container {
	background: var(--color-cool-4);
}

.theme-light #tht_tokenLineOfSightConfig .token-selection-container {
	background: rgb(0 0 0 / 10%);
	border: 1px solid var(--color-dark-6);
}

#tht_tokenLineOfSightConfig .token-selection-container.is-selecting-token {
	border-color: var(--color-border-highlight-alt);
	box-shadow: 0 0 6px inset var(--color-shadow-highlight);
}

#tht_tokenLineOfSightConfig .token-selection-container > * {
	margin: 4px;
}

#tht_tokenLineOfSightConfig .token-selection-container .token-image {
	width: 32px;
	height: 32px;
	border: none;
}

#tht_tokenLineOfSightConfig .token-selection-container .token-name {
	flex: 1 1 0;
    white-space: nowrap;
	overflow: hidden;
    text-overflow: ellipsis;
}

#tht_tokenLineOfSightConfig .token-selection-container .token-action {
	font-size: 1.2rem;
}


/* --------------------------- */
/* Terrain Shape Choice Dialog */
/* --------------------------- */
.terrain-shape-choice-dialog .terrain-shape-list {
	display: grid;
	grid-template-columns: repeat(3, 172px);
	gap: 8px;
	margin-bottom: 1rem;
}

.terrain-shape-choice-dialog .terrain-shape-choice-hint-text {
	margin-top: 0 !important;

	/* Max-width of the hint should be equal to the width of the above .terrain-shape list.
	If it is allowed to grow longer then it will stretch the dialog.
	532px = 3 x 172 (three columns) + 2 * 8 (two gaps between columns) */
	max-width: 532px;
}

.terrain-shape-choice-dialog .terrain-shape-list-radio {
	display: none;
}

.terrain-shape-choice-dialog .terrain-shape-list-item {
	width: 172px;
	height: 172px;
	padding: 4px;
	background: var(--color-cool-5-50);
	color: var(--color-light-3);
	border: 1px solid var(--color-light-5);
	border-radius: 4px;
}

.theme-light .terrain-shape-choice-dialog .terrain-shape-list-item {
	background: rgb(0 0 0 / 10%);
	color: var(--color-dark-1);
	border-color: 1px solid var(--color-dark-5);
}

.terrain-shape-choice-dialog .terrain-shape-list-item:hover {
	box-shadow: 0 0 5px var(--color-shadow-primary);
}

.terrain-shape-choice-dialog .terrain-shape-list-radio:checked + .terrain-shape-list-item {
	border-color: var(--color-border-highlight-alt);
	box-shadow: 0px 0px 4px -1px rgb(0 0 0 / 50%), 0 0 6px inset var(--color-shadow-highlight);
}

.terrain-shape-choice-dialog .terrain-shape-list-item > p {
	margin: 0 0 4px;
	text-align: center;
}


/* ----- */
/* Icons */
/* ----- */
.tht-icon-erase-shape {
	position: relative;
	font: var(--fa-font-solid);
}

.tht-icon-erase-shape:before {
	content: "\f5ee";
    position: absolute;
    top: -0.25em;
    transform: scale(0.9) translateX(-60%);
}

.tht-icon-erase-shape:after {
	content: "\f12d";
    position: absolute;
    bottom: -0.125em;
    transform: scale(0.7) translateX(-40%);
}


/* ------- */
/* Utility */
/* ------- */
.align-items-center {
	align-items: center;
}

.max-content-width {
	width: max-content;
}

.margin-x-auto {
	margin-left: auto;
	margin-right: auto;
}

.gap-1rem {
	gap: 1rem;
}

.cursor-help {
	cursor: help;
}
