/* Farbvariablen */
:root {
  --bg: #0e0e12;
  --bg-alt: #181820;
  --text: #f2f2f7;
  --muted: #9e9eaa;
  --border: #262630;

  --primary: #ff9ee5;
  --primary-glow: 0 0 12px rgba(255, 158, 229, 0.65);

  --radius: 14px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Reset & Grundlayout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  margin: 0;
  line-height: 1.6;
}

main.page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

body.home main.page {
  padding: 0;
  justify-content: flex-end;
}

footer.footer {
  flex-shrink: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 98%;
  margin-inline: auto;
  padding-inline: 20px;
}

/* === Navbar === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 15, 20, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
  padding-inline: 50px;
  min-height: 72px;
}

.navbar__left {
  flex: 0 0 auto;
}

.navbar__right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-brand__logo {
  height: 46px;
  filter: drop-shadow(0 0 8px rgba(255, 160, 230, 0.8));
}

/* Navigation */
.nav__list {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  transition: 0.2s;
  color: var(--text);
  font-weight: 500;
}
.nav__link:hover,
.nav__link.is-active {
  background: var(--primary);
  color: #000;
  box-shadow: var(--primary-glow);
}

.nav__link--group {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

/* Dropdown */
.has-dropdown {
  position: relative;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  flex-direction: column;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  row-gap: 0.25rem;
}

.dropdown > li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.has-dropdown:hover .dropdown {
  display: flex;
}

.dropdown__link {
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius);
  transition: 0.2s;
  display: block;
}
.dropdown__link:hover {
  background: var(--primary);
  color: #000;
}

