/* SmrtAi Cookie Banner — dark, minimal, on-brand */

/* ---------- WRAPPER ---------- */
#silktide-wrapper {
  --focus: 0 0 0 2px #0F172A, 0 0 0 4px #2D7CF7, 0 0 0 6px #0F172A;
  --boxShadow: 0 20px 50px -12px rgba(0,0,0,0.45);
  --fontFamily: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* SmrtAi palette */
  --bg: #0B1120;
  --surface: #121A2C;
  --surfaceHi: #1A2236;
  --hairline: rgba(255,255,255,0.08);
  --hairlineStrong: rgba(255,255,255,0.14);
  --text: #F8FAFC;
  --textMuted: #94A3B8;
  --textDim: #64748B;
  --brand: #2D7CF7;
  --brandHi: #5B9BFF;
  --brandDeep: #1E5EC9;
  --accent: #E82828;

  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  pointer-events: none;
  border: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---------- BACKDROP ---------- */
#silktide-backdrop-global {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: auto;
  border: 0;
  display: none;
  background: rgba(2,6,16,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- LINKS ---------- */
#silktide-wrapper a {
  all: unset;
  display: inline;
  color: var(--brandHi);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 12px;
}
#silktide-wrapper a:hover {
  color: var(--text);
}

/* ---------- FOCUS ---------- */
#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: 6px;
}
#silktide-wrapper #silktide-cookie-icon:focus {
  border-radius: 50%;
}

/* ---------- BUTTONS ---------- */
#silktide-wrapper .st-button {
  appearance: none;
  border: none;
  font-family: var(--fontFamily);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .12s ease, opacity .15s ease, box-shadow .15s ease;
}
#silktide-wrapper .st-button:hover {
  transform: translateY(-1px);
}
#silktide-wrapper .st-button:active {
  transform: translateY(0);
}

#silktide-wrapper .st-button--primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brandDeep) 100%);
  color: #fff;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.18) inset, 0 6px 18px -6px rgba(45,124,247,0.45);
}
#silktide-wrapper .st-button--primary:hover {
  filter: brightness(1.08);
}

#silktide-wrapper .st-button--secondary {
  background: var(--surfaceHi);
  color: var(--text);
  border: 1px solid var(--hairlineStrong);
}
#silktide-wrapper .st-button--secondary:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.22);
}

/* ---------- BANNER ---------- */
#silktide-banner {
  font-family: var(--fontFamily);
  color: var(--textMuted);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--boxShadow);
  box-sizing: border-box;
  padding: 18px 20px;
  border-radius: 14px;
  pointer-events: auto;
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 380px;
  max-width: calc(100% - 36px);
  transform: translateY(12px);
  opacity: 0;
  animation: silktide-slideInDown 320ms ease-out forwards;
  animation-delay: 0.25s;
}

#silktide-banner p {
  font-size: 12.5px;
  line-height: 1.55;
  margin: 0 0 14px;
  color: var(--textMuted);
}

#silktide-banner .actions {
  display: flex;
  gap: 10px;
  flex-direction: column;
  margin-top: 0;
}
@media (min-width: 420px) {
  #silktide-banner .actions {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
}

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

#silktide-banner .preferences {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: none;
  padding: 0;
  background: transparent;
  color: var(--textDim);
  cursor: pointer;
  font-family: var(--fontFamily);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#silktide-banner .preferences:hover {
  color: var(--text);
}
#silktide-banner .preferences::after {
  content: '›';
  text-decoration: none;
  margin-left: 2px;
}

#silktide-banner a.silktide-logo,
#silktide-modal footer a[href*="silktide.com"] {
  display: none !important;
}

/* ---------- MODAL ---------- */
#silktide-modal {
  display: none;
  pointer-events: auto;
  width: 680px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  border: 0;
  transform: translateY(14px);
  opacity: 0;
  animation: silktide-slideInUp-center 320ms ease-out forwards;
  box-shadow: var(--boxShadow);
  font-family: var(--fontFamily);
  color: var(--textMuted);
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-sizing: border-box;
}

/* Modal header */
#silktide-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 14px;
}
#silktide-modal h1 {
  font-family: var(--fontFamily);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
#silktide-modal .modal-close {
  display: inline-flex;
  border: none;
  padding: 8px;
  cursor: pointer;
  background: transparent;
  color: var(--textDim);
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
#silktide-modal .modal-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
#silktide-modal .modal-close svg {
  fill: currentColor;
  width: 16px;
  height: 16px;
}

