:root {
  --ppoe-rot: #9D2632;
  --ppoe-pink: #E6007E;
  --ppoe-braun: #904837;
  --ppoe-gelb: #FBBB21;
  --ppoe-gruen: #159A34;
  --ppoe-blau: #0B4697;
  --ppoe-rot2: #E62336;
  --ppoe-grau: #4D4F5A;
  --ppoe-dunkelgruen: #00712F;
  --ppoe-hellgruen: #95C23D;
  --ppoe-tuerkis: #00AB97;
  --ppoe-hellblau: #80C2E8;
  --ppoe-gold: #C6A443;
  --ppoe-violett: #4A5A8E;
  --ppoe-magenta: #A7358B;
  --ppoe-orange: #EB5C37;

  --primary: var(--ppoe-blau);
  --accent: var(--ppoe-rot);
  --background: var(--ppoe-hellblau);
  --navbar-bg: #fff;
  --navbar-text: var(--ppoe-grau);
  --footer-bg: #fff;
  --footer-text: var(--ppoe-grau);
  --card-bg: #fff;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.05);
  --border-radius: 12px;
  --transition: 0.3s;
}

body {
  background: var(--background);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color: #222;
  transition: background var(--transition), color var(--transition);
}

.navbar {
  background: var(--navbar-bg) !important;
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  position: relative;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent) !important;
}

.nav-link {
  color: var(--primary) !important;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--ppoe-pink) !important;
}

body.dark-mode .nav-link.active {
  color: var(--ppoe-orange) !important;
}

.card, .container {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
  margin-top: 70px;
}

@media (max-width: 768px) {
  .card, .container {
    margin-top: 56px;
  }
}

