/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
  margin: 0;
}

/**
 * Render the `main` element consistently in IE.
 */

main {
  display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

a {
  background-color: transparent;
}

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */

img {
  border-style: none;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input { /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
  text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}

/* ============================================
   BASE.CSS - Globale Basis-Styles
   Ersetzt fehlende Pico CSS Resets
   ============================================ */

/* Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Body Defaults */
body {
  margin: 0;
  min-height: 100vh;
}

/* Responsive Images */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove default list styles */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Buttons reset */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Remove default margin */
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

/* Improve text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Inherit fonts for inputs and buttons */
input, button, textarea, select {
  font: inherit;
}

/* Base CSS - Structural Layout */
/* This CSS contains the core layout structure and should not be edited directly */

:root {
  --header-height: 80px;
  --nav-height: 50px;
  --footer-height: 80px;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f5f5f5;
  overflow-x: hidden;
}

body[data-layout="layoutA"] {
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

@media (max-width: 768px) {
  body[data-layout="layoutA"] {
    background-attachment: scroll;
  }
}

header {
  flex-shrink: 0;
  background: var(--header-bg, #ffffff);
  border-bottom: 1px solid var(--header-border-color, #e0e0e0);
  backdrop-filter: blur(var(--header-blur, 0px));
  -webkit-backdrop-filter: blur(var(--header-blur, 0px));
  z-index: 1000;
  height: var(--header-height, 80px);
  position: sticky;
  top: 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

nav {
  flex-shrink: 0;
  background: var(--nav-bg, #2c3e50);
  backdrop-filter: blur(var(--nav-blur, 0px));
  -webkit-backdrop-filter: blur(var(--nav-blur, 0px));
  z-index: 999;
  height: var(--nav-height, 50px);
  display: flex;
  align-items: center;
  position: sticky;
  top: var(--header-height, 80px);
}

body[data-layout="layoutC"] nav,
body[data-layout="layoutD"] nav {
  top: 0;
  z-index: 1000;
}

body[data-layout="layoutC"] header,
body[data-layout="layoutD"] header {
  top: var(--nav-height, 50px);
  z-index: 999;
}

nav .nav-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  height: 100%;
  position: relative;
}

ul.menu {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-grow: 1;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
  height: 100%;
}

ul.menu li {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
}

.menu-btn {
  display: none;
}

/* Main Content */
main {
  flex: 1;
  overflow: visible;
  background: #f5f5f5;
  padding: 2rem;
}

/* Hero Section - Grid Layout fuer Demo-Content */
#hero:not([data-content-type]) {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

/* Hero Demo Styling */
.hero-text h1 {
  font-size: 2.5rem;
  color: var(--heading-color, #2c3e50);
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero-text p {
  font-size: 1.1rem;
  color: var(--text-muted, #666);
  line-height: 1.6;
}

.hero-image {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Content Sections */
section.content-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2.5rem 2rem;
  background: var(--section-bg, rgba(255, 255, 255, 1));
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

/* Footer */
footer {
  flex-shrink: 0;
  background: var(--footer-bg, #2c3e50);
  color: var(--footer-text, #ecf0f1);
  padding: 1.5rem 2rem;
  text-align: center;
  z-index: 998;
}

/* Scroll margin for sections */
section[id] {
  scroll-margin-top: calc(var(--header-height, 80px) + var(--nav-height, 50px) + 20px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  section.content-section {
    margin: 1rem;
    padding: 1.5rem;
  }

  #hero:not([data-content-type]) {
    grid-template-columns: 1fr;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }

  nav .nav-inner {
    justify-content: flex-end;
  }

  ul.menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg, #2c3e50);
    z-index: 1000;
    padding: 1rem 0;
  }

  ul.menu.active {
    display: flex;
  }

  .menu-btn {
    display: block;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    padding: 1rem;
  }
}

/* Container Utility */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Theme CSS - Colors, Typography, Visual Styling */
/* Uses CSS variables for easy customization */

/* Typography */
body {
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color, #333);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Header Styling */
.header-inner .brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--brand-color, #333);
  transition: color 0.3s ease;
}

.header-inner .brand:hover {
  color: var(--primary-color, #3498db);
}

.header-inner .tagline {
  font-size: 0.9rem;
  color: var(--tagline-color, #666);
  margin-top: 0.25rem;
}

/* Navigation Links */
ul.menu li a {
  color: var(--nav-link-color, #fff);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  border-radius: 0;
}

ul.menu li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Active Menu Items */
body[data-layout="layoutA"] nav a.active {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Section Headings */
section.content-section h2 {
  font-size: 1.8rem;
  color: var(--heading-color, #2c3e50);
  border-bottom: 2px solid var(--primary-color, #3498db);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

section.content-section p {
  color: var(--text-color, #555);
  line-height: 1.7;
  margin-bottom: 1rem;
}

section.content-section a {
  color: var(--primary-color, #3498db);
  transition: color 0.3s ease;
}

section.content-section a:hover {
  color: var(--primary-dark, #2980b9);
}

section.content-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Cards */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e0e0e0;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Gallery Images */
.gallery-grid img {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid transparent;
}

.gallery-grid img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: var(--primary-color, #3498db);
}

/* Footer Links */
footer a {
  color: var(--primary-color, #3498db);
  transition: color 0.3s ease;
}

footer a:hover {
  color: #5dade2;
}

/* Buttons */
button, .button {
  background: var(--primary-color, #3498db);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

button:hover, .button:hover {
  background: var(--primary-dark, #2980b9);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Forms - styles now in forms.css, only override focus color with theme */
input:focus, textarea:focus, select:focus {
  border-color: var(--primary-color, #3498db);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* Custom CSS Variables - User Editable */
:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --header-bg: #ffffff;
  --nav-bg: #2c3e50;
  --footer-bg: #8c2f25;
  --footer-text: #ecf0f1;
  --section-bg: rgba(255, 255, 255, 1);
  --brand-color: #8c2f25;
  --tagline-color: #8c2f25;
  --heading-color: #2c3e50;
  --text-color: #333;
  --text-muted: #666;
  --nav-link-color: #fff;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	  --header-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	  --brand-font-weight: 700;
	  --brand-rotation: 0deg;
	  --tagline-rotation: 0deg;
	  --brand-font-size: 1.5rem;
	  --tagline-font-size: 0.9rem;
	  --nav-font-size: 1rem;
	  --nav-font-weight: 500;
	}

/* Portal Style Overrides */
.header-inner .brand {
  font-size: var(--brand-font-size, 1.5rem);
}

.header-inner .tagline {
  font-size: var(--tagline-font-size, 0.9rem);
}

	ul.menu li a,
	nav .submenu li a,
	.placeholder-menu {
	  font-size: var(--nav-font-size, 1rem);
	  font-weight: var(--nav-font-weight, 500);
	}
/* Default values are in base.css - do not override here as custom.css loads before this file */
/* Fallback values are provided via var(--name, fallback) in the rules below */

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #f5f5f5;
}

body[data-layout="layoutA"] {
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
  background-attachment: fixed !important;
}

main {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  position: sticky;
  top: var(--header-height, 80px);
  z-index: 999;
}

nav .nav-inner {
  position: relative;
}

/* ============================================
   Header Logo + Layering
   ============================================ */

/* Ensure tagline is above logo when overlapping */
.header-inner .brand {
  position: relative;
  z-index: 1;
}

.header-inner .brand .brand-text {
  display: inline-block;
  font-family: var(--header-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif);
  font-weight: var(--brand-font-weight, 700);
  transform: rotate(var(--brand-rotation, 0deg));
  transform-origin: center;
}

.header-inner .tagline {
  display: inline-block;
  position: relative;
  z-index: 2;
  transform: rotate(var(--tagline-rotation, 0deg));
  transform-origin: center;
}

/* Toggle logo vs. text */
body[data-has-logo="true"] .header-inner .brand .brand-text {
  display: none;
}

body[data-has-logo="false"] .header-inner .brand .brand-logo {
  display: none;
}

/* Logo sizing (re-uses --brand-font-size slider as logo height) */
.header-inner .brand .brand-logo {
  display: block;
  height: var(--brand-font-size, 24px);
  width: auto;
  max-height: 100%;
  object-fit: contain;
}

section[id] {
  scroll-margin-top: calc(var(--header-height, 80px) + var(--nav-height, 50px) + 20px);
}

/* Fix: Hero mit Content-Type soll kein Grid-Layout haben */
#hero[data-content-type] {
  display: block !important;
  grid-template-columns: none !important;
}

/* ============================================
   Layout C & D: Nav above Header
   ============================================ */

/* Layout C: Nav → Header (One-Page Scroll) */
body[data-layout="layoutC"] nav {
  top: 0;
  z-index: 1000;
}

body[data-layout="layoutC"] header {
  top: var(--nav-height, 50px);
  z-index: 999;
}

/* Layout D: Nav → Header (Multi-Page) */
body[data-layout="layoutD"] nav {
  top: 0;
  z-index: 1000;
}

body[data-layout="layoutD"] header {
  top: var(--nav-height, 50px);
  z-index: 999;
}

/* Scroll-Offset anpassen für Layout C & D */
body[data-layout="layoutC"] section[id],
body[data-layout="layoutD"] section[id] {
  scroll-margin-top: calc(var(--nav-height, 50px) + var(--header-height, 80px) + 20px);
}

/* ============================================
   Header ausgeblendet
   ============================================ */

/* Nav Position wenn Header ausgeblendet (Layout A & B) */
body[data-header-visible="false"] nav {
  top: 0;
}

/* Scroll-Offset ohne Header */
body[data-header-visible="false"] section[id] {
  scroll-margin-top: calc(var(--nav-height, 50px) + 20px);
}

/* Layout C/D mit ausgeblendetem Header */
body[data-layout="layoutC"][data-header-visible="false"] section[id],
body[data-layout="layoutD"][data-header-visible="false"] section[id] {
  scroll-margin-top: calc(var(--nav-height, 50px) + 20px);
}

footer {
  height: var(--footer-height, 80px);
  min-height: var(--footer-height, 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

footer .footer-inner {
  font-size: var(--footer-font-size, 1rem);
  white-space: pre-wrap;
}

body[data-fixed-footer="true"] main {
  padding-bottom: calc(2rem + var(--footer-height, 80px));
}

body[data-fixed-footer="true"] footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 998;
}

@media (max-width: 768px) {
  body[data-layout="layoutA"] {
    background-attachment: scroll !important;
  }

  body[data-fixed-footer="true"] main {
    padding-bottom: 2rem;
  }

  body[data-fixed-footer="true"] footer {
    position: static;
  }
}

/* ============================================
   FORMS.CSS - Basis Form-Styling
   Ersetzt Pico CSS Form-Styles
   ============================================ */

:root {
  --input-padding: 0.4rem 0.6rem;
  --input-border: 1px solid #ddd;
  --input-radius: 4px;
  --input-bg: #fff;
  --input-focus-color: #3498db;
}

/* Base Form Elements */
input, textarea, select {
  padding: var(--input-padding);
  border: var(--input-border);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--input-focus-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Checkboxes & Radios */
input[type="checkbox"], input[type="radio"] {
  width: auto;
  padding: 0;
  margin-right: 0.5rem;
  cursor: pointer;
}

/* Labels */
label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

/* Textarea */
textarea {
  min-height: 80px;
  resize: vertical;
}

/* Select */
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 2rem;
}

/* Disabled State */
input:disabled, textarea:disabled, select:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Placeholder */
::placeholder {
  color: #999;
  opacity: 1;
}

/* ============================================
   Modal Design System
   ============================================ */

:root {
    --z-modal: 10000;
    --z-modal-overlay: 10000;
    --modal-overlay-bg: transparent;
    --modal-bg: #ffffff;
    --modal-border-radius: 12px;
    --modal-padding: 1.5rem;
    --modal-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --modal-header-border: #e0e0e0;
}

/* ============================================
   Modal Overlay (Backdrop)
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-bg);
    z-index: var(--z-modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

/* Legacy support - alte Klasse */
.editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-bg);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Modal Container
   ============================================ */

.modal {
    background: var(--modal-bg);
    padding: var(--modal-padding);
    border-radius: var(--modal-border-radius);
    box-shadow: var(--modal-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Größen-Varianten */
.modal-sm {
    width: min(50vw, 95vw);
    max-height: min(70vh, 90vh);
}

.modal-md {
    width: min(60vw, 95vw);
    max-height: min(90vh, 90vh);
    min-height: 500px;
}

.modal-lg {
    width: min(80vw, 95vw);
    max-height: min(90vh, 90vh);
}

/* Legacy support - alte modal-content Klasse */
.modal-content {
    background: var(--modal-bg);
    padding: 1rem 1.5rem;
    border-radius: var(--modal-border-radius);
    width: min(60vw, 95vw);
    height: min(90vh, 90vh);
    box-shadow: var(--modal-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ============================================
   Modal Header
   ============================================ */

.modal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--modal-header-border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    flex-shrink: 0;
}

/* Header Controls Container */
.modal-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-wrap: wrap;
}

/* Draggable Header */
.modal-draggable .modal-header {
    cursor: move;
    user-select: none;
}

.modal-draggable .modal-header:active {
    cursor: grabbing;
}

/* Prevent dragging on interactive elements */
.modal-header button,
.modal-header input,
.modal-header select {
    cursor: default;
}

/* ============================================
   Modal Close Button
   ============================================ */

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-close:active {
    transform: scale(0.95);
}

/* ============================================
   Modal Body
   ============================================ */

.modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ============================================
   Modal Footer
   ============================================ */

.modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--modal-header-border);
}

/* ============================================
   Modal Toolbar (oberhalb Content)
   ============================================ */

.modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

/* ============================================
   Modal Description Text
   ============================================ */

.modal-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ============================================
   Reconnect Popup Spezial-Styles
   ============================================ */

.reconnect-popup {
    text-align: center;
    padding: 2rem;
}

.reconnect-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.reconnect-popup h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: #2c3e50;
}

.reconnect-popup p {
    color: #666;
    margin-bottom: 1.5rem;
}

.reconnect-progress {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.reconnect-progress::after {
    content: '';
    display: block;
    width: 30%;
    height: 100%;
    background: #3498db;
    animation: reconnect-progress 1.5s ease-in-out infinite;
}

@keyframes reconnect-progress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    .modal-overlay {
        padding: 1rem;
    }

    .modal,
    .modal-sm,
    .modal-md,
    .modal-lg,
    .modal-content {
        width: 95vw !important;
        max-height: 90vh;
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .reconnect-popup {
        padding: 1.5rem;
    }

    .reconnect-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-close {
        font-size: 1.25rem;
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   Editor Modal Header - Tablet Style
   ============================================ */

.modal-header.tablet-style {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.modal-header.tablet-style h2 {
    color: white;
    font-size: 1.1rem;
    margin: 0;
}

.modal-header.tablet-style .modal-close {
    color: white;
}

.modal-header.tablet-style .modal-close:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Opacity Controls */
.editor-opacity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
}

.editor-opacity-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.25);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-opacity-btn:hover {
    background: rgba(255,255,255,0.35);
}

.editor-opacity-btn:active {
    background: rgba(255,255,255,0.4);
    transform: scale(0.95);
}

.editor-opacity-value {
    min-width: 45px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.editor-opacity-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    margin-right: 0.25rem;
}

/* Editor Action Buttons */
.editor-btn-save {
    padding: 0.5rem 1rem;
    background: #27ae60;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.editor-btn-save:hover {
    background: #219a52;
}

.editor-btn-save:active {
    background: #1e8449;
}

.editor-btn-cancel {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.editor-btn-cancel:hover {
    background: rgba(255,255,255,0.3);
}

.editor-btn-cancel:active {
    background: rgba(255,255,255,0.35);
}

/* ============================================
   Outline Buttons (für Settings Modal)
   ============================================ */

.btn-save-outline {
    padding: 0.5rem 1rem;
    background: rgba(39, 174, 96, 0.1);
    border: 2px solid #27ae60;
    color: #27ae60;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-outline:hover {
    background: rgba(39, 174, 96, 0.2);
}

.btn-save-outline:active {
    background: rgba(39, 174, 96, 0.3);
    transform: scale(0.98);
}

.btn-cancel-outline {
    padding: 0.5rem 1rem;
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid #e74c3c;
    color: #e74c3c;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-outline:hover {
    background: rgba(231, 76, 60, 0.2);
}

.btn-cancel-outline:active {
    background: rgba(231, 76, 60, 0.3);
    transform: scale(0.98);
}

/* ============================================
   Button Design System
   ============================================ */

:root {
    --btn-primary: #3498db;
    --btn-success: #27ae60;
    --btn-danger: #e74c3c;
    --btn-secondary: #95a5a6;
    --btn-cancel-bg: #ffffff;
    --btn-cancel-border: #ccc;
    --btn-cancel-color: #333;
    --btn-ai-start: #667eea;
    --btn-ai-end: #764ba2;
    --btn-border-radius: 4px;
    --btn-transition: all 0.2s ease;
}

/* ============================================
   Base Button Styles
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: none;
    border-radius: var(--btn-border-radius);
    transition: var(--btn-transition);
    outline: none;
}

.btn:focus {
    outline: 2px solid rgba(52, 152, 219, 0.3);
    outline-offset: 2px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   Button Variants (Colors)
   ============================================ */

.btn-primary {
    background: var(--btn-primary);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: var(--btn-success);
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: var(--btn-danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: var(--btn-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-cancel {
    background: var(--btn-cancel-bg);
    border: 1px solid var(--btn-cancel-border);
    color: var(--btn-cancel-color);
}

.btn-cancel:hover {
    background: #f8f9fa;
    border-color: #999;
}

.btn-ai {
    background: linear-gradient(135deg, var(--btn-ai-start) 0%, var(--btn-ai-end) 100%);
    color: white;
    font-weight: 600;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f91 100%);
}

/* ============================================
   Button Sizes
   ============================================ */

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

.btn-md {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.05rem;
}

/* ============================================
   Icon Buttons
   ============================================ */

.btn-icon {
    min-width: 40px;
    padding: 0.5rem 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-sm {
    min-width: 32px;
    padding: 0.4rem 0.6rem;
}

.btn-icon.btn-lg {
    min-width: 48px;
    padding: 0.75rem 1rem;
}

/* ============================================
   Block Button (Full Width)
   ============================================ */

.btn-block {
    display: flex;
    width: 100%;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 2px dashed #6c757d;
    border-radius: 6px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: var(--btn-transition);
}

.btn-block:hover {
    background: #e9ecef;
    border-color: #495057;
    transform: none;
}

/* ============================================
   Format Buttons (Text Editor)
   ============================================ */

.format-btn {
    background: white;
    border: 1px solid #333;
    color: #333;
    padding: 0.5rem 0.75rem;
    min-width: 40px;
    cursor: pointer;
    border-radius: var(--btn-border-radius);
    transition: var(--btn-transition);
    font-weight: 500;
}

.format-btn:hover {
    background: #f0f0f0;
    border-color: #000;
}

.format-btn:active,
.format-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

.format-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Delete Button (Legacy Support)
   ============================================ */

.delete-btn {
    background: var(--btn-danger);
    color: white;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--btn-border-radius);
    cursor: pointer;
    transition: var(--btn-transition);
}

.delete-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* ============================================
   Button Groups
   ============================================ */

.btn-group {
    display: inline-flex;
    gap: 0.5rem;
}

.btn-group .btn {
    margin: 0;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-group-vertical .btn {
    width: 100%;
}

/* ============================================
   Button Toolbar
   ============================================ */

.btn-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================
   Loading State
   ============================================ */

.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    .btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.95rem;
    }

    .btn-lg {
        padding: 0.65rem 1.25rem;
        font-size: 1rem;
    }

    .btn-toolbar {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   Legacy Support (alte Inline-Style Klassen)
   ============================================ */

button[id$="Btn"],
button[id$="Button"] {
    /* Automatisch btn-Klasse erben falls vergessen */
}

#saveBtn:not(.btn) {
    background: var(--btn-primary);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--btn-border-radius);
    cursor: pointer;
}

#cancelBtn:not(.btn) {
    background: white;
    border: 1px solid var(--btn-cancel-border);
    color: var(--btn-cancel-color);
    padding: 0.5rem 1rem;
    border-radius: var(--btn-border-radius);
    cursor: pointer;
}

