/* Farbdesigns und Umschalter für die ganze Website.
   Wird nach style.css geladen; die Standardwerte (Dunkel) stehen in style.css. */

:root {
	color-scheme: dark;
}

/* ===== Farbdesigns ===== */

:root[data-theme="bright"] {
	color-scheme: light;
	--background: #e7e9eb;
	--textcolor: #333333;
	--contentBackground: #ffffff;
	--dotBackground: #bbbbbb;
	--einsatzBackground: #f0f1f3;
	--navButtonBackground: #ff2222;
	--menuBackground: #ff2222;
	--menuitemheaderColor: #454545;
	--accentBorder: #aa3319;
	--boxBorder: #c3c7cb;
	--boxBackground: #f0f1f3;
	--boxText: #262626;
	--tableBorder: #b8bdc1;
	--tableCellBorder: #d3d6d9;
	--tableHeaderBackground: #d7dadd;
	--tableHeaderText: #1b1b1b;
	--contentLink: #be1522;
	--contentVisitedLink: #7a0f14;
	--link: #0000cc;
	--visitedLink: #551a8b;
	--buttonBackground: #8888ee;
	--buttonBorder: #0000cc;
	--buttonText: #111111;
	--inputBorder: #aeb3b7;
	--menuTextColor: #ffffff;
	--shadow: rgba(0, 0, 0, 0.22);
	--pageGradient: linear-gradient(165deg, #f4f6f8 0%, #e7e9eb 45%, #d6dce1 100%);
}

/* Im hellen Design bekommen die Tabellenköpfe eine eigene graue Fläche. */
:root[data-theme="bright"] th {
	background: var(--tableHeaderBackground);
	color: var(--tableHeaderText);
	font-weight: bold;
}

:root[data-theme="contrast"] {
	color-scheme: light;
	--background: #ffffff;
	--textcolor: #111111;
	--contentBackground: #efefef;
	--dotBackground: #eeeeee;
	--einsatzBackground: #efefef;
	--navButtonBackground: #ff0000;
	--menuBackground: #ff0000;
	--menuitemheaderColor: #121212;
	--accentBorder: #000000;
	--boxBorder: #000000;
	--boxBackground: #ffffff;
	--boxText: #000000;
	--tableBorder: #000000;
	--tableCellBorder: #000000;
	--tableHeaderBackground: #000000;
	--tableHeaderText: #ffffff;
	--contentLink: #0000cc;
	--contentVisitedLink: #551a8b;
	--link: #0000cc;
	--visitedLink: #551a8b;
	--buttonBackground: #ffff00;
	--buttonBorder: #000000;
	--buttonText: #000000;
	--inputBorder: #000000;
	--menuTextColor: #ffffff;
	--shadow: rgba(0, 0, 0, 0.8);
	--pageGradient: none;
}

:root[data-theme="blue"] {
	--background: #1e2a38;
	--textcolor: #c8d6e5;
	--contentBackground: #14202b;
	--dotBackground: #14202b;
	--einsatzBackground: #243447;
	--navButtonBackground: #2d5d8a;
	--menuBackground: #2d5d8a;
	--menuitemheaderColor: #7fb2e0;
	--accentBorder: #2d5d8a;
	--boxBorder: #3f5f7f;
	--boxBackground: #243447;
	--boxText: #c8d6e5;
	--tableBorder: #3f6f9f;
	--tableCellBorder: #2d5d8a;
	--tableHeaderBackground: #2d4a66;
	--tableHeaderText: #e6f0fa;
	--contentLink: #7fc4ff;
	--contentVisitedLink: #c3a6ff;
	--link: #a8ccf0;
	--visitedLink: #d0bfff;
	--buttonBackground: #4a7fb5;
	--buttonBorder: #9cc7ee;
	--buttonText: #0b1723;
	--inputBorder: #4a6b8a;
	--menuTextColor: #ffffff;
	--shadow: rgba(0, 0, 0, 0.65);
	--pageGradient: linear-gradient(165deg, #283a51 0%, #1e2a38 45%, #141d27 100%);
}

:root[data-theme="green"] {
	--background: #2c3a2e;
	--textcolor: #cddccd;
	--contentBackground: #1b2620;
	--dotBackground: #1b2620;
	--einsatzBackground: #334433;
	--navButtonBackground: #3a6b45;
	--menuBackground: #3a6b45;
	--menuitemheaderColor: #8fbf95;
	--accentBorder: #3a6b45;
	--boxBorder: #4f7355;
	--boxBackground: #334433;
	--boxText: #cddccd;
	--tableBorder: #4f7f57;
	--tableCellBorder: #3a6b45;
	--tableHeaderBackground: #2f4a36;
	--tableHeaderText: #e0eee0;
	--contentLink: #8fd694;
	--contentVisitedLink: #c8e6c9;
	--link: #b8e0b8;
	--visitedLink: #d7f0d7;
	--buttonBackground: #4f8f5c;
	--buttonBorder: #a5d6ad;
	--buttonText: #0f1a12;
	--inputBorder: #4f7355;
	--menuTextColor: #ffffff;
	--shadow: rgba(0, 0, 0, 0.6);
	--pageGradient: linear-gradient(165deg, #3a503c 0%, #2c3a2e 45%, #1f2921 100%);
}

:root[data-theme="fire"] {
	color-scheme: dark;
	--background: #2b2d30;
	--textcolor: #e8e8e8;
	--contentBackground: #1b1d1f;
	--dotBackground: #1b1d1f;
	--einsatzBackground: #2a2d31;
	--navButtonBackground: #a10816;
	--menuBackground: #a10816;
	--menuitemheaderColor: #e39a9a;
	--accentBorder: #c1121f;
	--boxBorder: #4a4d52;
	--boxBackground: #2a2d31;
	--boxText: #e8e8e8;
	--tableBorder: #7a1a20;
	--tableCellBorder: #4a2a2d;
	--tableHeaderBackground: #3a2024;
	--tableHeaderText: #ffd7d7;
	--contentLink: #ff6b6b;
	--contentVisitedLink: #d9a3ff;
	--link: #ffb3b3;
	--visitedLink: #e0b3ff;
	--buttonBackground: #c1121f;
	--buttonBorder: #ff8080;
	--buttonText: #ffffff;
	--inputBorder: #5c5f64;
	--menuTextColor: #ffffff;
	--shadow: rgba(0, 0, 0, 0.65);
	--pageGradient: linear-gradient(165deg, #373a3e 0%, #2b2d30 45%, #1d1f20 100%);
}

/* ===== Umschalter neben dem Burger-Icon ===== */

.nav-buttons {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	position: relative;
}

#theme-toggle {
	display: block;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	line-height: 0;
}

.theme-dot {
	display: block;
	width: 22px;
	height: 22px;
	margin: 11px auto;
	border-radius: 50%;
	/* Der Punkt liegt auf der Menüfläche, deshalb nutzt er die
	   Inhaltsfarbe als Füllung, damit er sich vom Menü abhebt. */
	background: var(--dotBackground);
	border: 2px solid var(--textcolor);
	box-sizing: border-box;
}

#theme-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 10px;
	margin-top: 6px;
	width: 200px;
	max-width: calc(100vw - 20px);
	max-height: calc(100vh - 80px);
	overflow-y: auto;
	padding: 6px;
	background: var(--contentBackground);
	border: 1px solid var(--boxBorder);
	border-radius: var(--radius);
	box-shadow: 0 6px 16px var(--shadow);
	z-index: 50;
}

#theme-menu.open {
	display: block;
}

#theme-menu,
#theme-menu * {
	box-sizing: border-box;
}

.theme-menu-title {
	padding: 4px 6px 6px;
	color: var(--textcolor);
	font-size: 13px;
	font-weight: bold;
}

.theme-option {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 6px;
	margin: 0;
	border: none;
	border-radius: 5px;
	background: transparent;
	color: var(--textcolor);
	font-size: 14px;
	text-align: left;
	cursor: pointer;
}

.theme-option:hover,
.theme-option:focus {
	background: var(--einsatzBackground);
	outline: none;
}

.theme-option[aria-checked="true"] {
	background: var(--einsatzBackground);
	font-weight: bold;
}

.theme-swatch {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid var(--textcolor);
	flex: 0 0 auto;
	box-sizing: border-box;
}

.theme-option[data-theme="dark"] .theme-swatch {
	background: #121212;
}

.theme-option[data-theme="bright"] .theme-swatch {
	background: #bbbbbb;
}

.theme-option[data-theme="contrast"] .theme-swatch {
	background: #ffffff;
}

.theme-option[data-theme="blue"] .theme-swatch {
	background: #2d5d8a;
}

.theme-option[data-theme="green"] .theme-swatch {
	background: #3a6b45;
}

.theme-option[data-theme="fire"] .theme-swatch {
	background: #c1121f;
}