/* Caret Icon (Dropdown-Pfeil) */
.caret {
  width: 18px;
  height: 18px;
  opacity: 0.8;
  transform: translateY(2px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__link:hover .caret {
  opacity: 1;
  transform: translateY(3px);
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: var(--primary-glow);
}
.btn-primary:hover {
  transform: scale(1.05);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  transition: 0.2s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  box-shadow: var(--primary-glow);
  transform: scale(1.03);
  text-decoration: none;
}
.error-btn-secondary{
  background: transparent;
  border:1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding:.6rem 1.2rem;
  transition:.2s;
}
.error-btn-secondary:hover{
  border-color: var(--accent, #dc2626);
  box-shadow: 0 0 16px color-mix(in oklab, var(--accent, #dc2626) 40%, transparent);
  text-decoration:none;
  transform: translateY(-1px);
}
.info-btn-secondary{
  background: transparent;
  border:1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding:.6rem 1.2rem;
  transition:.2s;
}
.info-btn-secondary:hover{
  border-color: var(--accent, #3B82F6);
  box-shadow: 0 0 16px color-mix(in oklab, var(--accent, #3B82F6) 40%, transparent);
  text-decoration:none;
  transform: translateY(-1px);
}
/* === Muted Buttons === */
.btn-muted {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  opacity: 0.75;
  border-radius: var(--radius);
  padding: .45rem .9rem;
  font-size: .95rem;
  transition: all .15s ease;
}
.btn-muted:hover {
  opacity: 1;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 6px rgba(255,255,255,0.05);
}
.btn-muted:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* === Fancy Checkboxes === */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in oklab, var(--bg-alt) 88%, white 12%);
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
input[type="checkbox"]:hover {
  border-color: var(--primary);
  box-shadow: var(--primary-glow);
}
input[type="checkbox"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--primary-glow);
}

input[type="checkbox"]::before {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: transform .16s ease-in-out;
  box-shadow: inset 1em 1em var(--primary);
  border-radius: 4px;
}
input[type="checkbox"]:checked::before {
  transform: scale(1);
}
label.checkbox, .checkbox-inline label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
}

/* Checkbox-Labels horizontal ausrichten */
.block label.checkbox,
.checkbox-inline label.checkbox,
label.checkbox {
  display: inline-flex;
  flex-direction: row !important;
  align-items: center;
  gap: .55rem;
  line-height: 1;
}

label.checkbox > input[type="checkbox"],
.checkbox-inline label.checkbox > input[type="checkbox"] {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  margin-bottom: 0.25rem;
}

/* === TomSelect === */
.ts-wrapper {
  --ts-bg: var(--bg-alt);
  --ts-border: var(--border);
  --ts-text: var(--text);
  --ts-muted: var(--muted);
  --ts-accent: var(--primary);
}

.ts-control,
.ts-dropdown,
.ts-dropdown .option,
.ts-dropdown .optgroup-header {
  background-color: var(--ts-bg) !important;
  color: var(--ts-text) !important;
  border-color: var(--ts-border) !important;
}

.ts-control {
  border: 1px solid var(--ts-border) !important;
  border-radius: var(--radius);
  min-height: 38px;
  padding: .35rem .5rem;
  box-shadow: none;
}

.ts-control input {
  color: var(--ts-text) !important;
  background: transparent !important;
}

.ts-dropdown {
  border: 1px solid var(--ts-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  border-radius: var(--radius);
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
  background: color-mix(in oklab, var(--primary) 30%, var(--bg-alt) 70%) !important;
  color: #000 !important;
}

.ts-control .item {
  background: color-mix(in oklab, var(--primary) 25%, var(--bg-alt) 75%) !important;
  color: #000 !important;
  border-radius: 999px;
  padding: .2rem .6rem;
}

.ts-wrapper.multi .ts-control .item {
  margin-right: .25rem;
}

.ts-control:focus,
.ts-wrapper.focus .ts-control {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1px var(--primary);
}

.ts-dropdown .no-results {
  color: var(--ts-muted);
  opacity: .8;
}

/* === Footer === */
.footer {
  background: var(--bg-alt);
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text);
}

.footer__link {
  color: var(--primary);
  text-decoration: none;
}
.footer__link:hover {
  text-decoration: underline;
}

.footer__note {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* === Inputs === */
input,
textarea,
select {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--primary-glow);
}

/* === Cards / Tables === */
.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
}

/* === Mobile Navbar === */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
  border-radius: 2px;
}

/* === Toasts === */
.toast-root{
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

/* Hauptcontainer */
.toast{
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(16px);
  animation: toast-in 240ms ease forwards;
}

.toast.is-out {
  animation: toast-out 180ms ease forwards;
}

/* === Icon im Kreis === */
.toast__icon{
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.toast--success .toast__icon { background: #16a34a; }
.toast--error   .toast__icon { background: #dc2626; }
.toast--warning .toast__icon { background: #d97706; }
.toast--info    .toast__icon { background: #3B82F6; }

/* === Textbereich === */
.toast__body {
  min-width: 0;
  line-height: 1.4;
}

.toast__title {
  font-weight: 700;
  margin-bottom: 2px;
}

.toast__message {
  color: var(--text);
  opacity: .95;
  word-break: break-word;
}

/* === Close-Button === */
.toast__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: #ff4c4c;
  font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.85;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.toast__close:hover {
  opacity: 1;
  background: rgba(255, 76, 76, 0.1);
  transform: scale(1.1);
}

/* === Typ-Farbleiste === */
.toast--success { border-left-color: #16a34a; }
.toast--error   { border-left-color: #dc2626; }
.toast--warning { border-left-color: #d97706; }
.toast--info    { border-left-color: #3B82F6; }

/* === Animationen === */
@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(16px); }
}

/* === Tabellen === */
.table thead th {
  text-align: left;
  font-weight: 600;
}
.table td { vertical-align: middle; }

/* === Thumbnails === */
.img-thumb {
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 1px;
  cursor: zoom-in;
}

/* === Lightbox === */
.lightbox-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.lightbox-backdrop.is-open { display: flex; }

.lightbox-dialog {
  max-width: min(92vw, 1200px);
  max-height: 90vh;
  outline: none;
}
.lightbox-dialog img {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lightbox-close {
  position: fixed; top: 20px; right: 20px;
  background: rgba(255,255,255,.12);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: .5rem .8rem;
  cursor: pointer;
  font-weight: 700;
  z-index: 9999;
  backdrop-filter: blur(6px);
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }

@media (max-width: 960px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    flex-direction: column;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
  }

  .nav.is-open {
    display: flex;
  }

  .nav__list,
  .nav__list li {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .nav__link {
    padding: 0.9rem 1rem;
  }

  .dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    row-gap: 0.25rem;
  }

  .has-dropdown:hover .dropdown {
    display: none;
  }

  .has-dropdown.open .dropdown {
    display: flex;
  }
}
