/* 
  Silktide Consent Manager - https://silktide.com/consent-manager/  

  Styles are at risked of being overridden by styles coming from the site the consent manager is used on.
  To help prevent this, global wrapper elements are prefixed with "#silktide-"
*/

/* --------------------------------
  Global Styles - These elements exist in the main DOM and styling is limited to positioning and animation
-------------------------------- */
/* Wrapper (Global) */
#silktide-wrapper {
  --focus: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--primary)), 0 0 0 6px hsl(var(--background));
  --boxShadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;

  --primaryColor: hsl(var(--primary));
  --backgroundColor: hsl(var(--card));
  --textColor: hsl(var(--card-foreground));
  --backdropBackgroundColor: hsl(var(--background) / 0.6);
  --backdropBackgroundBlur: 10px;
  --cookieIconColor: hsl(var(--card));
  --cookieIconBackgroundColor: hsl(var(--primary));
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  pointer-events: none;
  border: 0px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Backdrop (Global) */
#silktide-backdrop-global {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  border: 0px;
  display: none;
}

/* --------------------------------
  Links
-------------------------------- */
#silktide-wrapper a {
  all: unset;
  display: inline-block;
  color: var(--primaryColor);
  text-decoration: underline;
}

#silktide-wrapper a:hover {
  cursor: pointer;
  color: hsl(var(--primary) / 0.8);
}

/* --------------------------------
  Focus Styles
-------------------------------- */
#silktide-wrapper a:focus,
#silktide-wrapper #silktide-banner button:focus,
#silktide-wrapper #silktide-modal button:focus,
#silktide-wrapper #silktide-cookie-icon:focus {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 5px;
}

#silktide-wrapper #silktide-cookie-icon:focus {
  border-radius: 50%;
}

/* --------------------------------
  General Styles
-------------------------------- */

#silktide-wrapper .st-button {
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  border: 2px solid hsl(var(--primary));
  padding: 10px 20px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 600;
  box-shadow: 0 4px 15px hsl(var(--primary) / 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

#silktide-wrapper .st-button--primary {
}

#silktide-wrapper .st-button--primary:hover {
  background: hsl(var(--primary) / 0.9);
  box-shadow: 0 6px 20px hsl(var(--primary) / 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

#silktide-wrapper .st-button--secondary {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

#silktide-wrapper .st-button--secondary:hover {
  background: hsl(var(--muted) / 0.8);
  color: hsl(var(--foreground));
  border-color: var(--primaryColor);
}

/* Special styling for Reject Non-Essential button */
#silktide-wrapper .reject-all,
#silktide-wrapper .preferences-reject-all {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border: 2px solid hsl(var(--destructive));
  box-shadow: 0 4px 15px hsl(var(--destructive) / 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#silktide-wrapper .reject-all:hover,
#silktide-wrapper .preferences-reject-all:hover {
  background: hsl(var(--destructive) / 0.9);
  box-shadow: 0 6px 20px hsl(var(--destructive) / 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* --------------------------------
  Banner
-------------------------------- */
#silktide-banner {
  color: var(--textColor);
  background-color: var(--backgroundColor);
  box-sizing: border-box;
  padding: 32px;
  border-radius: var(--radius);
  pointer-events: auto;
  border: 1px solid hsl(var(--border));
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 720px;
  max-width: calc(100% - 32px);
  transform: translate(0, -20px);
  opacity: 0;
  animation: silktide-slideInDown 350ms ease-out forwards;
  animation-delay: 0.3s;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
              0 0 0 1px rgba(255, 255, 255, 0.05),
              0 0 20px hsl(var(--primary) / 0.1);
  /* backdrop-filter: blur(12px); */
  /* -webkit-backdrop-filter: blur(12px); */
}

#silktide-banner:focus {
  border-radius: 50%;
}

