/**
 * Cookie/Consent Banner Toggle Switches
 * Loaded globally to ensure proper styling without being overridden
 */

/* Ensure custom element wrapper doesn't block clicks */
neoshare-cookie-banner {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

/* Banner itself has pointer-events when visible */
neoshare-cookie-banner .cookie-banner {
  pointer-events: auto;
}

/* Hide banner by default if consent already exists (prevents flash on page load) */
html.has-consent neoshare-cookie-banner,
html.has-consent neoshare-cookie-banner .cookie-banner {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Toggle Switch Base Styles */
neoshare-cookie-banner button.toggle-switch,
neoshare-cookie-banner .toggle-switch {
  position: relative !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  background: rgba(120, 120, 128, 0.16) !important;
  border-radius: 14px !important;
  cursor: pointer !important;
  transition: background 0.3s ease !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  display: inline-block !important;
  vertical-align: middle !important;
  pointer-events: auto !important;
  z-index: 999999 !important;
  touch-action: manipulation !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

[data-theme="dark"] neoshare-cookie-banner button.toggle-switch,
[data-theme="dark"] neoshare-cookie-banner .toggle-switch {
  background: rgba(120, 120, 128, 0.32) !important;
}

neoshare-cookie-banner button.toggle-switch.active,
neoshare-cookie-banner .toggle-switch.active {
  background: #e66300 !important;
}

[data-theme="dark"] neoshare-cookie-banner button.toggle-switch.active,
[data-theme="dark"] neoshare-cookie-banner .toggle-switch.active {
  background: #e66300 !important;
}

neoshare-cookie-banner button.toggle-switch.disabled,
neoshare-cookie-banner .toggle-switch.disabled {
  pointer-events: none !important;
  opacity: 0.4 !important;
}

neoshare-cookie-banner button.toggle-switch::before,
neoshare-cookie-banner .toggle-switch::before {
  content: "" !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 24px !important;
  height: 24px !important;
  background: white !important;
  border-radius: 50% !important;
  transition: transform 0.3s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  pointer-events: none !important;
}

neoshare-cookie-banner button.toggle-switch.active::before,
neoshare-cookie-banner .toggle-switch.active::before {
  transform: translateX(20px) !important;
}

/* Preference Row Layout - ensure toggle doesn't stretch */
neoshare-cookie-banner .preference-row {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 1rem !important;
}

neoshare-cookie-banner .preference-info {
  flex: 1 !important;
  min-width: 0 !important;
}
