/* Cookie Consent Customization for LinkdAPI - Theme-Aware */

/* Light mode theme colors */
:root {
  --cc-bg: hsl(var(--background));
  --cc-text: hsl(var(--foreground));
  --cc-btn-primary-bg: hsl(var(--primary));
  --cc-btn-primary-text: hsl(var(--primary-foreground));
  --cc-btn-primary-hover-bg: hsl(222.2 47.4% 8%);
  --cc-btn-secondary-bg: hsl(var(--secondary));
  --cc-btn-secondary-text: hsl(var(--secondary-foreground));
  --cc-btn-secondary-hover-bg: hsl(210 40% 93%);
  --cc-separator-border-color: hsl(var(--border));
  --cc-cookie-category-block-bg: hsl(var(--muted));
  --cc-cookie-category-block-border: hsl(var(--border));
  --cc-toggle-bg-off: hsl(var(--muted));
  --cc-toggle-bg-on: hsl(var(--primary));
  --cc-toggle-knob-bg: hsl(var(--background));
  --cc-overlay-bg: rgba(0, 0, 0, 0.5);
  --cc-link: hsl(217.2 91.2% 59.8%);
  --cc-link-hover: hsl(217.2 91.2% 45%);
}

/* Dark mode theme colors */
.dark {
  --cc-bg: hsl(var(--background));
  --cc-text: hsl(var(--foreground));
  --cc-btn-primary-bg: hsl(var(--primary));
  --cc-btn-primary-text: hsl(var(--primary-foreground));
  --cc-btn-primary-hover-bg: hsl(210 40% 93%);
  --cc-btn-secondary-bg: hsl(var(--secondary));
  --cc-btn-secondary-text: hsl(var(--secondary-foreground));
  --cc-btn-secondary-hover-bg: hsl(217.2 32.6% 20%);
  --cc-separator-border-color: hsl(var(--border));
  --cc-cookie-category-block-bg: hsl(var(--muted));
  --cc-cookie-category-block-border: hsl(var(--border));
  --cc-toggle-bg-off: hsl(var(--muted));
  --cc-toggle-bg-on: hsl(var(--primary));
  --cc-toggle-knob-bg: hsl(var(--foreground));
  --cc-overlay-bg: rgba(0, 0, 0, 0.75);
  --cc-link: hsl(217.2 91.2% 69.8%);
  --cc-link-hover: hsl(217.2 91.2% 79.8%);
}

/* Cookie Banner Bar - Full Width at Bottom */
#cc-main #cm {
  background: var(--cc-bg) !important;
  color: var(--cc-text) !important;
  border: none !important;
  border-top: 1px solid var(--cc-separator-border-color) !important;
  border-radius: 0 !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0.75rem 2rem !important;
}

/* Preferences Modal styling */
#cc-main #s-inr {
  background: var(--cc-bg) !important;
  color: var(--cc-text) !important;
  border: 1px solid var(--cc-separator-border-color) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

/* Make the consent bar content smaller and more compact */
#cc-main .cm {
  font-size: 0.8rem !important;
  line-height: 1.3 !important;
}

#cc-main .cm__desc {
  margin: 0.25rem 0 !important;
  max-width: 800px !important;
}

/* Title styling */
#cc-main .cm__title,
#cc-main .pm__title {
  color: var(--cc-text) !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  margin-bottom: 0.25rem !important;
}

/* Description text */
#cc-main .cm__desc,
#cc-main .pm__section-desc-wrapper,
#cc-main .section__desc {
  color: var(--cc-text) !important;
  opacity: 0.9;
}

/* Primary button */
#cc-main .cm__btn,
#cc-main .pm__btn {
  background: var(--cc-btn-primary-bg) !important;
  color: var(--cc-btn-primary-text) !important;
  border-radius: 6px !important;
  border: none !important;
  padding: 0.4rem 1rem !important;
  font-weight: 500 !important;
  font-size: 0.8rem !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

#cc-main .cm__btn:hover,
#cc-main .pm__btn:hover {
  background: var(--cc-btn-primary-hover-bg) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