#silktide-banner.center {
  top: 50%;
  left: 50%;
  bottom: auto;
  right: auto;
  position: fixed;
  transform: translate(-50%, calc(-50% - 20px));
  animation: silktide-slideInDown-center 350ms ease-out forwards;
}

#silktide-banner.bottomLeft {
  bottom: 16px;
  left: 16px;
  position: fixed;
}

#silktide-banner.bottomCenter {
  bottom: 16px;
  left: 50%;
  position: fixed;
  transform: translate(-50%, -20px);
  animation: silktide-slideInDown-bottomCenter 350ms ease-out forwards;
}

#silktide-banner .preferences {
  display: flex;
  gap: 5px;
  border: none;
  padding: 0px;
  background-color: transparent;
  color: var(--primaryColor);
  cursor: pointer;
  font-size: 16px;
}

#silktide-banner .preferences span {
  display: block;
  white-space: nowrap;
  text-decoration: underline;
}

#silktide-banner .preferences span:hover {
  color: hsl(var(--primary) / 0.8);
}

#silktide-banner .preferences:after {
  display: block;
  content: '>';
  text-decoration: none;
}

/* Cookie Banner Header Styling */
#silktide-banner .cookie-banner-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

#silktide-banner .cookie-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: hsl(var(--primary) / 0.1);
  border: 2px solid hsl(var(--primary) / 0.2);
}

#silktide-banner .cookie-icon svg {
  fill: hsl(var(--primary));
  width: 28px;
  height: 28px;
}

#silktide-banner .cookie-content {
  flex: 1;
}

#silktide-banner .cookie-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--textColor);
  text-shadow: 0 0 10px hsl(var(--primary) / 0.3);
}

#silktide-banner .cookie-content p {
  font-size: 15px;
  line-height: 22px;
  margin: 0;
  color: hsl(var(--muted-foreground));
}

#silktide-banner p {
  font-size: 16px;
  line-height: 24px;
  margin: 0px 0px 15px;
  color: hsl(var(--muted-foreground));
}

#silktide-banner a {
  display: inline-block;
  color: var(--primaryColor);
  text-decoration: underline;
  background-color: var(--backgroundColor);
}

#silktide-banner a:hover {
  color: hsl(var(--primary) / 0.8);
}

#silktide-banner a.silktide-logo {
  display: block;
  fill: var(--primaryColor); /* passed down to svg > path */
  margin-left: auto;
  width: 24px;
  height: 24px;
}


#silktide-banner .actions {
  display: flex;
  gap: 16px;
  flex-direction: column;
  margin-top: 0;
}

@media (min-width: 720px) {
  #silktide-banner .actions {
    flex-direction: row;
    align-items: center;
  }
}

/* Mobile responsive styling for cookie banner header */
@media (max-width: 480px) {
  #silktide-banner .cookie-banner-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  
  #silktide-banner .cookie-icon {
    width: 40px;
    height: 40px;
  }
  
  #silktide-banner .cookie-icon svg {
    width: 24px;
    height: 24px;
  }
  
  #silktide-banner .cookie-content h3 {
    font-size: 16px;
  }
  
  #silktide-banner .cookie-content p {
    font-size: 14px;
    line-height: 20px;
  }
}

#silktide-banner .actions-row {
  display: flex;
  gap: 16px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
}

/* --------------------------------
  Modal
-------------------------------- */
#silktide-modal {
  display: none;
  pointer-events: auto;
  width: 800px;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid hsl(var(--border));
  transform: translate(0px, -20px);
  opacity: 0;
  animation: silktide-slideInUp-center 350ms ease-out forwards;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
              0 0 0 1px rgba(255, 255, 255, 0.05),
              0 0 20px hsl(var(--primary) / 0.1);
  /* backdrop-filter: blur(12px); */
  /* -webkit-backdrop-filter: blur(12px); */
  color: var(--textColor);
  flex-direction: column;
  padding: 30px;
  background-color: var(--backgroundColor);
  border-radius: var(--radius);
  box-sizing: border-box;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#silktide-modal.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Force hide modal when closed */
