/* Cookie Banner - WCAG 2.2 AA konform */

#rb-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  z-index: 99999;
  font-family: 'Futura', 'Century Gothic', sans-serif;
  color: #c9d1d9;
  font-size: 16px;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#rb-cookie-banner.rb-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.rb-banner-inner {
  padding: 22px;
}

.rb-title {
  font-size: 17px;
  font-weight: 700;
  color: #c9d1d9;
  margin: 0 0 12px;
}

.rb-text {
  font-size: 14px;
  color: #8b949e;
  line-height: 1.6;
  margin: 0 0 16px;
}

.rb-link {
  color: #2f81f7;
  text-decoration: underline;
}

.rb-link:hover { color: #58a6ff; }

/* Einwilligungsauswahl */
.rb-selection-label {
  font-size: 13px;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.rb-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 16px;
}

.rb-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #c9d1d9;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}

.rb-check-item input {
  display: none;
}

.rb-check-box {
  width: 18px;
  height: 18px;
  border: 2px solid #30363d;
  border-radius: 4px;
  background: #0d1117;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.rb-check-item:focus-within .rb-check-box {
  outline: 3px solid #2f81f7;
  outline-offset: 2px;
}

.rb-check-item input:checked + .rb-check-box {
  background: #2f81f7;
  border-color: #2f81f7;
}

.rb-check-item input:checked + .rb-check-box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.rb-check-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Buttons */
.rb-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.rb-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.rb-btn:focus-visible {
  outline: 3px solid #2f81f7;
  outline-offset: 2px;
}

.rb-btn-primary {
  background: #2f81f7;
  color: #fff;
  border-color: #2f81f7;
}

.rb-btn-primary:hover {
  background: #1f6feb;
  border-color: #1f6feb;
}

.rb-btn-secondary {
  background: transparent;
  color: #c9d1d9;
  border-color: #30363d;
}

.rb-btn-secondary:hover {
  color: #c9d1d9;
  border-color: #8b949e;
}

.rb-btn-ghost {
  background: transparent;
  color: #8b949e;
  border: none;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  padding: 8px 0;
  min-height: 44px;
  display: block;
  width: 100%;
  text-align: center;
}

.rb-btn-ghost:hover { color: #c9d1d9; }

.rb-btn-ghost:focus-visible {
  outline: 3px solid #2f81f7;
  outline-offset: 2px;
  border-radius: 4px;
}

.rb-btn-sm {
  font-size: 13px;
  min-height: 44px;
  flex: 1;
}

/* Tabs */
.rb-tabs {
  display: flex;
  border-bottom: 1px solid #30363d;
  margin-bottom: 12px;
}

.rb-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #8b949e;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: -1px;
  min-height: 44px;
  transition: color 0.15s, border-color 0.15s;
}

.rb-tab:hover { color: #c9d1d9; }

.rb-tab:focus-visible {
  outline: 3px solid #2f81f7;
  outline-offset: -2px;
  border-radius: 4px;
}

.rb-tab.rb-tab-active {
  color: #c9d1d9;
  border-bottom-color: #2f81f7;
  font-weight: 700;
}

/* Details Scroll */
.rb-details-scroll {
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #30363d #0d1117;
  margin-bottom: 12px;
}

.rb-details-scroll::-webkit-scrollbar { width: 5px; }
.rb-details-scroll::-webkit-scrollbar-track { background: #0d1117; }
.rb-details-scroll::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }

/* Kategorie-Akkordeon */
.rb-cat-row {
  border: 1px solid #30363d;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #0d1117;
}

.rb-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: #c9d1d9;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.rb-cat-header:hover { background: rgba(255,255,255,0.03); }

.rb-cat-header:focus-visible {
  outline: 3px solid #2f81f7;
  outline-offset: -2px;
}

.rb-cat-arrow {
  flex-shrink: 0;
  color: #8b949e;
  transition: transform 0.2s;
}

.rb-cat-open .rb-cat-arrow { transform: rotate(90deg); }

.rb-cat-name { flex: 1; }

.rb-cat-body {
  display: none;
  padding: 0 14px 14px;
  border-top: 1px solid #30363d;
}

.rb-cat-open .rb-cat-body { display: block; }

.rb-cat-desc {
  font-size: 14px;
  color: #8b949e;
  line-height: 1.6;
  margin: 12px 0 8px;
}

.rb-cookie-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.rb-cookie-tag {
  font-size: 13px;
  color: #8b949e;
  background: #1c2128;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 3px 9px;
}

.rb-no-cookies {
  font-size: 13px;
  color: #8b949e;
  font-style: italic;
  margin: 8px 0 0;
}

.rb-badge {
  font-size: 12px;
  color: #8b949e;
  background: #1c2128;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* Toggle */
.rb-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.rb-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.rb-toggle-track {
  position: absolute;
  inset: 0;
  background: #30363d;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.rb-toggle:focus-within .rb-toggle-track {
  outline: 3px solid #2f81f7;
  outline-offset: 2px;
}

.rb-toggle input:checked + .rb-toggle-track { background: #2f81f7; }

.rb-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  pointer-events: none;
}

.rb-toggle input:checked ~ .rb-toggle-thumb { transform: translateX(16px); }

/* Über Cookies */
.rb-about-text {
  font-size: 14px;
  color: #8b949e;
  line-height: 1.7;
  margin: 0 0 12px;
}

.rb-updated {
  font-size: 13px;
  color: #30363d;
  margin: 4px 0 12px;
  text-align: right;
}

/* Privacy Trigger */
#rb-trigger-wrap {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99998;
}

#rb-cookie-trigger {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 44px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 22px;
  color: #8b949e;
  font-size: 14px;
  font-family: 'Futura', 'Century Gothic', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: color 0.15s, border-color 0.15s;
}

#rb-cookie-trigger:hover { color: #c9d1d9; border-color: #8b949e; }

#rb-cookie-trigger:focus-visible {
  outline: 3px solid #2f81f7;
  outline-offset: 2px;
}

/* Trigger Panel */
#rb-trigger-panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 10px;
  width: 340px;
  max-width: calc(100vw - 48px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

#rb-trigger-panel.rb-visible {
  opacity: 1;
  transform: translateY(0);
}

.rb-tp-label {
  font-size: 15px;
  font-weight: 700;
  color: #c9d1d9;
  margin: 0 0 14px;
}

.rb-tp-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #8b949e;
  margin-bottom: 8px;
}

.rb-tp-val {
  color: #c9d1d9;
  font-size: 13px;
  text-align: right;
  max-width: 55%;
}

.rb-tp-id {
  color: #30363d;
  font-size: 13px;
  word-break: break-all;
  text-align: right;
  max-width: 60%;
}

.rb-tp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid #30363d;
  padding-top: 14px;
}

.rb-tp-actions .rb-btn-sm {
  width: 100%;
  flex: none;
}

@media (max-width: 480px) {
  #rb-cookie-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
  }

  #rb-trigger-wrap {
    bottom: 16px;
    left: 16px;
  }

  .rb-actions {
    flex-direction: column;
  }

  .rb-btn {
    width: 100%;
  }
}
