/**
 * GetPipsy — EU-style cookie consent (premium dark glass; bar + modal above notice overlay).
 */

#pipsyCookieBar {
  --pipsy-cc-accent: #fbbf24;
  --pipsy-cc-accent-soft: rgba(251, 191, 36, 0.14);
  --pipsy-cc-font: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Above .pipsy-notice-overlay (99999) so preferences stay reachable */
  z-index: 100100;
  isolation: isolate;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  font-family: var(--pipsy-cc-font);
}

#pipsyCookieBar.is-hidden,
#pipsyCookieBar[hidden] {
  display: none !important;
}

#pipsyCookieBar .pipsy-cc-inner {
  pointer-events: auto;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 20px;
  border-radius: 20px 20px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  background: linear-gradient(165deg, rgba(17, 20, 34, 0.97), rgba(10, 12, 22, 0.96));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 -20px 56px rgba(0, 0, 0, 0.55),
    0 0 80px -20px rgba(109, 124, 255, 0.12);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

#pipsyCookieBar .pipsy-cc-accent-line {
  height: 3px;
  width: 48px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, var(--pipsy-cc-accent), rgba(253, 230, 138, 0.65));
  opacity: 0.9;
}

#pipsyCookieBar .pipsy-cc-title {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fafc;
  line-height: 1.25;
}

#pipsyCookieBar .pipsy-cc-text {
  margin: 0 0 16px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: rgba(148, 163, 184, 0.95);
  max-width: 72ch;
}

#pipsyCookieBar .pipsy-cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#pipsyCookieBar .pipsy-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

#pipsyCookieBar .pipsy-cc-btn:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.55);
  outline-offset: 2px;
}

#pipsyCookieBar .pipsy-cc-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

#pipsyCookieBar .pipsy-cc-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

#pipsyCookieBar .pipsy-cc-btn--muted {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

#pipsyCookieBar .pipsy-cc-btn--muted:hover {
  border-color: rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
}

#pipsyCookieBar .pipsy-cc-btn--primary {
  color: #422006;
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.22);
}

#pipsyCookieBar .pipsy-cc-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.3);
}

#pipsyCookieBar .pipsy-cc-links {
  margin-top: 12px;
  font-size: 0.75rem;
}

#pipsyCookieBar .pipsy-cc-links a {
  color: rgba(253, 224, 71, 0.88);
  text-decoration: none;
  border-bottom: 1px solid rgba(253, 224, 71, 0.25);
  margin-right: 14px;
}

#pipsyCookieBar .pipsy-cc-links a:hover {
  color: #fef9c3;
  border-bottom-color: rgba(253, 224, 71, 0.5);
}

/* Modal */
#pipsyCookieModal {
  --pipsy-cc-font: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  position: fixed;
  inset: 0;
  z-index: 100200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--pipsy-cc-font);
  isolation: isolate;
}

#pipsyCookieModal.is-open {
  display: flex;
}

#pipsyCookieModal .pipsy-cc-dialog {
  width: 100%;
  max-width: 520px;
  max-height: min(88vh, 640px);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(20, 24, 40, 0.98), rgba(12, 14, 26, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 64px rgba(0, 0, 0, 0.5);
  padding: 22px 22px 20px;
  color: #e2e8f0;
  word-break: normal;
  overflow-wrap: break-word;
}

#pipsyCookieModal .pipsy-cc-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#pipsyCookieModal .pipsy-cc-dialog-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

#pipsyCookieModal .pipsy-cc-dialog-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

#pipsyCookieModal .pipsy-cc-dialog-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

#pipsyCookieModal .pipsy-cc-dialog-intro {
  margin: 0 0 18px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(148, 163, 184, 0.95);
}

#pipsyCookieModal .pipsy-cc-cat {
  padding: 14px 14px 16px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#pipsyCookieModal .pipsy-cc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

#pipsyCookieModal .pipsy-cc-cat-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: -0.02em;
  min-width: 0;
}

/* „Mindig aktív” — ne a gombosztályokkal keveredjen (modál / modul CSS-ek ellen) */
#pipsyCookieModal .pipsy-cc-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: default;
  user-select: none;
}

#pipsyCookieModal .pipsy-cc-cat-desc {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: rgba(148, 163, 184, 0.9);
}

#pipsyCookieModal label.pipsy-cc-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

#pipsyCookieModal .pipsy-cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

#pipsyCookieModal .pipsy-cc-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(71, 85, 105, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

#pipsyCookieModal .pipsy-cc-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1f5f9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

#pipsyCookieModal .pipsy-cc-switch input:checked + .pipsy-cc-switch-track {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.45), rgba(245, 158, 11, 0.35));
  border-color: rgba(251, 191, 36, 0.35);
}

#pipsyCookieModal .pipsy-cc-switch input:checked + .pipsy-cc-switch-track .pipsy-cc-switch-thumb {
  transform: translateX(18px);
}

#pipsyCookieModal .pipsy-cc-switch input:disabled + .pipsy-cc-switch-track {
  opacity: 0.55;
  cursor: not-allowed;
}

#pipsyCookieModal .pipsy-cc-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#pipsyCookieModal .pipsy-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#pipsyCookieModal .pipsy-cc-btn--primary {
  color: #422006;
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
}

#pipsyCookieModal .pipsy-cc-btn--primary:hover {
  transform: translateY(-1px);
}

#pipsyCookieModal .pipsy-cc-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

html.pipsy-cc-bar-open {
  scroll-padding-bottom: 120px;
}

@media (max-width: 560px) {
  #pipsyCookieBar .pipsy-cc-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #pipsyCookieBar .pipsy-cc-btn {
    width: 100%;
    justify-content: center;
  }
}
