/* Silktide Cookie Consent Banner Styles */
#silktide-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* Backdrop */
#silktide-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
}

/* Banner */
#silktide-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 16px 24px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

#silktide-banner p {
  margin: 0;
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  color: #555;
}

#silktide-banner p a {
  color: #3B3D74;
  text-decoration: underline;
}

#silktide-banner .actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#silktide-banner .actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Shared button styles */
.st-button {
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.st-button:hover {
  opacity: 0.85;
}

.st-button--primary {
  background: #3B3D74;
  color: #fff;
}

.st-button--secondary {
  background: #e8e8ed;
  color: #333;
}

#silktide-banner .preferences {
  background: none;
  border: none;
  color: #3B3D74;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  padding: 8px 4px;
}

#silktide-banner .silktide-logo {
  display: flex;
  align-items: center;
}

#silktide-banner .silktide-logo svg {
  width: 18px;
  height: 18px;
  fill: #999;
}

/* Cookie Icon */
#silktide-cookie-icon {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #3B3D74;
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  font-size: 20px;
  transition: transform 0.2s;
}

#silktide-cookie-icon:hover {
  transform: scale(1.1);
}

/* Modal */
#silktide-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

#silktide-modal > div,
#silktide-modal {
  /* The modal wraps content in a child div */
}

#silktide-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#silktide-modal header h1 {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

#silktide-modal .modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  fill: #666;
}

#silktide-modal .modal-close svg {
  width: 16px;
  height: 16px;
  fill: #666;
}

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

#silktide-modal > * {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  margin: auto;
}

#silktide-modal p {
  font-size: 13px;
  color: #555;
  margin: 0 0 16px;
}

/* Cookie preferences section */
#cookie-preferences {
  margin: 16px 0;
}

#cookie-preferences fieldset {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 10px;
}

#cookie-preferences legend {
  font-weight: 700;
  font-size: 14px;
  color: #333;
  padding: 0 6px;
}

#cookie-preferences .cookie-type-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

#cookie-preferences .cookie-type-description {
  font-size: 13px;
  color: #666;
  flex: 1;
}

#cookie-preferences .cookie-type-description p {
  margin: 0;
}

/* Toggle switch */
#cookie-preferences .switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  color: #888;
}

#cookie-preferences .switch input[type="checkbox"] {
  width: 40px;
  height: 22px;
  appearance: none;
  -webkit-appearance: none;
  background: #ccc;
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}

#cookie-preferences .switch input[type="checkbox"]:checked {
  background: #3B3D74;
}

#cookie-preferences .switch input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

#cookie-preferences .switch input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

#cookie-preferences .switch input[type="checkbox"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Modal actions */
#silktide-modal .actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

#silktide-modal .actions a {
  font-size: 12px;
  color: #999;
  text-decoration: none;
  margin-left: auto;
}

/* Mobile */
@media (max-width: 640px) {
  #silktide-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
  }

  #silktide-banner .actions {
    flex-direction: column;
    align-items: stretch;
  }

  #silktide-banner .actions-row {
    justify-content: space-between;
  }

  .st-button {
    width: 100%;
    text-align: center;
  }
}
