/* Silktide overrides — Coozein (black & white, nudge accept) */

#stcm-wrapper {
  --primaryColor: #111827;
  --backgroundColor: #ffffff;
  --textColor: #111827;
  --iconColor: #111827;
  --iconBackgroundColor: #ffffff;
  --backdropBackgroundColor: rgba(15, 23, 42, 0.45);
  --backdropBackgroundBlur: 0px;
  --boxShadow: 0 8px 32px rgba(15, 23, 42, 0.12);
}

#stcm-wrapper #stcm-banner,
#stcm-wrapper #stcm-modal {
  background-color: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: var(--boxShadow) !important;
  border-radius: 16px !important;
}

#stcm-wrapper #stcm-banner {
  padding: 20px 24px !important;
  max-width: 720px !important;
}

@media (min-width: 600px) {
  #stcm-wrapper #stcm-modal {
    max-width: 880px !important;
  }
}

#stcm-wrapper #stcm-banner p {
  margin: 0 0 12px !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  color: #374151 !important;
}

#stcm-wrapper #stcm-banner .stcm-actions {
  margin-top: 12px !important;
  gap: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

/* Default / mobile DOM order: Accept → Reject → Settings */
#stcm-wrapper #stcm-banner .stcm-accept-all {
  order: 1 !important;
}

#stcm-wrapper #stcm-banner .stcm-reject-all {
  order: 2 !important;
}

#stcm-wrapper #stcm-banner .stcm-actions-row {
  order: 3 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  margin-top: 2px !important;
}

/*
  Desktop one line (right-hand bias):
  [Ρυθμίσεις] ........ [Απόρριψη] [Αποδοχή]  ← Accept rightmost, natural widths
*/
@media (min-width: 600px) {
  #stcm-wrapper #stcm-banner .stcm-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }

  #stcm-wrapper #stcm-banner .stcm-actions-row {
    order: 1 !important;
    flex: 1 1 auto !important;
    margin-top: 0 !important;
    min-width: 0 !important;
  }

  #stcm-wrapper #stcm-banner .stcm-reject-all {
    order: 2 !important;
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  #stcm-wrapper #stcm-banner .stcm-accept-all {
    order: 3 !important;
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
}

#stcm-wrapper #stcm-modal p,
#stcm-wrapper #stcm-modal legend,
#stcm-wrapper #stcm-modal h1 {
  color: #111827 !important;
}

#stcm-wrapper a,
#stcm-wrapper #stcm-banner a,
#stcm-wrapper #stcm-modal a {
  color: #111827 !important;
  background-color: transparent !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

#stcm-wrapper a:hover {
  color: #111827 !important;
  opacity: 0.7;
}

/* Preferences = quiet text link, last row */
#stcm-wrapper #stcm-banner .stcm-preferences-button,
#stcm-wrapper #stcm-banner .stcm-preferences-button span {
  color: #6b7280 !important;
  background-color: transparent !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
  padding: 6px 0 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: none !important;
  box-shadow: none !important;
}

#stcm-wrapper #stcm-banner .stcm-preferences-button:hover,
#stcm-wrapper #stcm-banner .stcm-preferences-button span:hover {
  color: #111827 !important;
  opacity: 1;
}

/* Base button reset — then specialize accept vs reject */
#stcm-wrapper .stcm-button {
  border-radius: 10px !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

/* Accept — brand orange CTA */
#stcm-wrapper #stcm-banner button.stcm-accept-all,
#stcm-wrapper #stcm-banner button.stcm-accept-all.stcm-button,
#stcm-wrapper #stcm-banner button.stcm-accept-all.stcm-button-primary,
#stcm-wrapper #stcm-modal button.stcm-modal-save,
#stcm-wrapper #stcm-modal button.stcm-modal-save.stcm-button,
#stcm-wrapper #stcm-modal button.stcm-modal-save.stcm-button-primary {
  color: #ffffff !important;
  background-color: #f15a29 !important;
  border: 2px solid #f15a29 !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  border-radius: 10px !important;
}

#stcm-wrapper #stcm-banner button.stcm-accept-all:hover,
#stcm-wrapper #stcm-modal button.stcm-modal-save:hover {
  color: #ffffff !important;
  background-color: #d94a1f !important;
  border-color: #d94a1f !important;
}

#stcm-wrapper #stcm-banner button.stcm-reject-all,
#stcm-wrapper #stcm-banner button.stcm-reject-all.stcm-button,
#stcm-wrapper #stcm-banner button.stcm-reject-all.stcm-button-primary,
#stcm-wrapper #stcm-modal button.stcm-modal-reject-all,
#stcm-wrapper #stcm-modal button.stcm-modal-reject-all.stcm-button,
#stcm-wrapper #stcm-modal button.stcm-modal-reject-all.stcm-button-primary {
  color: #6b7280 !important;
  background-color: #ffffff !important;
  border: 2px solid #e5e7eb !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  border-radius: 10px !important;
  opacity: 1 !important;
}

