/*! Copyright (C) 2023-2025 Eroica
 *!
 *! This software is provided 'as-is', without any express or implied
 *! warranty.  In no event will the authors be held liable for any damages
 *! arising from the use of this software.
 *!
 *! Permission is granted to anyone to use this software for any purpose,
 *! including commercial applications, and to alter it and redistribute it
 *! freely, subject to the following restrictions:
 *!
 *! 1. The origin of this software must not be misrepresented; you must not
 *!    claim that you wrote the original software. If you use this software
 *!    in a product, an acknowledgment in the product documentation would be
 *!    appreciated but is not required.
 *! 2. Altered source versions must be plainly marked as such, and must not be
 *!    misrepresented as being the original software.
 *! 3. This notice may not be removed or altered from any source distribution.
 */

.root {
	/* WinUI 3 Gallery Colors - Text */
	-TextFillColorPrimaryBrush: #1a1a1a;
	-TextFillColorSecondaryBrush: #5d5d5d;
	-TextFillColorTertiaryBrush: #868686;
	-TextFillColorDisabledBrush: #9b9b9b;

	-AccentTextFillColorPrimaryBrush: #003e92;
	-AccentTextFillColorSecondaryBrush: #001a68;
	-AccentTextFillColorTertiaryBrush: #0067c0;
	-AccentTextFillColorDisabledBrush: #9b9b9b;

	-TextOnAccentFillColorSelectedTextBrush: #ffffff;
	-TextOnAccentFillColorSecondaryBrush: #fbfbfb;
	-TextOnAccentFillColorDisabledBrush: #ffffff;
	-TextOnAccentFillColorSelectedTextBrush: #ffffff;

	/* WinUI 3 Gallery Colors - Fill */
	-ControlFillColorDefaultBrush: #fbfbfb;
	-ControlFillColorSecondaryBrush: #f6f6f6;
	-ControlFillColorTertiaryBrush: #f5f5f5;
	-ControlFillColorQuarternaryBrush: #f5f5f5;
	-ControlFillColorDisabledBrush: #f5f5f5;
	-ControlFillColorTransparentBrush: #f3f3f3;
	-ControlFillColorInputActiveBrush: #ffffff;

	-SubtleFillColorTransparentBrush: #f3f3f3;
	-SubtleFillColorSecondaryBrush: #eaeaea;
	-SubtleFillColorTertiaryBrush: #ededed;
	-SubtleFillColorDisabledBrush: #f3f3f3;

	-AccentFillColorDefaultBrush: #0067c0;
	-AccentFillColorSecondaryBrush: #1975c5;
	-AccentFillColorTertiaryBrush: #3183ca;
	-AccentFillColorDisabledBrush: #bfbfbf;
	-AccentFillColorSelectedTextBackgroundBrush: #0078d4;

	/* WinUI 3 Gallery Colors - Stroke */
	-ControlElevationBorderBrush: #e5e5e5;
	-CircleElevationBorderBrush: #cccccc;
	-TextControlElevationBorderBrush: #e5e5e5;
	-TextControlElevationBorderFocusedBrush: #0067c0;
	-AccentControlElevationBorderBrush: #f4f4f4;

	-ControlStrongStrokeColorDefaultBrush: #868686;
	-ControlStrongStrokeColorDisabledBrush: #bfbfbf;

	-FocusStrokeColorOuterBrush: #1a1a1a;
	-FocusStrokeColorInnerBrush: #fbfbfb;

	/* WinUI 3 Gallery Color - Signal */
	-SystemFillColorSuccessBrush: #0f7b0f;
	-SystemFillColorSuccessBackgroundBrush: #dff6dd;
	-SystemFillColorCautionBrush: #9d5d00;
	-SystemFillColorCautionBackgroundBrush: #fff4ce;
	-SystemFillColorCriticalBrush: #c42b1c;
	-SystemFillColorCriticalBackgroundBrush: #fde7e9;
	-SystemFillColorAttentionBrush: #0078d4;
	-SystemFillColorAttentionBackgroundBrush: #f4f4f4;
	-SystemFillColorNeutralBrush: #868686;
	-SystemFillColorNeutralBackgroundBrush: #ededed;
	-SystemFillColorSolidNeutralBrush: #8a8a8a;
	-SystemFillColorSolidNeutralBackgroundBrush: #f3f3f3;
	-SystemFillColorSolidAttentionBackgroundBrush: #f7f7f7;

	/* WinUI 3 Gallery Geometry */
	-OverlayCornerRadius: 8;
	-ControlCornerRadius: 4;

	-fx-base: #f9f9f9;
	-fx-background: #f3f3f3;

	-fx-control-inner-background: -fx-base;
	// TODO
	-fx-control-inner-background-alt: derive(-fx-base,80%);

	-fx-dark-text-color: -TextFillColorPrimaryBrush;
	-fx-mid-text-color: -TextFillColorSecondaryBrush;
	-fx-light-text-color: white;

	-fx-accent: -AccentFillColorDefaultBrush;

	-fx-default-button: -AccentFillColorDefaultBrush;

	-fx-focus-color: -FocusStrokeColorOuterBrush;
	-fx-faint-focus-color: -FocusStrokeColorOuterBrush;

	-fx-color: -fx-base;

	// TODO
	-fx-hover-base: ladder(
			-fx-base,
			derive(-fx-base,20%) 20%,
			derive(-fx-base,30%) 35%,
			derive(-fx-base,40%) 50%
	);

	-fx-pressed-base: -ControlFillColorTertiaryBrush;

	-fx-text-background-color: ladder(
			-fx-background,
			-fx-light-text-color 45%,
			-fx-dark-text-color  46%,
	);

	-fx-box-border: -ControlElevationBorderBrush;

	-fx-text-box-border: -ControlElevationBorderBrush;

	// TODO
	-fx-shadow-highlight-color: ladder(
			-fx-background,
			rgba(255,255,255,0.07) 0%,
			rgba(255,255,255,0.07) 20%,
			rgba(255,255,255,0.07) 70%,
			rgba(255,255,255,0.7) 90%,
			rgba(255,255,255,0.75) 100%
	);

	-fx-outer-border: -CircleElevationBorderBrush;

	-fx-inner-border: -ControlElevationBorderBrush;
	// TODO
	-fx-inner-border-horizontal: linear-gradient(to right, derive(-fx-color,55%), derive(-fx-color,-5%));
	// TODO
	-fx-inner-border-bottomup: linear-gradient(to top, derive(-fx-color,55%), derive(-fx-color,-5%));

	-fx-body-color: -ControlFillColorDefaultBrush;
	// TODO
	-fx-body-color-bottomup: linear-gradient(to top, derive(-fx-color,10%) ,derive(-fx-color,-6%));
	// TODO
	-fx-body-color-to-right: linear-gradient(to right, derive(-fx-color,10%) ,derive(-fx-color,-6%));

	-fx-text-base-color: -TextFillColorPrimaryBrush;

	-fx-text-inner-color: -TextFillColorPrimaryBrush;

	-fx-mark-color: #444545;

	-fx-mark-highlight-color: -ControlStrongStrokeColorDefaultBrush;

	/* Background for items in list like things such as menus, lists, trees,
	 * and tables. */
	-fx-selection-bar: -fx-accent;

	// TODO
	-fx-selection-bar-non-focused: lightgrey;

	-fx-selection-bar-text: -fx-text-background-color;

	/* These are needed for Popup */
	-fx-background-color: inherit;
	-fx-background-radius: inherit;
	-fx-background-insets: inherit;
	-fx-padding: inherit;

	// TODO
	-fx-cell-hover-color: #cce3f4;

	// TODO
	-fx-cell-focus-inner-border: derive(-fx-selection-bar,30%);

	// TODO
	-fx-table-cell-border-color: transparent;

	// TODO
	-fx-page-bullet-border: #acacac;
	-fx-page-indicator-hover-border: #accee5;

	// TODO
	-fx-focused-text-base-color : ladder(
			-fx-selection-bar,
			-fx-light-text-color 45%,
			-fx-dark-text-color 46%,
			-fx-dark-text-color 59%,
			-fx-mid-text-color 60%
	);
	-fx-focused-mark-color : -fx-focused-text-base-color;

	/* Set the default background color for the scene */
	-fx-background-color: -fx-background;
}