#silktide-modal.closed {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* Override any conflicting styles */
#silktide-modal[style*="display: flex"] {
  display: none !important;
}

#silktide-modal[style*="display: block"] {
  display: none !important;
}

/* Emergency override - hide modal completely */
#silktide-modal {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* Only show modal when explicitly opened */
#silktide-modal.show {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 1000 !important;
}

/* --------------------------------
  Modal - Header
-------------------------------- */
#silktide-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

#silktide-modal h1 {
  color: var(--textColor);
  font-size: 24px;
  font-weight: 600;
  margin: 0px;
  text-shadow: 0 0 10px hsl(var(--primary) / 0.3);
}

#silktide-modal .modal-close {
  display: inline-flex;
  border: none;
  padding: 10px;
  border: 0px;
  cursor: pointer;
  background: var(--backgroundColor);
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

#silktide-modal .modal-close:hover {
  background: hsl(var(--muted) / 0.5);
  color: var(--textColor);
}

#silktide-modal .modal-close svg {
  fill: currentColor;
}

/* --------------------------------
  Modal - Content
-------------------------------- */

#silktide-modal section {
  flex: 1;
  overflow-y: auto;
  margin-top: 32px;
  padding-right: 7px; /* Prevents scrollbar from appearing over the switches */
}

#silktide-modal section::-webkit-scrollbar {
  display: block; /* Force scrollbars to show */
  width: 5px; /* Width of the scrollbar */
}

#silktide-modal section::-webkit-scrollbar-thumb {
  background-color: var(--textColor); /* Color of the scrollbar thumb */
  border-radius: 10px; /* Rounded corners for the thumb */
}

#silktide-modal p {
  font-size: 16px;
  line-height: 24px;
  color: hsl(var(--muted-foreground));
  margin: 0px 0px 15px;
}

#silktide-modal p:last-of-type {
  margin: 0px;
}

#silktide-modal fieldset {
  padding: 16px;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted) / 0.3);
  margin: 0px 0px 32px;
}

#silktide-modal fieldset:last-of-type {
  margin: 0px;
}

#silktide-modal legend {
  padding: 0.25rem 0.75rem;
  margin: 0px 0px 10px;
  font-weight: 600;
  color: var(--textColor);
  font-size: 16px;
  background: var(--backgroundColor);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 4px);
}

#silktide-modal .cookie-type-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;  
}

#silktide-modal .cookie-type-description {
  color: hsl(var(--muted-foreground));
}

/* --------------------------------
  Modal - Switches
-------------------------------- */
#silktide-modal .switch {
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  height: 34px;
  width: 74px;
  cursor: pointer;
}

#silktide-modal .switch:focus-within {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 25px;
}

#silktide-modal .switch input {
  opacity: 0;
  position: absolute;
}

/* Unchecked Switch Styles */
#silktide-modal .switch__pill {
  position: relative;
  display: block;
  height: 34px;
  width: 74px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 25px;
  transition: all 0.3s ease;
}

#silktide-modal .switch__dot {
  position: absolute;
  top: 2px;
  left: 2px;
  display: block;
  height: 30px;
  width: 30px;
  background: hsl(var(--background));
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

#silktide-modal .switch__off,
#silktide-modal .switch__on {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  position: absolute;
  top: 7px;
  right: 8px;
  transition: right 150ms ease-out, opacity 150ms ease-out;
}

#silktide-modal .switch__off {
  opacity: 1;
}

#silktide-modal .switch__on {
  opacity: 0;
}

/* Checked Switch Styles */
#silktide-modal .switch input:checked + .switch__pill {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  box-shadow: 0 0 10px hsl(var(--primary) / 0.3);
}

#silktide-modal .switch input:checked ~ .switch__dot {
  left: calc(100% - 32px);
  background: hsl(var(--primary-foreground));
}