#stcm-wrapper #stcm-banner button.stcm-reject-all:hover,
#stcm-wrapper #stcm-modal button.stcm-modal-reject-all:hover {
  color: #374151 !important;
  background-color: #f9fafb !important;
  border-color: #d1d5db !important;
}

/* Modal footer: Reject left, Save/Accept right (like banner) */
#stcm-wrapper #stcm-modal footer {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

#stcm-wrapper #stcm-modal footer button.stcm-modal-reject-all {
  order: 1 !important;
  margin-right: auto !important;
  width: auto !important;
  flex: 0 1 auto !important;
}

#stcm-wrapper #stcm-modal footer button.stcm-modal-save {
  order: 2 !important;
  width: auto !important;
  flex: 0 1 auto !important;
}

#stcm-wrapper #stcm-modal footer a.stcm-credit-link {
  order: 3 !important;
  display: none !important;
}

/* Hide Silktide floating icon — footer button opens preferences instead */

#stcm-wrapper #stcm-icon {
  display: none !important;
}

/* Hide Silktide branding link */

#stcm-modal footer a.stcm-credit-link,
#stcm-modal footer a[href*='silktide'] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

#stcm-wrapper #stcm-modal .stcm-modal-close {
  background: #ffffff !important;
  color: #111827 !important;
}

#stcm-wrapper #stcm-modal .stcm-modal-close svg {
  fill: #111827 !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle-track {
  background: #d1d5db !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle-thumb {
  background: #ffffff !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle-off,
#stcm-wrapper #stcm-modal .stcm-toggle-on {
  color: #111827 !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle input:checked + .stcm-toggle-track {
  background: #111827 !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-thumb {
  background: #ffffff !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-on {
  color: #ffffff !important;
}

#stcm-wrapper #stcm-modal section::-webkit-scrollbar-thumb {
  background-color: #111827 !important;
}

#stcm-wrapper #stcm-banner a.stcm-logo svg,
#stcm-wrapper #stcm-banner a.stcm-logo {
  fill: #111827 !important;
}

#stcm-wrapper #stcm-banner a.stcm-logo {
  display: none !important;
}

/* Mobile: keep banner/modal within viewport */
@media (max-width: 599px) {
  #stcm-wrapper #stcm-banner {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: calc(
      100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    ) !important;
    left: 50% !important;
    right: auto !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    padding: 16px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
  }

  #stcm-wrapper #stcm-banner.stcm-pos-bottom-center {
    transform: translate(-50%, 0) !important;
  }

  #stcm-wrapper #stcm-banner.stcm-loaded.stcm-pos-bottom-center {
    transform: translate(-50%, 0) !important;
  }

  #stcm-wrapper #stcm-banner p {
    font-size: 13px !important;
    line-height: 1.4 !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #stcm-wrapper #stcm-banner .stcm-actions {
    margin-top: 10px !important;
    gap: 8px !important;
  }

  #stcm-wrapper #stcm-banner .stcm-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #stcm-wrapper #stcm-banner .stcm-accept-all {
    order: 1 !important;
  }

  #stcm-wrapper #stcm-banner .stcm-reject-all {
    order: 2 !important;
  }

  #stcm-wrapper #stcm-banner .stcm-actions-row {
    order: 3 !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    width: 100% !important;
    margin-right: 0 !important;
  }

  #stcm-wrapper #stcm-banner button.stcm-accept-all,
  #stcm-wrapper #stcm-banner button.stcm-reject-all {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    text-align: center !important;
  }

  #stcm-wrapper #stcm-banner button.stcm-accept-all {
    padding: 14px 16px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
  }

  #stcm-wrapper #stcm-banner button.stcm-reject-all {
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
  }

  #stcm-wrapper #stcm-banner .stcm-preferences-button {
    width: auto !important;
    justify-content: flex-start !important;
    padding: 6px 0 !important;
    font-size: 12px !important;
  }

  #stcm-wrapper #stcm-banner .stcm-preferences-button span {
    white-space: normal !important;
    text-align: center !important;
  }

  #stcm-wrapper #stcm-modal {
    width: 90vw !important;
    max-width: 90vw !important;
    max-height: calc(
      100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    ) !important;
    margin: 8px !important;
    padding: 16px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
  }

  #stcm-wrapper #stcm-modal header {
    margin-bottom: 12px !important;
    gap: 8px !important;
  }

  #stcm-wrapper #stcm-modal h1 {
    font-size: 18px !important;
    line-height: 1.3 !important;
  }

  #stcm-wrapper #stcm-modal section {
    margin-top: 16px !important;
  }

  #stcm-wrapper #stcm-modal .stcm-consent-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #stcm-wrapper #stcm-modal .stcm-toggle {
    align-self: flex-end;
  }

  #stcm-wrapper #stcm-modal footer {
    margin-top: 16px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }

  #stcm-wrapper #stcm-modal footer button.stcm-modal-save {
    order: 1 !important;
    width: 100% !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  #stcm-wrapper #stcm-modal footer button.stcm-modal-reject-all {
    order: 2 !important;
    width: 100% !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
}
