/**
 * Vue Privacy - Vanilla Banner Styles
 * @structured-world/vue-privacy
 *
 * Light/dark theme support via CSS variables and data attributes.
 * Mobile-first responsive design. WCAG 2.1 AA accessible.
 *
 * Customization via CSS variables:
 *   --consent-bg, --consent-text, --consent-text-secondary,
 *   --consent-link, --consent-btn-accept-bg, --consent-btn-accept-text,
 *   --consent-btn-reject-bg, --consent-btn-reject-text, --consent-font
 */

/* Light theme (default) */
:root,
[data-consent-theme="light"] {
  --consent-bg: #ffffff;
  --consent-text: #1a1a1a;
  --consent-text-secondary: #666666;
  --consent-link: #0066cc;
  --consent-btn-accept-bg: #0066cc;
  --consent-btn-accept-text: #ffffff;
  --consent-btn-reject-bg: #e0e0e0;
  --consent-btn-reject-text: #1a1a1a;
  --consent-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Dark theme */
[data-consent-theme="dark"] {
  --consent-bg: #1a1a1a;
  --consent-text: #ffffff;
  --consent-text-secondary: #a0a0a0;
  --consent-link: #66b3ff;
  --consent-btn-accept-bg: #0066cc;
  --consent-btn-accept-text: #ffffff;
  --consent-btn-reject-bg: #333333;
  --consent-btn-reject-text: #ffffff;
}

/* Auto theme: follow system preference */
@media (prefers-color-scheme: dark) {
  [data-consent-theme="auto"] {
    --consent-bg: #1a1a1a;
    --consent-text: #ffffff;
    --consent-text-secondary: #a0a0a0;
    --consent-link: #66b3ff;
    --consent-btn-accept-bg: #0066cc;
    --consent-btn-accept-text: #ffffff;
    --consent-btn-reject-bg: #333333;
    --consent-btn-reject-text: #ffffff;
  }
}

/* Banner base */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 1rem;
  background: var(--consent-bg, #ffffff);
  color: var(--consent-text, #1a1a1a);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  font-family: var(--consent-font, system-ui, -apple-system, sans-serif);
  box-sizing: border-box;
}

.consent-banner *,
.consent-banner *::before,
.consent-banner *::after {
  box-sizing: border-box;
}

/* Position variants */
.consent-banner--bottom {
  bottom: 0;
}

.consent-banner--top {
  top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.consent-banner--center {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Content wrapper */
.consent-banner__content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Title */
.consent-banner__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--consent-text, #1a1a1a);
}

/* Message */
.consent-banner__message {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--consent-text-secondary, #666666);
}

/* Privacy link */
.consent-banner__privacy-link {
  color: var(--consent-link, #0066cc);
  text-decoration: underline;
}

.consent-banner__privacy-link:hover {
  text-decoration: none;
}

/* Actions container */
.consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  max-width: 1200px;
  margin: 0 auto;
}

/* Button base */
.consent-banner__btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background-color 0.2s,
    opacity 0.2s;
  font-family: inherit;
}

.consent-banner__btn:hover {
  opacity: 0.9;
}

.consent-banner__btn:focus-visible {
  outline: 2px solid var(--consent-link, #0066cc);
  outline-offset: 2px;
}

/* Accept button */
.consent-banner__btn--accept {
  background: var(--consent-btn-accept-bg, #0066cc);
  color: var(--consent-btn-accept-text, #ffffff);
}

/* Reject button */
.consent-banner__btn--reject {
  background: var(--consent-btn-reject-bg, #e0e0e0);
  color: var(--consent-btn-reject-text, #1a1a1a);
}

/* Customize button */
.consent-banner__btn--customize {
  background: transparent;
  color: var(--consent-link, #0066cc);
  border: 1px solid currentColor;
}

/* Visibility states */
.consent-banner--hidden {
  display: none;
}

/* Animations - CSS hooks for custom animation implementations.
   These classes are provided for users who want to add enter/exit animations
   via JavaScript by toggling these classes. Not used by default banner.ts. */
.consent-banner--animating {
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.consent-banner--bottom.consent-banner--entering {
  transform: translateY(100%);
  opacity: 0;
}

.consent-banner--top.consent-banner--entering {
  transform: translateY(-100%);
  opacity: 0;
}

.consent-banner--center.consent-banner--entering {
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .consent-banner {
    padding: 1rem;
  }

  .consent-banner__actions {
    flex-direction: column;
  }

  .consent-banner__btn {
    width: 100%;
    text-align: center;
  }
}
