/* --- Variablen & Themes --- */
:root[data-theme="light"] {
  /* Background Layer */
  --bg: #e6e6e6;
  --bg-l3: #dddddd;
  /* Text */
  --text-main: #000000;
  --text-muted: hsl(0, 0%, 10%);
  /* Glass */
  --card-bg: rgba(255, 255, 255, 0.25);
  --card-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  --dropdown-bg: #ffffff;
  --dropdown-hover: #f1f5f9;
  --input-bg: rgba(255, 255, 255, 0.5);
  --table-hover: rgba(0, 0, 0, 0.05);
  /* Scrolllbar */
  --sb-thumb-color: hsl(0, 0%, 65%);
  --sb-thumb-hover: hsl(0, 0%, 55%);
}

:root[data-theme="dark"] {
  /* Background Layer */
  --bg: #0f172a;
  --bg-l3: #334155;
  /* Text */
  --text-main: #ffffff;
  --text-muted: hsl(0, 0%, 90%);
  /* Glass */
  --card-bg: rgba(15, 23, 42, 0.6);
  --card-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --dropdown-bg: #1e293b;
  --dropdown-hover: #334155;
  --input-bg: rgba(15, 23, 42, 0.6);
  --table-hover: rgba(255, 255, 255, 0.05);
  /* Scrolllbar */
  --sb-thumb-color: hsl(0, 0%, 30%);
  --sb-thumb-hover: hsl(0, 0%, 20%);
}

:root {
  /* Scrolllbar */
  --sb-width: 0.5vw;
  --sb-track-color: transparent;
  --accent-glow: 120deg;
  /* Brand Colors */
  --brand: #cc33cc;
  --brand-gradient: linear-gradient(135deg, #cc33cc 0%, #ed1c65 100%);
  --error-color: #ff4b4b;
  --success-color: #10b981;
  /* Layout & Sizes */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --font-main: 'Poppins', sans-serif;
}

/* --- Reset & Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
}

*::selection {
  background: var(--brand);
  color: white;
}

/* Scrollbar */
/* width */
::-webkit-scrollbar {
  width: var(--sb-width);
}
  
/* Track */
::-webkit-scrollbar-track {
  background: none;
}
  
/* Handle */
::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color);
}
  
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: var(--sb-thumb-hover);
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  transition: all .5s ease;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color .5s ease;
}

/* --- Animated Background (Aurora) --- */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
  transition: background .5s ease;
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s infinite alternate;
  border-radius: 50%;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, #cc33cc 0%, transparent 70%);
  animation-delay: 0s;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, #ed1c65 0%, transparent 70%);
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 40%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
  animation-delay: -10s;
  opacity: 0.4;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 50px) scale(1.1); }
}

/* --- Layout Utilities --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  transition: all .5s ease;
}

/* Loader */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: all .5s ease;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--card-border);
  border-bottom-color: var(--brand);
  border-radius: 50%;
  animation: rotation 1s linear infinite;
  transition: all .5s ease;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Formular Elemente --- */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all .5s;
}

.form-input:focus {
  border-color: var(--brand);
}

textarea.form-input {
  resize: vertical;
  min-height: 128px;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--brand-gradient);
  color: white;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .5s, box-shadow .5s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(204, 51, 204, 0.4);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
  width: auto;
}

/* --- Layout Wrapper --- */
.main-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 40px 20px;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
}

.nav-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--card-border);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
}

.nav-badge:hover {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.nav-badge.danger:hover {
  background: var(--error-color);
  border-color: var(--error-color);
}

/* --- Alerts --- */
.alert {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.alert-error {
  background: rgba(255, 75, 75, 0.1);
  color: var(--error-color);
  border: 1px solid var(--error-color);
}

/* --- Header --- */
#header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  transition: all .5s ease;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  width: 192px;
  height: auto;
}

/* --- Theme Switcher --- */
.switch {
  display: inline-block;
  position: relative;
  width: 3em;
  height: 1.75em;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg);
  transition: .4s;
  border-radius: 30px;
  border: 1px solid var(--card-border);
  transition: all .5s ease;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.1em;
  width: 1.1em;
  border-radius: 50%;
  left: 0.4em;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(40deg,#ff0080,#ff8c00 70%);
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--bg-mod-alt);
  transition: all .5s ease;
}

input:checked + .slider:before {
  left: calc(100% - (1.1em + 0.4em));
  background: transparent;
  box-shadow: inset -2px -2px 0 -1.5px #8983f7, inset -6px -3px 0 0 #a3dafb;
}

/* --- Language Dropdown --- */
.lang-dropdown {
  position: relative;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0 16px;
  height: 44px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all .5s ease;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  background: var(--dropdown-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 8px;
  min-width: 120px;
  box-shadow: var(--glass-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all .5s ease;
  z-index: 101;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-main);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  transition: all .5s;
}

.dropdown-item:hover {
  background: var(--dropdown-hover);
}

.dropdown-item.active {
  color: var(--brand);
  background: rgba(204, 51, 204, 0.1);
}