/*
 * PrivacyEngine Cookie Consent - Banner Styles v1.0.0
 * Minified: ~3KB
 * All positions, themes, animations, responsive.
 */

/* === CSS Variables (defaults, overridden by PHP) === */
:root {
  --pe-bg: #ffffff;
  --pe-text: #333333;
  --pe-primary: #1a73e8;
  --pe-btn-text: #ffffff;
  --pe-radius: 8px;
  --pe-border: #e2e8f0;
  --pe-shadow: 0 4px 24px rgba(0,0,0,0.12);
  --pe-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pe-z-index: 999999;
}

/* === Base Banner === */
.pe-consent-banner {
  position: fixed;
  z-index: var(--pe-z-index);
  font-family: var(--pe-font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--pe-text);
  background: var(--pe-bg);
  border: 1px solid var(--pe-border);
  border-radius: var(--pe-radius);
  box-shadow: var(--pe-shadow);
  box-sizing: border-box;
  max-width: 100%;
  pointer-events: auto;
  visibility: visible;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.pe-consent-banner.pe-visible {
  opacity: 1;
  transform: translateY(0);
}
.pe-consent-banner * {
  box-sizing: border-box;
}
.pe-consent-banner a {
  color: var(--pe-primary);
}
.pe-banner-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pe-banner-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.pe-banner-description {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
}
.pe-banner-privacy-link {
  font-size: 13px;
  text-decoration: underline;
}

/* === Buttons === */
.pe-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  border: 1px solid var(--pe-border);
  border-radius: var(--pe-radius);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  font-family: var(--pe-font-family);
  white-space: nowrap;
}
.pe-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.pe-btn:active {
  transform: translateY(0);
}
.pe-btn-accept-all {
  background: var(--pe-primary);
  color: var(--pe-btn-text);
  border-color: var(--pe-primary);
}
.pe-btn-reject-all {
  background: transparent;
  color: var(--pe-text);
}
.pe-btn-customize {
  background: transparent;
  color: var(--pe-primary);
  border-color: var(--pe-primary);
}
.pe-btn-save {
  background: var(--pe-primary);
  color: var(--pe-btn-text);
  border-color: var(--pe-primary);
}

/* === Customize Panel === */
.pe-customize-panel {
  border-top: 1px solid var(--pe-border);
  padding-top: 12px;
  margin-top: 4px;
}
.pe-customize-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
}
.pe-categories-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.pe-category-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 10px;
  border: 1px solid var(--pe-border);
  border-radius: var(--pe-radius);
  background: rgba(0,0,0,0.02);
  transition: background 0.2s;
}
.pe-category-toggle:hover {
  background: rgba(0,0,0,0.04);
}
.pe-category-toggle.pe-category-required {
  opacity: 0.7;
  cursor: default;
}
.pe-category-input {
  width: 16px;
  height: 16px;
  accent-color: var(--pe-primary);
}
.pe-category-label {
  font-weight: 500;
  font-size: 13px;
}
.pe-category-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--pe-border);
  color: var(--pe-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pe-category-desc {
  width: 100%;
  font-size: 12px;
  opacity: 0.7;
  margin-top: -2px;
}

/* === Powered By === */
.pe-powered {
  font-size: 11px;
  opacity: 0.6;
  text-align: center;
  margin-top: 4px;
}
.pe-powered a {
  color: var(--pe-primary);
  text-decoration: none;
  font-weight: 500;
}
.pe-powered a:hover {
  text-decoration: underline;
}

/* === Positions === */
/* Bottom */
.pe-consent-banner.pe-position-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: var(--pe-radius) var(--pe-radius) 0 0;
  border-bottom: none;
  transform: translateY(100%);
}
.pe-consent-banner.pe-position-bottom.pe-visible {
  transform: translateY(0);
}
/* Top */
.pe-consent-banner.pe-position-top {
  top: 0;
  left: 0;
  right: 0;
  border-radius: 0 0 var(--pe-radius) var(--pe-radius);
  border-top: none;
  transform: translateY(-100%);
}
.pe-consent-banner.pe-position-top.pe-visible {
  transform: translateY(0);
}
/* Floating */
.pe-consent-banner.pe-position-floating {
  bottom: 20px;
  right: 20px;
  max-width: 380px;
  border-radius: var(--pe-radius);
}
/* Toast */
.pe-consent-banner.pe-position-toast {
  bottom: 20px;
  right: 20px;
  max-width: 380px;
}
/* Modal */
.pe-consent-banner.pe-position-modal {
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) scale(0.95);
  max-width: 520px;
  width: 90%;
  z-index: calc(var(--pe-z-index) + 1);
}
.pe-consent-banner.pe-position-modal.pe-visible {
  transform: translate(-50%,-50%) scale(1);
}
/* Slideover */
.pe-consent-banner.pe-position-slideover {
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  border-radius: var(--pe-radius) 0 0 var(--pe-radius);
  border-right: none;
  transform: translateX(100%);
  overflow-y: auto;
}
.pe-consent-banner.pe-position-slideover.pe-visible {
  transform: translateX(0);
}
/* Modal backdrop */
.pe-consent-banner.pe-position-modal::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: -1;
}

