/* ============================================================
   SAAN GmbH – Cookie Consent Banner
   Design: Stahl-Blau #1B4F8A / Orange #E87B2A
   ============================================================ */

/* ── Reset & Body-Lock ───────────────────────────────────── */
body.sc-body-locked {
  overflow: hidden;
}

/* ── Wrapper ─────────────────────────────────────────────── */
#saan-consent {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#saan-consent.sc--visible {
  pointer-events: all;
  opacity: 1;
  visibility: visible;
}

/* ── Backdrop ────────────────────────────────────────────── */
.sc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 40, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ── Panel ───────────────────────────────────────────────── */
.sc-panel {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px 20px 16px 16px;
  box-shadow:
    0 -4px 6px -1px rgba(27, 79, 138, 0.06),
    0 24px 60px -8px rgba(10, 20, 40, 0.35),
    0 0 0 1px rgba(27, 79, 138, 0.08);
  transform: translateY(24px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: #d0dce8 transparent;
}

#saan-consent.sc--visible .sc-panel {
  transform: translateY(0);
}

/* Dark mode */
[data-theme="dark"] .sc-panel {
  background: #14202e;
  box-shadow:
    0 -4px 6px -1px rgba(0, 0, 0, 0.2),
    0 24px 60px -8px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* ── Header ──────────────────────────────────────────────── */
.sc-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.375rem 1.625rem 1rem;
  border-bottom: 1px solid rgba(27, 79, 138, 0.1);
}

[data-theme="dark"] .sc-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sc-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1B4F8A 0%, #2a6db5 100%);
  color: #ffffff;
  flex-shrink: 0;
}

.sc-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f1f33;
  margin: 0 0 0.1rem;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .sc-title {
  color: #f0f5ff;
}

.sc-subtitle {
  font-size: 0.75rem;
  color: #6b7c93;
  margin: 0;
  font-weight: 500;
}

[data-theme="dark"] .sc-subtitle {
  color: #8da0b8;
}

/* ── Body ────────────────────────────────────────────────── */
.sc-body {
  padding: 1.125rem 1.625rem;
}

.sc-intro {
  font-size: 0.825rem;
  line-height: 1.6;
  color: #4a5568;
  margin: 0 0 1.125rem;
}

[data-theme="dark"] .sc-intro {
  color: #94a9bf;
}

.sc-intro strong {
  color: #1B4F8A;
  font-weight: 700;
}

[data-theme="dark"] .sc-intro strong {
  color: #5b9bd5;
}

/* ── Kategorien ──────────────────────────────────────────── */
.sc-categories {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.sc-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.125rem;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1px solid rgba(27, 79, 138, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sc-category:has(input:checked:not(:disabled)) {
  background: #eef3f9;
  border-color: rgba(27, 79, 138, 0.2);
}

[data-theme="dark"] .sc-category {
  background: #1a2a3d;
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sc-category:has(input:checked:not(:disabled)) {
  background: #1e3450;
  border-color: rgba(91, 155, 213, 0.25);
}

.sc-category--required {
  background: #f0f4f8;
  border-color: rgba(27, 79, 138, 0.12);
}

[data-theme="dark"] .sc-category--required {
  background: #192536;
}

.sc-category__info {
  flex: 1;
  min-width: 0;
}

.sc-category__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.sc-category__name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1a2a3d;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .sc-category__name {
  color: #e0ebf8;
}

.sc-category__desc {
  font-size: 0.775rem;
  line-height: 1.55;
  color: #5a6b80;
  margin: 0 0 0.5rem;
}

[data-theme="dark"] .sc-category__desc {
  color: #7a93aa;
}

/* ── Badge ───────────────────────────────────────────────── */
.sc-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sc-badge--required {
  background: rgba(27, 79, 138, 0.1);
  color: #1B4F8A;
}

[data-theme="dark"] .sc-badge--required {
  background: rgba(91, 155, 213, 0.15);
  color: #5b9bd5;
}

/* ── Details / Tabelle ───────────────────────────────────── */
.sc-details {
  margin-top: 0.4rem;
}

.sc-details summary {
  font-size: 0.74rem;
  font-weight: 600;
  color: #1B4F8A;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.sc-details summary::-webkit-details-marker { display: none; }

.sc-details summary::after {
  content: '›';
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 1rem;
  line-height: 1;
}

.sc-details[open] summary::after {
  transform: rotate(90deg);
}

[data-theme="dark"] .sc-details summary {
  color: #5b9bd5;
}

.sc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.72rem;
}

.sc-table th,
.sc-table td {
  text-align: left;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(27, 79, 138, 0.08);
  color: #4a5568;
  line-height: 1.4;
}

[data-theme="dark"] .sc-table th,
[data-theme="dark"] .sc-table td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  color: #7a93aa;
}

.sc-table th {
  font-weight: 700;
  color: #2d3748;
  background: rgba(27, 79, 138, 0.04);
}

[data-theme="dark"] .sc-table th {
  color: #b0c4d8;
  background: rgba(255, 255, 255, 0.03);
}

/* ── Toggle ──────────────────────────────────────────────── */
.sc-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.sc-toggle__track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e0;
  position: relative;
  transition: background 0.25s ease;
  border: 1px solid rgba(0,0,0,0.08);
}

[data-theme="dark"] .sc-toggle__track {
  background: #2d4055;
  border-color: rgba(255,255,255,0.08);
}

.sc-toggle input:checked ~ .sc-toggle__track {
  background: #1B4F8A;
  border-color: transparent;
}

.sc-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sc-toggle input:checked ~ .sc-toggle__track .sc-toggle__thumb {
  transform: translateX(20px);
}

.sc-toggle--disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

/* ── Footer ──────────────────────────────────────────────── */
.sc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.625rem 1.375rem;
  border-top: 1px solid rgba(27, 79, 138, 0.1);
  flex-wrap: wrap;
}

