/* Cookie Banner Styles */
#cookie-banner {
    position: fixed !important;
    left: 50% !important;
    bottom: 2rem !important;
    transform: translateX(-50%) translateY(120%) !important;
    min-width: 320px !important;
    max-width: 900px !important;
    width: 95vw !important;
    z-index: 9999 !important;
    background: #fff !important;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.18) !important;
    border-radius: 1.5rem !important;
    padding: 2rem 1.5rem 1.5rem 1.5rem !important;
    border: none !important;
    margin: 0 auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 0.98 !important;
    transition: transform 0.45s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s;
}

#cookie-banner.visible {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 1 !important;
}

@media (max-width: 991.98px) {
    #cookie-banner {
        max-width: 98vw !important;
        min-width: 0 !important;
        padding: 1.25rem 0.5rem !important;
        left: 50%;
        right: auto;
        bottom: 1rem !important;
    }
}

html[data-bs-theme="dark"] #cookie-banner {
    background: #212529 !important;
    color: #f8f9fa !important;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.45) !important;
}

#cookie-banner .cookie-banner-text {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

#cookie-banner .cookie-banner-text i {
    font-size: 1.6rem;
    color: #f59e42;
}

html[data-bs-theme="dark"] #cookie-banner .cookie-banner-text i {
    color: #ffd580;
}

#cookie-banner .cookie-categories {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

#cookie-banner .cookie-category {
    background: #f8f9fa;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border: 1px solid #ececec;
}

html[data-bs-theme="dark"] #cookie-banner .cookie-category {
    background: #23272b;
    color: #f8f9fa;
    border: 1px solid #343a40;
}

#cookie-banner .cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-direction: row;
}

@media (max-width: 991.98px) {
    #cookie-banner .cookie-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    #cookie-banner .cookie-buttons .btn {
        width: 100%;
    }
}


#cookie-banner .btn {
/*     border-radius: 1rem !important; */
    padding: 0.6rem 1.5rem !important;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    transition: background 0.2s, color 0.2s;
}

#cookie-banner .btn-primary {
    background: #6366f1;
    border: none;
    color: #fff;
}
#cookie-banner .btn-primary:hover {
    background: #4f46e5;
}

#cookie-banner .btn-success {
    background: #22c55e;
    border: none;
    color: #fff;
}
#cookie-banner .btn-success:hover {
    background: #16a34a;
}

#cookie-banner .btn-outline-secondary {
    background: transparent;
    border: 2px solid #6366f1;
    color: #6366f1;
}
#cookie-banner .btn-outline-secondary:hover {
    background: #6366f1;
    color: #fff;
}

html[data-bs-theme="dark"] #cookie-banner .btn-primary {
    background: #6366f1;
    color: #fff;
}
html[data-bs-theme="dark"] #cookie-banner .btn-success {
    background: #22c55e;
    color: #fff;
}
html[data-bs-theme="dark"] #cookie-banner .btn-outline-secondary {
    border: 2px solid #a5b4fc;
    color: #a5b4fc;
}
html[data-bs-theme="dark"] #cookie-banner .btn-outline-secondary:hover {
    background: #a5b4fc;
    color: #23272b;
}

#cookie-banner .cookie-category-label {
    font-weight: 600;
    font-size: 1rem;
}

#cookie-banner .cookie-category-description {
    font-size: 0.96rem;
    color: #63666a;
}

html[data-bs-theme="dark"] #cookie-banner .cookie-category-description {
    color: #d1d5db;
}

@media (max-width: 991.98px) {
    #cookie-banner {
        min-width: unset !important;
        max-width: 98vw !important;
        padding: 1.25rem 0.5rem !important;
        left: 1%;
        right: 1%;
    }
}

/* Kein zusätzliches padding-bottom mehr nötig */


#cookie-banner .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1.5rem !important;
}

/* Sicherstellen, dass der Inhalt nicht hinter dem Banner verschwindet */
body {
    padding-bottom: 200px !important;
}

/* Debugging */
#cookie-banner {
    border: 2px solid #6366f1 !important;
}

/* Responsive Anpassungen */
@media (max-width: 991.98px) {
    #cookie-banner {
        padding: 1.25rem 0;
    }

    body {
        padding-bottom: 160px;
    }
}

@media (max-width: 767.98px) {
    #cookie-banner {
        padding: 1rem 0;
    }

    body {
        padding-bottom: 200px;
    }

    #cookie-banner .container {
        padding: 0 1rem;
    }
}

/* Scrollbar für das Banner anpassen */
#cookie-banner::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#cookie-banner::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#cookie-banner::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#cookie-banner::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.cookie-categories {
    margin: 1rem 0;
}

.cookie-category {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.cookie-category h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.cookie-category-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-top: 1rem;
}

/* Responsive Anpassungen */
@media (max-width: 767.98px) {
    .cookie-buttons {
        flex-direction: column;
    }

    .cookie-buttons .btn {
        width: 100%;
    }
}

/* Toast-Benachrichtigungen */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    color: white;
    background-color: #28a745;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 12000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 350px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.toast-notification.error {
    background-color: #dc3545;
}

.toast-notification.warning {
    background-color: #ffc107;
    color: #212529;
}