/* === Premium Themes === */
.pe-theme-dark-tech {
  --pe-bg: #0a0b0d;
  --pe-border: #00ff88;
  --pe-text: #00ff88;
  --pe-primary: #00ff88;
  --pe-btn-text: #0a0b0d;
  --pe-radius: 4px;
  --pe-shadow: 0 0 20px rgba(0,255,136,0.3);
  --pe-font-family: 'Courier New', monospace;
}
.pe-theme-dark-tech .pe-banner-content {
  border: 1px solid var(--pe-border);
}
.pe-theme-glassmorphism {
  --pe-bg: rgba(255,255,255,0.12);
  --pe-border: rgba(255,255,255,0.3);
  --pe-text: #ffffff;
  --pe-primary: #a78bfa;
  --pe-btn-text: #ffffff;
  --pe-radius: 16px;
  --pe-shadow: 0 8px 32px rgba(0,0,0,0.3);
  --pe-font-family: 'Inter', system-ui, sans-serif;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pe-theme-corporate {
  --pe-bg: #ffffff;
  --pe-border: #e2e8f0;
  --pe-text: #1e293b;
  --pe-primary: #2563eb;
  --pe-btn-text: #ffffff;
  --pe-radius: 8px;
  --pe-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.pe-theme-brutalism {
  --pe-bg: #facc15;
  --pe-border: #000000;
  --pe-text: #000000;
  --pe-primary: #000000;
  --pe-btn-text: #ffffff;
  --pe-radius: 0px;
  --pe-shadow: 8px 8px 0 rgba(0,0,0,0.2);
  border: 3px solid #000;
}
.pe-theme-neumorphism {
  --pe-bg: #e0e5ec;
  --pe-border: #d1d5db;
  --pe-text: #6b7280;
  --pe-primary: #8b5cf6;
  --pe-btn-text: #ffffff;
  --pe-radius: 20px;
  --pe-shadow: 9px 9px 16px rgba(163,177,198,0.6), -9px -9px 16px rgba(255,255,255,0.5);
}

/* === FAB (Floating Action Button) === */
.pe-fab-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--pe-primary);
  border: none;
  cursor: pointer;
  z-index: var(--pe-z-index);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  margin: 0;
}
.pe-fab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.25);
}
.pe-fab-button:active {
  transform: scale(0.95);
}
.pe-fab-button svg {
  width: 22px;
  height: 22px;
  color: var(--pe-btn-text);
  display: block;
}
.pe-fab-button.pe-fab-visible {
  display: flex;
}
/* Floating banner: raised so it doesn't overlap with the FAB button */
.pe-consent-banner.pe-position-floating {
  bottom: 80px;
}

/* === Toast Compact Mode === */
.pe-consent-banner.pe-position-toast {
  max-width: 340px;
  border-radius: var(--pe-radius);
}
.pe-consent-banner.pe-position-toast .pe-banner-content {
  padding: 12px 16px;
  gap: 8px;
}
.pe-consent-banner.pe-position-toast .pe-banner-title {
  font-size: 12px;
  margin: 0;
  line-height: 1.4;
}
.pe-consent-banner.pe-position-toast .pe-banner-description {
  font-size: 12px;
  margin: 0;
  line-height: 1.4;
}
.pe-consent-banner.pe-position-toast .pe-banner-privacy-link {
  display: none;
}
.pe-consent-banner.pe-position-toast .pe-banner-actions {
  flex-direction: row;
  gap: 6px;
}
.pe-consent-banner.pe-position-toast .pe-btn {
  padding: 7px 14px;
  font-size: 11px;
  flex: 1;
  white-space: nowrap;
}
.pe-consent-banner.pe-position-toast .pe-customize-panel {
  display: none !important;
}
.pe-consent-banner.pe-position-toast .pe-powered {
  display: none;
}

/* === Responsive === */
@media (max-width: 767px) {
  .pe-consent-banner.pe-position-floating,
  .pe-consent-banner.pe-position-toast {
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: var(--pe-radius) var(--pe-radius) 0 0;
  }
  /* Mobile FAB: smaller and moved so it doesn't overlap full-width banner */
  .pe-fab-button {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
  .pe-fab-button svg {
    width: 20px;
    height: 20px;
  }
  .pe-consent-banner.pe-position-floating {
    bottom: 0;
  }
  .pe-consent-banner.pe-position-toast .pe-banner-actions {
    flex-direction: column;
    gap: 6px;
  }
  .pe-consent-banner.pe-position-toast .pe-btn {
    width: 100%;
    text-align: center;
  }
  .pe-consent-banner.pe-position-slideover {
    width: 100%;
    border-radius: 0;
  }
  .pe-consent-banner.pe-position-modal {
    width: 95%;
  }
  .pe-banner-content {
    padding: 12px 16px;
  }
  .pe-banner-actions {
    flex-direction: column;
    width: 100%;
  }
  .pe-banner-actions .pe-btn {
    width: 100%;
    text-align: center;
  }
}
@media (min-width: 768px) {
  .pe-consent-banner.pe-position-bottom .pe-banner-content,
  .pe-consent-banner.pe-position-top .pe-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .pe-consent-banner.pe-position-bottom .pe-banner-title,
  .pe-consent-banner.pe-position-top .pe-banner-title {
    width: 100%;
  }
  .pe-consent-banner.pe-position-bottom .pe-banner-description,
  .pe-consent-banner.pe-position-top .pe-banner-description {
    flex: 1;
    min-width: 200px;
  }
  .pe-consent-banner.pe-position-bottom .pe-banner-actions,
  .pe-consent-banner.pe-position-top .pe-banner-actions {
    flex-shrink: 0;
  }
}