[data-theme="dark"] .sc-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.sc-footer__links {
  display: flex;
  gap: 1rem;
}

.sc-footer__links a {
  font-size: 0.75rem;
  color: #6b7c93;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.sc-footer__links a:hover {
  color: #1B4F8A;
}

[data-theme="dark"] .sc-footer__links a {
  color: #7a93aa;
}

[data-theme="dark"] .sc-footer__links a:hover {
  color: #5b9bd5;
}

.sc-footer__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────── */
.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.525rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

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

.sc-btn--ghost {
  background: transparent;
  color: #6b7c93;
  border: 1px solid rgba(27, 79, 138, 0.15);
}

.sc-btn--ghost:hover {
  background: rgba(27, 79, 138, 0.06);
  color: #1B4F8A;
  border-color: rgba(27, 79, 138, 0.25);
}

[data-theme="dark"] .sc-btn--ghost {
  color: #7a93aa;
  border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .sc-btn--ghost:hover {
  background: rgba(91, 155, 213, 0.1);
  color: #5b9bd5;
}

.sc-btn--outline {
  background: transparent;
  color: #1B4F8A;
  border: 1.5px solid #1B4F8A;
}

.sc-btn--outline:hover {
  background: rgba(27, 79, 138, 0.07);
}

[data-theme="dark"] .sc-btn--outline {
  color: #5b9bd5;
  border-color: #5b9bd5;
}

[data-theme="dark"] .sc-btn--outline:hover {
  background: rgba(91, 155, 213, 0.1);
}

.sc-btn--primary {
  background: #E87B2A;
  color: #ffffff;
  border: 1.5px solid transparent;
  box-shadow: 0 2px 8px rgba(232, 123, 42, 0.35);
}

.sc-btn--primary:hover {
  background: #d46d20;
  box-shadow: 0 4px 14px rgba(232, 123, 42, 0.45);
  transform: translateY(-1px);
}

.sc-btn--primary:active {
  transform: translateY(0);
}

/* ── Google Maps Platzhalter ─────────────────────────────── */
.maps-placeholder {
  position: absolute;
  inset: 0;
  background: #f4f7fb;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

[data-theme="dark"] .maps-placeholder {
  background: #1a2a3d;
}

.maps-placeholder__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
  color: #6b7c93;
}

[data-theme="dark"] .maps-placeholder__inner {
  color: #7a93aa;
}

.maps-placeholder__inner svg {
  color: #1B4F8A;
  opacity: 0.5;
}

.maps-placeholder__inner p {
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
  max-width: 260px;
}

.maps-placeholder__btn {
  padding: 0.5rem 1.25rem;
  background: #1B4F8A;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.maps-placeholder__btn:hover {
  background: #164278;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  #saan-consent {
    padding: 0.5rem 0.5rem 0;
    align-items: flex-end;
  }

  .sc-panel {
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
  }

  .sc-header {
    padding: 1.125rem 1.25rem 0.875rem;
  }

  .sc-body {
    padding: 0.875rem 1.25rem;
  }

  .sc-footer {
    padding: 0.875rem 1.25rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .sc-footer__actions {
    width: 100%;
    justify-content: stretch;
  }

  .sc-footer__actions .sc-btn {
    flex: 1;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    font-size: 0.78rem;
  }

  .sc-category {
    padding: 0.875rem 1rem;
  }
}

/* ── "Einstellungen" Link im Footer der Website ──────────── */
.cookie-settings-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #6b7c93;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(107, 124, 147, 0.4);
  transition: color 0.2s ease;
}

.cookie-settings-link:hover {
  color: #1B4F8A;
}

[data-theme="dark"] .cookie-settings-link {
  color: #7a93aa;
}

[data-theme="dark"] .cookie-settings-link:hover {
  color: #5b9bd5;
}