/* Make popups transparent */
.root.popup {
	-fx-background-color: transparent;
}

.scroll-pane,
.split-pane,
.list-view,
.table-view,
.tree-table-view,
.html-editor {
	-fx-background-color: -fx-control-inner-background;
}

.label:disabled,
.radio-button:disabled,
.slider:disabled,
.scroll-bar:disabled,
.scroll-pane:disabled,
.progress-bar:disabled,
.text-input:disabled,
.list-view:disabled,
.tree-view:disabled,
.table-view:disabled,
.tree-table-view:disabled,
.titled-pane:disabled > .title,
.spinner:disabled {
	-fx-opacity: 0.4;
}

/* Prevent opacity being applied twice for JDK-8152392 */
.text-input:disabled > .scroll-pane {
	-fx-opacity: 1.0;
}

/* End of initial Modena overrides */

/* Don't apply disabled twice in Spinner's TextInput */
.spinner:disabled > .text-input {
	-fx-opacity: 1.0;
}

.root {
	-fx-font-size: 14px;
}

@import "buttons";
@import "combo-box";
@import "radio-button";
@import "checkbox";
@import "hyperlink";
@import "slider";
@import "scroll-bar";
@import "separator";
@import "progress-bar";
@import "text";
@import "context-menu";
@import "menu-bar";
@import "titled-pane";
@import "list-view";
@import "tree-view";
@import "table-view";
@import "tooltip";
@import "date-picker";
@import "spinner";
@import "dialog";

@import "info-bar";

/* Extra classes for styling text */
@import "typography";

/* Extra controls */
@import "header-bar";
