/* ============================================================
   SHGT — Cookie Banner
   Depends on: styles.css (design tokens in :root)
   ============================================================ */

/* ── KEYFRAMES ────────────────────────────────────────────── */
@keyframes cookie-slide-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes cookie-slide-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(110%);
    opacity: 0;
  }
}

/* ── BANNER BASE ──────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;

  /* Glass-morphism dark */
  background: rgba(30, 10, 78, 0.94);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid rgba(168, 85, 247, 0.22);
  box-shadow: 0 -8px 40px rgba(30, 10, 78, 0.40);

  padding: 18px 24px;

  /* Entry animation */
  animation: cookie-slide-in 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── INNER LAYOUT ─────────────────────────────────────────── */
.cookie-inner {
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* ── TEXT ─────────────────────────────────────────────────── */
.cookie-text {
  flex: 1 1 260px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.cookie-text a {
  color: var(--magenta-glow, #C060F0);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.18s;
}

.cookie-text a:hover {
  color: var(--white, #ffffff);
}

/* ── ACTIONS ──────────────────────────────────────────────── */
.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

/* Accept — primary gradient pill */
.cookie-btn-accept {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--grad-primary, linear-gradient(135deg, #6D28D9, #A21CAF));
  color: #ffffff;
  border: none;
  border-radius: var(--r-btn, 999px);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.30);
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.cookie-btn-accept:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.42);
}

.cookie-btn-accept:active {
  transform: translateY(0);
  opacity: 1;
}

/* Decline — ghost outline violeta */
.cookie-btn-decline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  background: transparent;
  color: rgba(192, 132, 252, 0.90);
  border: 1.5px solid rgba(168, 85, 247, 0.45);
  border-radius: var(--r-btn, 999px);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cookie-btn-decline:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.70);
  color: #c084fc;
}

.cookie-btn-decline:active {
  background: rgba(168, 85, 247, 0.06);
}

/* ── EXIT STATE ───────────────────────────────────────────── */
/*
  JS usage:
    banner.classList.add('cookie-banner-hidden');
    banner.addEventListener('animationend', () => banner.style.display = 'none', { once: true });
*/
#cookie-banner.cookie-banner-hidden {
  animation: cookie-slide-out 0.38s cubic-bezier(0.55, 0, 0.75, 0) forwards;
  pointer-events: none;
}

/* ── COOKIE-TEXT sub-line ─────────────────────────────────── */
.cookie-text .cookie-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
}

/* ── FLOATING PREFERENCES BUTTON ──────────────────────────── */
/* Shown after consent so the user can revoke at any time (LGPD Art. 8 §5º) */
.cookie-preferences-btn {
  display: none; /* JS calls showPreferencesBtn() to reveal */
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 8998;
  background: rgba(26, 10, 62, 0.92);
  border: 1px solid rgba(124, 58, 237, 0.55);
  border-radius: 999px;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #A78BFA;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.cookie-preferences-btn:hover {
  background: rgba(92, 22, 201, 0.35);
  border-color: #7C3AED;
  color: #ffffff;
}

/* ── RESPONSIVE — mobile (<600px) ─────────────────────────── */
@media (max-width: 599px) {
  #cookie-banner {
    padding: 16px 16px 24px;
  }

  .cookie-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .cookie-text {
    font-size: 14px;
  }

  .cookie-actions {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .cookie-btn-accept,
  .cookie-btn-decline {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    justify-content: center;
  }
}