/* Secondary button */
#cc-main .cm__btn--secondary,
#cc-main .pm__btn--secondary {
  background: var(--cc-btn-secondary-bg) !important;
  color: var(--cc-btn-secondary-text) !important;
  border-radius: 6px !important;
  border: 1px solid var(--cc-separator-border-color) !important;
  padding: 0.4rem 1rem !important;
  font-size: 0.8rem !important;
  transition: all 0.2s ease !important;
}

#cc-main .cm__btn--secondary:hover,
#cc-main .pm__btn--secondary:hover {
  background: var(--cc-btn-secondary-hover-bg) !important;
  transform: translateY(-1px) !important;
}

/* Footer links */
#cc-main .cm__footer {
  margin-top: 0.5rem !important;
  font-size: 0.7rem !important;
}

#cc-main .cm__footer a,
#cc-main .pm__section a {
  color: var(--cc-link) !important;
  text-decoration: underline !important;
  transition: color 0.2s ease !important;
}

#cc-main .cm__footer a:hover,
#cc-main .pm__section a:hover {
  color: var(--cc-link-hover) !important;
}

/* Cookie category sections */
#cc-main .section__toggle-wrapper {
  background: var(--cc-cookie-category-block-bg) !important;
  border: 1px solid var(--cc-cookie-category-block-border) !important;
  border-radius: var(--radius) !important;
  margin: 0.75rem 0 !important;
  padding: 1rem !important;
}

/* Toggle switches */
#cc-main .section__toggle .toggle__icon {
  background: var(--cc-toggle-bg-off) !important;
  transition: all 0.3s ease !important;
  border: 1px solid var(--cc-separator-border-color) !important;
}

#cc-main .section__toggle input:checked + .toggle__icon {
  background: var(--cc-toggle-bg-on) !important;
  border-color: var(--cc-toggle-bg-on) !important;
}

#cc-main .section__toggle .toggle__icon-circle {
  background: var(--cc-toggle-knob-bg) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* Cookie table styling */
#cc-main .cookie-table {
  border-radius: var(--radius) !important;
  overflow: hidden !important;
}

#cc-main .cookie-table th {
  background: var(--cc-cookie-category-block-bg) !important;
  color: var(--cc-text) !important;
  border-bottom: 1px solid var(--cc-separator-border-color) !important;
}

#cc-main .cookie-table td {
  border-bottom: 1px solid var(--cc-separator-border-color) !important;
  color: var(--cc-text) !important;
}

/* Overlay */
#cc-main #cm-ov,
#cc-main #s-ov {
  background: var(--cc-overlay-bg) !important;
  backdrop-filter: blur(4px) !important;
}

/* Scrollbar for preferences modal */
#cc-main #s-inr::-webkit-scrollbar {
  width: 8px !important;
}

#cc-main #s-inr::-webkit-scrollbar-track {
  background: var(--cc-cookie-category-block-bg) !important;
}

#cc-main #s-inr::-webkit-scrollbar-thumb {
  background: var(--cc-toggle-bg-off) !important;
  border-radius: 4px !important;
}

#cc-main #s-inr::-webkit-scrollbar-thumb:hover {
  background: var(--cc-toggle-bg-on) !important;
}

/* Buttons container for better layout in bar mode */
#cc-main .cm__btns {
  display: flex !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  margin-top: 0.5rem !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  #cc-main #cm {
    padding: 0.6rem 1.25rem !important;
  }

  #cc-main .cm__title {
    font-size: 0.85rem !important;
  }

  #cc-main .cm__desc {
    font-size: 0.75rem !important;
  }

  #cc-main .cm__btn,
  #cc-main .cm__btn--secondary {
    padding: 0.35rem 0.85rem !important;
    font-size: 0.75rem !important;
  }

  #cc-main .cm__btns {
    gap: 0.4rem !important;
  }
}

@media (max-width: 480px) {
  #cc-main #cm {
    padding: 0.6rem 1rem !important;
  }

  #cc-main .cm__btns {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.35rem !important;
  }

  #cc-main .cm__btn,
  #cc-main .cm__btn--secondary {
    width: 100% !important;
    padding: 0.35rem 0.75rem !important;
  }
}

