/* 
  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 {
  /* Brand / tokens (safe overrides) */
  --focus: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 0 5px rgba(99, 128, 229, 0.55);
  --boxShadow: var(--shadow-lg, -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a);

  --fontFamily: var(--font-family-text, "Manrope", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif);

  --primaryColor: var(--color-accent, #6380E5);
  --backgroundColor: var(--color-surface, #FFFFFF);
  --textColor: var(--color-text, #0F172A);

  --backdropBackgroundColor: rgba(11, 20, 48, 0.55);
  --backdropBackgroundBlur: 8px;

  --cookieIconColor: var(--color-primary, #2E3C72);
  --cookieIconBackgroundColor: var(--color-white, #FFFFFF);

  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  pointer-events: none; /* KEEP: required */
  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;
  text-underline-offset: 0.25em;
}

#silktide-wrapper a:hover {
  cursor: pointer;
  color: var(--textColor);
}

/* --------------------------------
  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: var(--border-radius, 10px);
}

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

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

#silktide-wrapper .st-button {
  font-family: var(--fontFamily);
  font-weight: 700;
  letter-spacing: 0.01em;

  color: #ffffff;
  background-color: var(--primaryColor);
  border: 1px solid rgba(99, 128, 229, 0.45);

  padding: 12px 18px;
  text-decoration: none;
  text-align: center;
  display: inline-block;

  font-size: 15px;
  line-height: 22px;
  cursor: pointer;

  border-radius: var(--border-radius-full, 999px);

  transition: transform 120ms ease, background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}

#silktide-wrapper .st-button:hover {
  transform: translateY(-1px);
}

#silktide-wrapper .st-button--primary {
  background-color: #4F64BF;
  border-color: rgba(79, 100, 191, 0.45);
}

#silktide-wrapper .st-button--primary:hover {
  background-color: var(--color-primary-dark, #24305D);
  color: #ffffff;
  border-color: rgba(36, 48, 93, 0.6);
}

#silktide-wrapper .st-button--secondary {
  background-color: transparent;
  color: var(--primaryColor);
  border-color: rgba(99, 128, 229, 0.45);
}

#silktide-wrapper .st-button--secondary:hover {
  background-color: rgba(99, 128, 229, 0.12);
  color: var(--color-primary-dark, #24305D);
  border-color: rgba(99, 128, 229, 0.65);
}

/* --------------------------------
  Banner
-------------------------------- */
#silktide-banner {
  font-family: var(--fontFamily);
  color: var(--textColor);

  /* Visual reskin */
  background: var(--gradient-card, linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%));
  border: 1px solid var(--color-border, rgba(46, 60, 114, 0.22));
  box-shadow: var(--boxShadow);
  border-radius: var(--border-radius-large, 22px);

  box-sizing: border-box;
  padding: 28px;

  pointer-events: auto; /* KEEP: required */
  border: 0px;
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 600px;
  overflow: auto;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 32px);
  transform: translate(0, -20px);
  opacity: 0;
  animation: silktide-slideInDown 350ms ease-out forwards;
  animation-delay: 0.3s;
}

#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: 8px;
  border: none;
  padding: 12px 0px;
  background-color: transparent;
  color: var(--primaryColor);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

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

#silktide-banner .preferences span:hover {
  color: var(--color-primary-dark, #24305D);
}

#silktide-banner .preferences:after {
  display: block;
  content: '›';
  text-decoration: none;
  font-weight: 700;
}

#silktide-banner p {
  font-size: 15px;
  line-height: 24px;
  margin: 0px 0px 14px;
  color: var(--textColor);
}

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

#silktide-banner a:hover {
  color: var(--textColor);
}

#silktide-banner a.silktide-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  fill: var(--primaryColor); /* passed down to svg > path */
  margin-left: auto;
  width: 48px;
  height: 48px;
}

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

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

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

/* --------------------------------
  Modal
-------------------------------- */
#silktide-modal {
  display: none;
  pointer-events: auto; /* KEEP: required */
  overflow: auto;
  width: 800px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  border: 0px;
  transform: translate(0px, -20px);
  opacity: 0;
  animation: silktide-slideInUp-center 350ms ease-out forwards;

  /* Visual reskin */
  box-shadow: var(--boxShadow);
  font-family: var(--fontFamily);
  color: var(--textColor);
  flex-direction: column;
  padding: 28px;

  background: var(--gradient-card, linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%));
  border: 1px solid var(--color-border, rgba(46, 60, 114, 0.22));
  border-radius: var(--border-radius-large, 22px);
  box-sizing: border-box;
}

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

#silktide-modal h1 {
  font-family: var(--font-family-heading, "Scutosans", "Manrope", system-ui, sans-serif);
  color: var(--textColor);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0px;
}

#silktide-modal .modal-close {
  display: inline-flex;
  border: none;
  padding: 12px;
  cursor: pointer;
  background: transparent;
  color: var(--primaryColor);
  border-radius: var(--border-radius-full, 999px);
}

#silktide-modal .modal-close:hover {
  background: rgba(99, 128, 229, 0.12);
}

#silktide-modal .modal-close svg {
  fill: var(--primaryColor);
}

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

#silktide-modal section {
  flex: 1;
  margin-top: 32px;
}

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

#silktide-modal section::-webkit-scrollbar-thumb {
  background-color: rgba(46, 60, 114, 0.35); /* thumb */
  border-radius: 10px; /* Rounded corners for the thumb */
}

#silktide-modal p {
  font-size: 15px;
  line-height: 24px;
  color: var(--textColor);
  margin: 0px 0px 14px;
}

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

#silktide-modal fieldset {
  padding: 0px;
  border: none;
  margin: 0px 0px 32px;
}

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

#silktide-modal legend {
  padding: 0px;
  margin: 0px 0px 10px;
  font-weight: 700;
  color: var(--textColor);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

/* --------------------------------
  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: rgba(46, 60, 114, 0.25);
  border-radius: 25px;
}

#silktide-modal .switch__dot {
  position: absolute;
  top: 2px;
  left: 2px;
  display: block;
  height: 30px;
  width: 30px;
  background: #ffffff;
  border-radius: 50%;
  transition: left 150ms ease-out;
}

#silktide-modal .switch__off,
#silktide-modal .switch__on {
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  color: #0B1430;
  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: var(--primaryColor);
}

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

#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;
}

/* 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: 600px) {
  #silktide-modal footer {
    flex-direction: row;
    align-items: center;
  }
}

#silktide-modal footer a {
  margin-left: auto;
  padding: 14px 0px;
}

/* Cookie Icon */
#silktide-cookie-icon {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0px;

  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: var(--cookieIconColor);

  cursor: pointer;
  box-shadow: 0px 0px 6px 0px #0000001a;
  pointer-events: auto; /* KEEP: required */
  animation: silktide-fadeIn 0.3s ease-in-out forwards;
}

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

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

/* Dölj cookie-ikonen – hanteras istället via footerlänk */
#silktide-cookie-icon {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Modal – kompaktare på mobil */
@media (max-width: 600px) {
  #silktide-modal {
    padding: 18px 16px;
    max-width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    border-radius: 16px;
  }

  #silktide-modal header {
    margin-bottom: 12px;
  }

  #silktide-modal h1 {
    font-size: 18px;
  }

  #silktide-modal section {
    margin-top: 16px;
  }
}

/* --------------------------------
  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); }
}