#silktide-modal .switch input:checked ~ .switch__off {
  right: calc(100% - 32px);
  opacity: 0;
}

#silktide-modal .switch input:checked ~ .switch__on {
  right: calc(100% - 34px);
  opacity: 1;
  color: hsl(var(--primary-foreground));
  font-weight: 600;
}

/* Disabled Switch Styles */
#silktide-modal .switch input:disabled + .switch__pill {
  opacity: 0.65;
  cursor: not-allowed;
}

/* --------------------------------
  Modal - Footer
-------------------------------- */
#silktide-modal footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

@media (min-width: 720px) {
  #silktide-modal footer {
    flex-direction: row;
    align-items: center;
  }
}

#silktide-modal footer a {
  margin-left: auto;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
}

#silktide-modal footer a:hover {
  color: var(--primaryColor);
}

/* Modal Silktide Logo - Match Banner Logo */
#silktide-modal a.silktide-logo {
  display: block;
  fill: var(--primaryColor); /* passed down to svg > path */
  margin-left: auto;
  width: 24px;
  height: 24px;
}

/* Modal Button Styles - Match Banner Button Styles */
#silktide-modal .st-button {
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  border: 2px solid hsl(var(--primary));
  padding: 10px 20px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 600;
  box-shadow: 0 4px 15px hsl(var(--primary) / 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

#silktide-modal .st-button--primary {
}

#silktide-modal .st-button--primary:hover {
  background: hsl(var(--primary) / 0.9);
  box-shadow: 0 6px 20px hsl(var(--primary) / 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

#silktide-modal .st-button--secondary {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

#silktide-modal .st-button--secondary:hover {
  background: hsl(var(--muted) / 0.8);
  color: hsl(var(--foreground));
  border-color: var(--primaryColor);
}

/* Special styling for Reject Non-Essential button in modal */
#silktide-modal .reject-all,
#silktide-modal .preferences-reject-all {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border: 2px solid hsl(var(--destructive));
  box-shadow: 0 4px 15px hsl(var(--destructive) / 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#silktide-modal .reject-all:hover,
#silktide-modal .preferences-reject-all:hover {
  background: hsl(var(--destructive) / 0.9);
  box-shadow: 0 6px 20px hsl(var(--destructive) / 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Cookie Icon */
#silktide-cookie-icon {
  display: none;
  position: fixed;
  bottom: 10px;
  left: 10px;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0px;
  border: 1px solid hsl(var(--border));
  background-color: var(--cookieIconColor);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 
              0 0 0 1px rgba(255, 255, 255, 0.05);
  pointer-events: auto;
  animation: silktide-fadeIn 0.3s ease-in-out forwards;
  transition: all 0.3s ease;
}

#silktide-cookie-icon:hover {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary));
  box-shadow: 0 6px 20px hsl(var(--primary) / 0.2);
  transform: scale(1.05);
}

#silktide-cookie-icon.bottomRight {
  left: auto;
  right: 10px;
}

#silktide-cookie-icon svg {
  fill: var(--cookieIconBackgroundColor);
}

/* --------------------------------
  Backdrop
-------------------------------- */
#silktide-backdrop {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--backdropBackgroundColor);
  backdrop-filter: blur(var(--backdropBackgroundBlur));
  pointer-events: all;
}

/* --------------------------------
  Animations
-------------------------------- */
@keyframes silktide-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes silktide-slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes silktide-slideInDown-center {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 20px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes silktide-slideInDown-bottomCenter {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes silktide-slideInUp-center {
  from {
    opacity: 0;
    transform: translate(0px, 20px);
  }
  to {
    opacity: 1;
    transform: translate(0px, 0px);
  }
}

/* Dark mode adjustments */
.dark #silktide-backdrop {
  background: hsl(var(--background) / 0.7);
}

.dark #silktide-modal .switch__dot {
  background: hsl(var(--card));
} 