:root {
  /* Verwende die Bootstrap-Variablen für bessere Integration */
  --cb-bg: var(--bs-body-bg);
  --cb-text: var(--bs-body-color);
  --cb-border: var(--bs-border-color);
  --cb-primary: var(--bs-primary);
  --cb-primary-hover: var(--bs-primary-dark);
  --cb-secondary: var(--bs-secondary-bg);
  --cb-secondary-hover: var(--bs-tertiary-bg);
  --cb-success: var(--bs-success);
  --cb-success-hover: #0d6e4f;
  --cb-shadow: var(--bs-box-shadow);
  --cb-radius: var(--bs-border-radius);
  --cb-transition: all 0.2s ease-in-out;
  --cb-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Dark Mode Anpassungen werden automatisch über Bootstrap-Variablen übernommen */
[data-bs-theme="dark"] {
  --cb-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

/* Banner Container */
#cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  max-width: 420px;
  width: calc(100% - 3rem);
  z-index: 1090;
  padding: 1.25rem;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  background-color: var(--cb-bg);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-box-shadow);
  opacity: 0;
}

/* Banner Content */
#cookie-banner .container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.cookie-banner-text {
  color: var(--cb-text);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.cookie-banner-text a {
  color: var(--cb-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--cb-transition);
}

.cookie-banner-text a:hover {
  text-decoration: underline;
  color: var(--cb-primary-hover);
}

/* Cookie Kategorien */
.cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin: 0;
  padding: 0 0.25rem;
}

.cookie-categories.expanded {
  max-height: 500px;
  margin: 1rem 0;
}

.cookie-category {
  margin-bottom: 0.75rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 0.75rem;
  transition: var(--cb-transition);
}

.cookie-category:hover {
  background-color: var(--cb-secondary-hover);
}

.cookie-category .form-check {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cookie-category .form-check-input {
  margin-top: 0.25rem;
  margin-right: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  border-color: var(--cb-border);
  background-color: var(--cb-bg);
}

.cookie-category .form-check-input:checked {
  background-color: var(--cb-primary);
  border-color: var(--cb-primary);
}

.cookie-category .form-check-label {
  font-weight: 600;
  color: var(--cb-text);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.cookie-category-description {
  color: var(--cb-text);
  opacity: 0.9;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.cookie-category .small {
  color: var(--cb-text);
  opacity: 0.8;
  font-size: 0.85rem;
}

.cookie-category .small ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
}

/* Buttons */
.cookie-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  margin-top: 0.5rem;
}

.cookie-buttons .btn {
  padding: 0.4rem 0.8rem;
  border-radius: var(--bs-border-radius);
  font-weight: 500;
  transition: var(--cb-transition);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  line-height: 1.2;
}

.cookie-buttons .btn-outline-secondary {
  background-color: transparent;
  border: 1px solid var(--cb-border);
  color: var(--cb-text);
}

.cookie-buttons .btn-outline-secondary:hover {
  background-color: var(--cb-secondary);
  border-color: var(--cb-border);
  color: var(--cb-text);
}

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

.cookie-buttons .btn-primary:hover {
  background-color: var(--cb-primary-hover);
  transform: translateY(-1px);
}

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

.cookie-buttons .btn-success:hover {
  background-color: var(--cb-success-hover);
  transform: translateY(-1px);
}

/* Responsive Anpassungen */
@media (max-width: 575.98px) {
  #cookie-banner {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    max-width: none;
  }

  .cookie-buttons {
    flex-direction: column;
  }

  .cookie-buttons .btn {
    width: 100%;
  }
}

/* Animationen */
@keyframes slideInUp {
  from {
    transform: translate3d(0, 100%, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideOutDown {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(0, 100%, 0);
  }
}

/* Toggle Switch */
.cookie-category .form-check-input[type="checkbox"] {
  width: 2em;
  height: 1.25em;
  margin-top: 0.25em;
  margin-right: 0.5em;
  float: right;
  background-color: var(--bs-secondary-bg);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
  background-position: left center;
  border-radius: 2em;
  border: 1px solid var(--bs-border-color);
  transition: background-position 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.cookie-category .form-check-input:checked[type="checkbox"] {
  background-position: right center;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* Hover-Effekte für bessere Interaktivität */
.cookie-category {
  cursor: pointer;
}

.cookie-category input[type="checkbox"] {
  cursor: pointer;
}

/* Feine Anpassungen für bessere Lesbarkeit */
#cookie-banner {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Verbesserte Fokus-Stile für Barrierefreiheit */
.cookie-buttons .btn:focus {
  outline: 2px solid var(--cb-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* Consent-ID Card */
#cookie-banner .cookie-consent-id-card .cookie-card {
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-box-shadow);
  background-color: var(--cb-bg);
}
#cookie-banner .cookie-consent-id-card .cookie-card-header {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--cb-border);
  color: var(--cb-text);
}
#cookie-banner .cookie-consent-id-card .cookie-card-body {
  padding: 0.75rem;
}
#cookie-banner .cookie-consent-id-card .consent-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  user-select: text;
  cursor: pointer;
}
#cookie-banner .cookie-consent-id-card .consent-id.blurred {
  filter: blur(6px);
}
#cookie-banner .cookie-consent-id-card .btn {
  line-height: 1.1;
  padding: 0.25rem 0.5rem;
}
[data-bs-theme="dark"] #cookie-banner .cookie-consent-id-card .cookie-card {
  background-color: var(--cb-bg);
  border-color: var(--cb-border);
}

/* Anpassungen für sehr große Bildschirme */
@media (min-width: 1600px) {
  #cookie-banner .container {
    max-width: 1400px;
  }
}
@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}