/* Modal content */
#silktide-modal section {
  flex: 1;
  overflow-y: auto;
  margin-top: 4px;
  padding-right: 6px;
}
#silktide-modal section::-webkit-scrollbar {
  display: block;
  width: 4px;
}
#silktide-modal section::-webkit-scrollbar-thumb {
  background-color: var(--hairlineStrong);
  border-radius: 10px;
}
#silktide-modal p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--textMuted);
  margin: 0 0 12px;
}
#silktide-modal p:last-of-type {
  margin: 0 0 16px;
}
#silktide-modal fieldset {
  padding: 0;
  border: none;
  margin: 0 0 22px;
}
#silktide-modal fieldset:last-of-type {
  margin: 0;
}
#silktide-modal legend {
  padding: 0;
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 12.5px;
}
#silktide-modal .cookie-type-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}
#silktide-modal .cookie-type-description {
  font-size: 12px;
  line-height: 1.5;
  color: var(--textDim);
}

/* ---------- SWITCHES ---------- */
#silktide-modal .switch {
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  height: 26px;
  width: 48px;
  cursor: pointer;
}
#silktide-modal .switch:focus-within {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 20px;
}
#silktide-modal .switch input {
  opacity: 0;
  position: absolute;
}

#silktide-modal .switch__pill {
  position: relative;
  display: block;
  height: 26px;
  width: 48px;
  background: var(--surfaceHi);
  border: 1px solid var(--hairlineStrong);
  border-radius: 20px;
  transition: background .2s ease, border-color .2s ease;
}
#silktide-modal .switch__dot {
  position: absolute;
  top: 3px;
  left: 3px;
  display: block;
  height: 20px;
  width: 20px;
  background: var(--text);
  border-radius: 50%;
  transition: left .2s ease, background .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
#silktide-modal .switch__off,
#silktide-modal .switch__on {
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--textMuted);
  position: absolute;
  top: 6px;
  right: 6px;
  transition: opacity .2s ease;
}
#silktide-modal .switch__off { opacity: 1; }
#silktide-modal .switch__on { opacity: 0; }

/* checked */
#silktide-modal .switch input:checked + .switch__pill {
  background: var(--brand);
  border-color: var(--brand);
}
#silktide-modal .switch input:checked ~ .switch__dot {
  left: calc(100% - 23px);
  background: #fff;
}
#silktide-modal .switch input:checked ~ .switch__off { opacity: 0; }
#silktide-modal .switch input:checked ~ .switch__on { opacity: 1; right: auto; left: 6px; }

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

/* ---------- MODAL FOOTER ---------- */
#silktide-modal footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
@media (min-width: 520px) {
  #silktide-modal footer {
    flex-direction: row;
    align-items: center;
  }
}
#silktide-modal footer a {
  font-size: 11px;
  color: var(--textDim);
  text-decoration: none;
  margin-left: auto;
}
#silktide-modal footer a:hover {
  color: var(--textMuted);
  text-decoration: underline;
}

/* ---------- COOKIE ICON ---------- */
#silktide-cookie-icon {
  display: none;
  position: fixed;
  bottom: 14px;
  left: 14px;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid var(--hairlineStrong);
  background: var(--surface);
  color: var(--textMuted);
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.5);
  pointer-events: auto;
  animation: silktide-fadeIn 0.25s ease-out forwards;
  transition: transform .15s ease, background .15s ease;
}
#silktide-cookie-icon:hover {
  transform: scale(1.06);
  background: var(--surfaceHi);
}
#silktide-cookie-icon svg {
  fill: currentColor;
  width: 22px;
  height: 22px;
}

/* Minimal mode after choice */
#silktide-cookie-icon.silktide-minimal {
  width: 32px;
  height: 32px;
  bottom: 10px;
  left: 10px;
  opacity: 0.55;
  transition: opacity .2s ease, transform .15s ease;
}
#silktide-cookie-icon.silktide-minimal:hover {
  opacity: 1;
  transform: scale(1.1);
}
#silktide-cookie-icon.silktide-minimal svg {
  width: 14px;
  height: 14px;
}

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

/* ---------- ANIMATIONS ---------- */
@keyframes silktide-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes silktide-slideInDown {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes silktide-slideInUp-center {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
