/* Silktide Cookie Banner Styles */

#silktide-wrapper {
  --silktide-primary-color: #ff5e3b;
  --silktide-primary-hover: #e64d2a;
  --silktide-text-color: #1a1a1a;
  --silktide-bg-color: #ffffff;
  --silktide-border-radius: 8px;
  --silktide-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

/* Banner */
#silktide-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--silktide-bg-color);
  padding: 1.5rem 2rem;
  box-shadow: var(--silktide-shadow);
  z-index: 999999;
  border-top: 2px solid var(--silktide-primary-color);
}

#silktide-banner.top {
  bottom: auto;
  top: 0;
  border-top: none;
  border-bottom: 2px solid var(--silktide-primary-color);
}

#silktide-banner p {
  margin: 0 0 1rem 0;
  color: var(--silktide-text-color);
  font-size: 0.95rem;
  line-height: 1.5;
}

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

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

#silktide-banner .st-button {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--silktide-border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#silktide-banner .st-button--primary {
  background: var(--silktide-primary-color);
  color: white;
}

#silktide-banner .st-button--primary:hover {
  background: var(--silktide-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 94, 59, 0.3);
}

#silktide-banner .preferences {
  background: transparent;
  border: 1px solid #ddd;
  padding: 0.5rem 1rem;
  border-radius: var(--silktide-border-radius);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--silktide-text-color);
  transition: all 0.2s ease;
}

#silktide-banner .preferences:hover {
  border-color: var(--silktide-primary-color);
  color: var(--silktide-primary-color);
}

#silktide-banner .silktide-logo {
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

#silktide-banner .silktide-logo:hover {
  opacity: 0.8;
}

#silktide-banner .silktide-logo svg {
  fill: var(--silktide-text-color);
}

/* Modal */
#silktide-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--silktide-bg-color);
  border-radius: var(--silktide-border-radius);
  box-shadow: var(--silktide-shadow);
  z-index: 999999;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  flex-direction: column;
}

#silktide-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e5e5;
}

#silktide-modal h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--silktide-text-color);
}

#silktide-modal .modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 4px;
}

#silktide-modal .modal-close:hover {
  background: #f5f5f5;
}

#silktide-modal .modal-close svg {
  width: 20px;
  height: 20px;
  fill: var(--silktide-text-color);
}

#silktide-modal > p {
  padding: 1.5rem 2rem 0;
  margin: 0;
  color: var(--silktide-text-color);
  font-size: 0.95rem;
  line-height: 1.5;
}

#silktide-modal #cookie-preferences {
  padding: 1.5rem 2rem;
}

#silktide-modal fieldset {
  border: 1px solid #e5e5e5;
  border-radius: var(--silktide-border-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

#silktide-modal fieldset:last-child {
  margin-bottom: 0;
}

#silktide-modal legend {
  font-weight: 600;
  font-size: 1rem;
  color: var(--silktide-text-color);
  padding: 0 0.5rem;
}

#silktide-modal .cookie-type-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

#silktide-modal .cookie-type-description {
  flex: 1;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__pill {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 34px;
}

.switch__pill:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .switch__pill {
  background-color: var(--silktide-primary-color);
}

.switch input:checked + .switch__pill:before {
  transform: translateX(32px);
}

.switch input:disabled + .switch__pill {
  cursor: not-allowed;
  opacity: 0.6;
}

.switch__dot {
  display: none;
}

.switch__on,
.switch__off {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  pointer-events: none;
}

.switch__off {
  left: 8px;
  color: white;
}

.switch__on {
  right: 8px;
  color: white;
  opacity: 0;
}

.switch input:checked ~ .switch__off {
  opacity: 0;
}

.switch input:checked ~ .switch__on {
  opacity: 1;
}

#silktide-modal footer {
  display: flex;
  gap: 0.75rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid #e5e5e5;
  flex-wrap: wrap;
  align-items: center;
}

#silktide-modal footer .st-button {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--silktide-border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#silktide-modal footer .st-button--primary {
  background: var(--silktide-primary-color);
  color: white;
}

#silktide-modal footer .st-button--primary:hover {
  background: var(--silktide-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 94, 59, 0.3);
}

#silktide-modal footer a {
  color: #666;
  font-size: 0.85rem;
  text-decoration: none;
  margin-left: auto;
}

#silktide-modal footer a:hover {
  color: var(--silktide-primary-color);
  text-decoration: underline;
}

/* Cookie Icon */
#silktide-cookie-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--silktide-primary-color);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--silktide-shadow);
  z-index: 999999;
  transition: all 0.3s ease;
}

#silktide-cookie-icon:hover {
  background: var(--silktide-primary-hover);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#silktide-cookie-icon svg {
  fill: white;
}

#silktide-cookie-icon.bottom-left {
  right: auto;
  left: 20px;
}

#silktide-cookie-icon.top-right {
  bottom: auto;
  top: 20px;
}

#silktide-cookie-icon.top-left {
  bottom: auto;
  top: 20px;
  right: auto;
  left: 20px;
}

/* Color Schemes */
#silktide-cookie-icon.dark {
  background: #1a1a1a;
}

#silktide-cookie-icon.dark:hover {
  background: #333;
}

#silktide-cookie-icon.light {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

#silktide-cookie-icon.light svg {
  fill: var(--silktide-primary-color);
}

#silktide-cookie-icon.light:hover {
  background: #f5f5f5;
}

/* Responsive */
@media (max-width: 640px) {
  #silktide-banner {
    padding: 1rem 1.25rem;
  }

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

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

  #silktide-banner .st-button,
  #silktide-banner .preferences {
    width: 100%;
    text-align: center;
  }

  #silktide-modal {
    width: 95%;
    max-height: 95vh;
  }

  #silktide-modal header {
    padding: 1.25rem;
  }

  #silktide-modal h1 {
    font-size: 1.25rem;
  }

  #silktide-modal > p,
  #silktide-modal #cookie-preferences,
  #silktide-modal footer {
    padding: 1.25rem;
  }

  #silktide-modal .cookie-type-content {
    flex-direction: column;
    align-items: flex-start;
  }

  #silktide-modal footer {
    flex-direction: column;
  }

  #silktide-modal footer a {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  #silktide-cookie-icon {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
  }

  #silktide-cookie-icon.bottom-left {
    left: 16px;
  }

  #silktide-cookie-icon.top-right {
    top: 16px;
  }

  #silktide-cookie-icon.top-left {
    top: 16px;
    left: 16px;
  }
}
