/* aacc-modal.css — Settings modal, DARK theme */

#aacc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

#aacc-modal.aacc-modal--visible {
  opacity: 1;
  pointer-events: auto;
}

#aacc-modal .aacc-modal__dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(1120px, calc(100vw - 32px));
  min-height: min(620px, calc(100vh - 48px));
  max-height: min(94vh, 920px);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.34);
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  line-height: 1.5;
  pointer-events: auto;
}

#aacc-modal .aacc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  flex-shrink: 0;
}

#aacc-modal .aacc-modal__header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #111827;
  flex: 1 1 auto;
  min-width: 0;
}

#aacc-modal .aacc-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #374151;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

#aacc-modal .aacc-modal__close:hover {
  background: #e5e7eb;
  color: #111827;
}

#aacc-modal .aacc-modal__body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 28px 18px;
  -webkit-overflow-scrolling: touch;
}

#aacc-modal #aacc-modal-intro {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.65;
  color: #4b5563;
}

#aacc-modal .aacc-modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 18px 28px 22px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  flex-shrink: 0;
}

#aacc-modal .aacc-modal__footer .aacc-btn {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

/* Category cards */
#aacc-modal .aacc-category {
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

#aacc-modal .aacc-category:last-child { margin-bottom: 0; }

#aacc-modal .aacc-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#aacc-modal .aacc-category__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

#aacc-modal .aacc-category__state {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  white-space: nowrap;
}

#aacc-modal .aacc-category__description {
  font-size: 13px;
  line-height: 1.6;
  color: #4b5563;
}

#aacc-modal .aacc-category__switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

#aacc-modal .aacc-category > label.aacc-switch + .aacc-category__description {
  margin-top: 10px;
}

/* CCPA row */
#aacc-modal .aacc-ccpa-modal-row {
  flex: 1 1 100%;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 12px;
}

#aacc-modal .aacc-ccpa-link {
  font-size: 12px;
  color: #7dd3fc;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

#aacc-modal .aacc-ccpa-done { font-size: 12px; color: #4b5563; }

@media (min-width: 860px) {
  #aacc-modal {
    padding: 24px;
  }

  #aacc-modal .aacc-modal__body {
    padding: 24px 32px 22px;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 640px) {
  #aacc-modal .aacc-modal__dialog {
    max-width: calc(100vw - 20px);
    min-height: min(76vh, 720px);
  }
}

/* ─── Per-category accordion (cookies & services inside the settings modal) ───
   Mirrors the look used in #aacc-details so the same data is presented
   consistently regardless of which dialog the user opens.
   The selectors are scoped to #aacc-modal so they cannot leak into the
   details view or any other UI. */
#aacc-modal .aacc-category__details-toggle {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#aacc-modal .aacc-category__details-toggle:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}

#aacc-modal .aacc-category__details-toggle[aria-expanded="true"] {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

#aacc-modal .aacc-category__details-arrow {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  transition: transform 0.2s ease;
}

#aacc-modal .aacc-category__details-toggle[aria-expanded="true"] .aacc-category__details-arrow {
  transform: rotate(180deg);
}

#aacc-modal .aacc-category__details-panel {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
}

#aacc-modal .aacc-category__details-panel[hidden] {
  display: none !important;
}

#aacc-modal .aacc-category__details-empty {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

/* Service rows inside the modal accordion (visual parity with #aacc-details) */
#aacc-modal .aacc-svc-service {
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
}

#aacc-modal .aacc-svc-service:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#aacc-modal .aacc-svc-service__header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#aacc-modal .aacc-svc-service__name {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

#aacc-modal .aacc-svc-always-on {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}

#aacc-modal .aacc-svc-toggle {
  flex: 0 0 auto;
}

#aacc-modal .aacc-service-toggle {
  accent-color: #00b894;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

#aacc-modal .aacc-svc-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#aacc-modal .aacc-svc-info-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}

#aacc-modal .aacc-svc-info-btn[aria-expanded="true"] {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

#aacc-modal .aacc-svc-arrow {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  transition: transform 0.2s ease;
}

#aacc-modal .aacc-svc-info-btn[aria-expanded="true"] .aacc-svc-arrow {
  transform: rotate(180deg);
}

#aacc-modal .aacc-svc-service__body {
  margin-top: 12px;
  padding: 12px 14px 14px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.55;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

#aacc-modal .aacc-svc-service__body.aacc-svc-body--closed {
  display: none;
}

#aacc-modal .aacc-svc-desc {
  margin: 0 0 10px;
  line-height: 1.6;
  color: #4b5563;
}

#aacc-modal .aacc-svc-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 12px 0 8px;
  padding: 0;
}

#aacc-modal .aacc-svc-cookie {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

#aacc-modal .aacc-svc-cookie__name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  color: #111827;
  word-break: break-word;
}

