/* Backdrop */
.consent-banner-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.consent-banner-backdrop--visible {
  opacity: 1;
}

/* Base Styles */
.consent-banner {
  position: fixed;
  z-index: 10000;
  background: var(--cb-bg-color, #ffffff);
  color: var(--cb-text-color, #333333);
  border: 1px solid var(--cb-border-color, #e0e0e0);
  border-radius: var(--cb-border-radius, 8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: var(
    --cb-font-family,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif
  );
  font-size: 14px;
  line-height: 1.5;
  max-width: 500px;
  padding: 24px;
  transition: all 0.3s ease;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Responsive positioning */
.consent-banner {
  /* Mobile-first: bottom positioning for screens <= 575px */
  bottom: 20px;
  left: 20px;
  right: 20px;
}

@media (max-width: 575px) {
  .consent-banner {
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-height: calc(100vh - 20px);
  }
}

/* Desktop: center positioning for screens > 575px */
@media (min-width: 576px) {
  .consent-banner {
    top: 10%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -10%);
    width: 40%;
    max-width: 525px;
    min-width: 525px;
    max-height: calc(100vh - 80px);
  }
}

/* Single theme - light theme as default */
.consent-banner {
  --cb-bg-color: #ffffff;
  --cb-text-color: #696969;
  --cb-border-color: #e0e0e0;
  --cb-primary-color: #0593ff;
  --cb-secondary-color: #718096;
}

/* Header */
.consent-banner__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.consent-banner__main .consent-banner__header {
  justify-content: flex-end;
}

.consent-banner__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--cb-text-color);
}



.consent-banner__close-without-accepting {
  transform: none;
  line-height: 1.5;
  text-decoration: underline;
  font-size: 0.75em;
  color: var(--cb-text-color);
  background: none;
  border: none;
  cursor: pointer;
}

/* Content */
.consent-banner__description {
  margin: 0 0 20px 0;
  color: var(--cb-text-color);
  line-height: 1.5;
  font-size: .813em;
}

.consent-banner__categories-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cb-text-color);
  margin: 16px 0 16px 0;
}

.consent-banner__category {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--cb-border-color);
  border-radius: var(--cb-border-radius, 6px);
  background: var(--cb-bg-color);
  transition: border-color 0.2s ease;
}

.consent-banner__category:hover {
  border-color: var(--cb-primary-color);
}

.consent-banner__category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.consent-banner__category-title {
  font-weight: 600;
  color: var(--cb-text-color);
  margin: 0;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
  padding: 4px;
}

.consent-banner__category-title::before {
  content: "▼";
  font-size: 10px;
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.consent-banner__category--collapsed .consent-banner__category-title::before {
  transform: rotate(-90deg);
}

.consent-banner__category-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.consent-banner__always-active {
  font-size: 12px;
  color: var(--cb-secondary-color);
  font-weight: 500;
}

.consent-banner__toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.consent-banner__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-banner__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--cb-secondary-color);
  transition: 0.3s;
  border-radius: 24px;
}

.consent-banner__slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.consent-banner__toggle input:checked + .consent-banner__slider {
  background-color: var(--cb-primary-color);
}

.consent-banner__toggle input:checked + .consent-banner__slider:before {
  transform: translateX(20px);
}

.consent-banner__toggle input:disabled + .consent-banner__slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.consent-banner__category-description {
  font-size: 13px;
  color: var(--cb-text-color);
  opacity: 0.8;
  margin: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease;
  max-height: 100px;
  margin-top: 8px;
}

.consent-banner__category--collapsed .consent-banner__category-description {
  max-height: 0;
  margin-top: 0;
}

/* Buttons */
.consent-banner__buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.consent-banner__button {
  border: none;
  min-width: 135px;
  padding: 12px 10px;
  letter-spacing: .05em;
  line-height: 1.4;
  font-size: .813em;
  font-weight: 600;
  height: auto;
  white-space: normal;
  word-break: break-word;
  word-wrap: break-word;
  cursor: pointer;
}

.consent-banner__button--primary {
  background-color: var(--cb-primary-color);
  color: white;
}

.consent-banner__button--primary:hover {
  opacity: 0.9;
}

.consent-banner__button--secondary {
  background-color: transparent;
  color: var(--cb-secondary-color);
}

.consent-banner__button--secondary:hover {
  opacity: 0.9;
}

/* Animations */
@keyframes slideInFromBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Scrollbar styling for better UX */
.consent-banner::-webkit-scrollbar {
  width: 6px;
}

.consent-banner::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.consent-banner::-webkit-scrollbar-thumb {
  background: var(--cb-secondary-color);
  border-radius: 3px;
}

.consent-banner::-webkit-scrollbar-thumb:hover {
  background: var(--cb-primary-color);
}

/* Smooth scrolling and improved scroll behavior */
.consent-banner {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* Ensure content doesn't get cut off on very small screens */
@media (max-height: 500px) {
  .consent-banner {
    max-height: calc(100vh - 20px);
    top: 10px;
    bottom: auto;
  }
  
  @media (min-width: 576px) {
    .consent-banner {
      transform: translateX(-50%);
      top: 10px;
      left: 50%;
    }
  }
}

/* Mobile animation: slide from bottom */
.consent-banner {
  animation: slideInFromBottom 0.3s ease;
}

/* Desktop animation: fade in from center */
@media (min-width: 576px) {
  .consent-banner {
    animation: fadeIn 0.3s ease;
  }
}

/* Responsive design */
@media (max-width: 575px) {
  .consent-banner__buttons {
    flex-direction: column;
  }

  .consent-banner__button {
    flex: none;
    width: 100%;
  }

  .consent-banner {
    padding: 16px;
  }

  .consent-banner__title {
    font-size: 16px;
  }
}

/* Accessibility */
.consent-banner__button:focus,
.consent-banner__toggle input:focus + .consent-banner__slider {
  outline: 2px solid var(--cb-primary-color);
  outline-offset: 2px;
}