footer {
  background: var(--footer-bg) !important;
  color: var(--footer-text) !important;
  border-top: 1px solid #e5e5e5;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.toggle-switch input[type="checkbox"] {
  width: 40px;
  height: 20px;
  appearance: none;
  background: #ddd;
  border-radius: 10px;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-switch input[type="checkbox"]:checked {
  background: var(--primary);
}

.toggle-switch input[type="checkbox"]::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle-switch input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

.toggle-switch label {
  font-size: 0.95rem;
  color: var(--navbar-text);
}

/* Dark mode styles */
body.dark-mode {
  --background: var(--ppoe-grau);
  --navbar-bg: var(--ppoe-dunkelgruen);
  --navbar-text: #e5e5e5;
  --footer-bg: var(--ppoe-dunkelgruen);
  --footer-text: #e5e5e5;
  --card-bg: var(--ppoe-grau);
  color: #e5e5e5;
}

body.dark-mode .navbar,
body.dark-mode footer {
  background: var(--navbar-bg) !important;
  color: var(--navbar-text) !important;
}

body.dark-mode .nav-link,
body.dark-mode .navbar-brand {
  color: var(--ppoe-gelb) !important;
}

body.dark-mode .card, body.dark-mode .container {
  background: var(--card-bg);
  color: #e5e5e5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

body.dark-mode .toggle-switch label {
  color: #e5e5e5;
}

/* Dark mode for forms and tables */
body.dark-mode .form-control,
body.dark-mode .form-select {
  background: #23272f;
  color: #e5e5e5;
  border-color: #444;
}

body.dark-mode .form-control::placeholder {
  color: #aaa;
}

body.dark-mode .form-select option {
  background: #23272f;
  color: #e5e5e5;
}

body.dark-mode .btn {
  background-color: #353a45;
  color: #e5e5e5;
  border-color: #444;
}

body.dark-mode .btn-primary {
  background-color: var(--ppoe-blau);
  color: #fff;
  border-color: var(--ppoe-blau);
}

body.dark-mode .btn-warning {
  background-color: var(--ppoe-gelb);
  color: #222;
  border-color: var(--ppoe-gelb);
}

body.dark-mode .btn-danger {
  background-color: var(--ppoe-rot2);
  color: #fff;
  border-color: var(--ppoe-rot2);
}

body.dark-mode .btn-success {
  background-color: var(--ppoe-gruen);
  color: #fff;
  border-color: var(--ppoe-gruen);
}

body.dark-mode .btn-info {
  background-color: var(--ppoe-tuerkis);
  color: #222;
  border-color: var(--ppoe-tuerkis);
}

body.dark-mode .btn-secondary {
  background-color: var(--ppoe-violett);
  color: #fff;
  border-color: var(--ppoe-violett);
}

body.dark-mode .btn-pink {
  background-color: var(--ppoe-pink);
  color: #fff;
  border-color: var(--ppoe-pink);
}

body.dark-mode .btn-orange {
  background-color: var(--ppoe-orange);
  color: #fff;
  border-color: var(--ppoe-orange);
}

body.dark-mode table.table,
body.dark-mode .table {
  background: #23272f !important;
  color: #e5e5e5 !important;
}

body.dark-mode .table thead,
body.dark-mode .table-light {
  background: #181a20 !important;
  color: #e5e5e5 !important;
}

body.dark-mode .table tbody tr {
  background: #23272f;
}

body.dark-mode .table-hover tbody tr:hover {
  background: #353a45;
}

body.dark-mode td,
body.dark-mode th {
  background: #23272f !important;
  color: #e5e5e5 !important;
}

body.dark-mode .border,
body.dark-mode .rounded {
  border-color: #444 !important;
}

/* Fix Bootstrap bg-light and text-muted in dark mode */
body.dark-mode .bg-light {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
}

body.dark-mode .text-muted {
  color: #aaa !important;
}

/* PPÖ heading style */
.ppoe-title {
  color: var(--primary) !important;
}

body.dark-mode .ppoe-title {
  color: var(--ppoe-gelb) !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: var(--ppoe-magenta) !important;
}

/* Yellow navbar-toggler-icon in dark mode */
body.dark-mode .navbar-toggler-icon {
  background-image: none;
  border: none;
}
body.dark-mode .navbar-toggler-icon {
  background-color: transparent;
}
body.dark-mode .navbar-toggler-icon::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath stroke='%23FBBB21' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Dark mode for list-group */
body.dark-mode .list-group {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
}

body.dark-mode .list-group-item {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
  border-color: #444 !important;
}

body.dark-mode .list-group-item.active,
body.dark-mode .list-group-item.active:focus,
body.dark-mode .list-group-item.active:hover {
  background-color: var(--ppoe-blau) !important;
  color: #fff !important;
  border-color: var(--ppoe-blau) !important;
}

/* Dark mode for dropdown-menu */
body.dark-mode .dropdown-menu {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
  border-color: #444 !important;
}

body.dark-mode .dropdown-menu .dropdown-item {
  background-color: transparent !important;
  color: #e5e5e5 !important;
  border: none;
}

body.dark-mode .dropdown-menu .dropdown-item:hover,
body.dark-mode .dropdown-menu .dropdown-item:focus {
  background-color: var(--ppoe-tuerkis) !important;
  color: #222 !important;
}

body.dark-mode .dropdown-menu .user-info {
  color: var(--ppoe-gelb) !important;
}

body.dark-mode .dropdown-menu .dropdown-item-text {
  color: #e5e5e5 !important;
}

/* Dark mode for Select2 */
body.dark-mode .select2-selection {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
  border-color: #444 !important;
}

body.dark-mode .select2-selection__choice {
  background-color: var(--ppoe-tuerkis) !important;
  color: #222 !important;
  border-color: var(--ppoe-tuerkis) !important;
}

body.dark-mode .select2-selection__choice__display {
  color: #222 !important;
}

body.dark-mode .select2-dropdown {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
  border-color: #444 !important;
}

body.dark-mode .select2-results {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
}

body.dark-mode .select2-results__option {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
}

body.dark-mode .select2-results__option--highlighted {
  background-color: var(--ppoe-pink) !important;
  color: #fff !important;
}

body.dark-mode .select2-search__field {
  background-color: #23272f !important;
  color: #e5e5e5 !important;
  border-color: #444 !important;
}