#aacc-modal .aacc-svc-cookie__desc {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #4b5563;
}

#aacc-modal .aacc-svc-cookie__meta {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
  table-layout: fixed;
}

#aacc-modal .aacc-svc-cookie__meta th {
  text-align: left;
  padding: 5px 12px 5px 0;
  color: #6b7280;
  font-weight: 600;
  vertical-align: top;
  width: 34%;
  word-break: normal;
}

#aacc-modal .aacc-svc-cookie__meta td {
  padding: 5px 0;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #111827;
}

#aacc-modal .aacc-svc-provider {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #d1d5db;
}

#aacc-modal .aacc-svc-provider__table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
  table-layout: fixed;
}

#aacc-modal .aacc-svc-provider__table th {
  text-align: left;
  padding: 5px 12px 5px 0;
  color: #6b7280;
  font-weight: 600;
  vertical-align: top;
  width: 34%;
  word-break: normal;
}

#aacc-modal .aacc-svc-provider__table td {
  padding: 5px 0;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #111827;
}

#aacc-modal .aacc-svc-provider__table a {
  color: #059669;
  text-decoration: underline;
}

#aacc-modal .aacc-svc-provider__table a:hover {
  color: #047857;
}

#aacc-modal .aacc-svc-transfer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #d1d5db;
}

#aacc-modal .aacc-svc-transfer p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #4b5563;
}

/* Persistent legal-links bar — sits between body and footer so Impressum and
   Datenschutzerklärung are visible the whole time the settings modal is open. */
#aacc-modal .aacc-modal__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  padding: 12px 28px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
  flex-shrink: 0;
}

#aacc-modal .aacc-modal__legal-link {
  color: #1f2937;
  text-decoration: underline;
  font-weight: 500;
}

#aacc-modal .aacc-modal__legal-link:hover,
#aacc-modal .aacc-modal__legal-link:focus {
  color: #111827;
  text-decoration-thickness: 2px;
}

#aacc-modal .aacc-modal__legal-sep {
  color: #6b7280;
}

/* Per-cookie accordion inside the service body. Each cookie has its own
   expand button (`aacc-svc-cookie__toggle`) that reveals a metadata table
   below — same pattern as the service-level "Show cookie information"
   button, just one level deeper.

   The selectors target both `#aacc-modal` and `#aacc-details` so the modal
   and the detail-overlay share the exact same visual treatment. */

#aacc-modal .aacc-svc-cookielist,
#aacc-details .aacc-svc-cookielist {
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#aacc-modal .aacc-svc-cookie,
#aacc-details .aacc-svc-cookie {
  margin: 0;
  padding: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

#aacc-modal .aacc-svc-cookie__toggle,
#aacc-details .aacc-svc-cookie__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#aacc-modal .aacc-svc-cookie__toggle:hover,
#aacc-details .aacc-svc-cookie__toggle:hover {
  background: #f9fafb;
}

#aacc-modal .aacc-svc-cookie__toggle[aria-expanded="true"],
#aacc-details .aacc-svc-cookie__toggle[aria-expanded="true"] {
  background: #ecfdf5;
  color: #065f46;
}

#aacc-modal .aacc-svc-cookie__toggle-name,
#aacc-details .aacc-svc-cookie__toggle-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
  word-break: break-word;
}

#aacc-modal .aacc-svc-cookie__toggle-action,
#aacc-details .aacc-svc-cookie__toggle-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}

#aacc-modal .aacc-svc-cookie__toggle[aria-expanded="true"] .aacc-svc-cookie__toggle-action,
#aacc-details .aacc-svc-cookie__toggle[aria-expanded="true"] .aacc-svc-cookie__toggle-action {
  color: #047857;
}

#aacc-modal .aacc-svc-cookie__toggle-arrow,
#aacc-details .aacc-svc-cookie__toggle-arrow {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  transition: transform 0.2s ease;
}

#aacc-modal .aacc-svc-cookie__toggle[aria-expanded="true"] .aacc-svc-cookie__toggle-arrow,
#aacc-details .aacc-svc-cookie__toggle[aria-expanded="true"] .aacc-svc-cookie__toggle-arrow {
  transform: rotate(180deg);
}

#aacc-modal .aacc-svc-cookie__body,
#aacc-details .aacc-svc-cookie__body {
  padding: 10px 14px 12px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

#aacc-modal .aacc-svc-cookie__body[hidden],
#aacc-details .aacc-svc-cookie__body[hidden] {
  display: none !important;
}

/* Cookie metadata table inside the per-cookie accordion body. The base
   `.aacc-svc-cookie__meta` rules in aacc-details.css already cover the
   table itself; here we just ensure the table sits cleanly in the body. */
#aacc-modal .aacc-svc-cookie__body .aacc-svc-cookie__meta,
#aacc-details .aacc-svc-cookie__body .aacc-svc-cookie__meta {
  width: 100%;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
