/*
  PAMACS — „Kérdezd a cicát”: a jobb alsó sarokban ülő cica és a súgó-chat ablaka (2026-10-07).
  A cica rétegekből áll (Design/cica_web/keszit.py készíti): farok (a tövénél forog), ülő test, integető test +
  felemelt mancs (a könyökénél forog), csukott szemek (pislogás). A mozgást a cica.js vezérli.
  A forgáspontok a kép %-ában, a keszit.py kiírása szerint.
*/

.cica-sarok {
  position: fixed;
  right: 18px;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.cica-sarok > * {
  pointer-events: auto;
}

/* ---------- a cica ---------- */

.cica-gomb {
  position: relative;
  width: 106px;
  height: 130px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
  transition: transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.cica-gomb:hover {
  transform: translateY(-3px);
}

.cica-gomb:focus-visible {
  outline: 2px solid var(--cim);
  outline-offset: 4px;
  border-radius: 16px;
}

.cica-reteg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.cica-farok {
  transform-origin: 28.76% 89.36%;
  animation: cica-farok 3.6s ease-in-out infinite;
}

.cica-integeto {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.cica-ul {
  transition: opacity 0.28s ease;
}

.cica-gomb.integet .cica-integeto {
  opacity: 1;
}

.cica-gomb.integet .cica-ul {
  opacity: 0;
}

.cica-mancs {
  transform-origin: 86.93% 59.57%;
}

.cica-gomb.integet .cica-mancs {
  animation: cica-integet 0.62s ease-in-out 0.3s 3;
}

.cica-szem {
  opacity: 0;
}

.cica-gomb.pislog .cica-szem {
  opacity: 1;
}

@keyframes cica-farok {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  45% { transform: rotate(1.5deg); }
  62% { transform: rotate(9deg); }
  80% { transform: rotate(3deg); }
}

@keyframes cica-integet {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-13deg); }
}

/* a buborék: „Kérdezz tőlem!” */
.cica-buborek {
  margin: 0 18px 6px 0;
  padding: 8px 14px;
  border-radius: 16px 16px 4px 16px;
  background: rgba(14, 26, 52, 0.86);
  border: 1px solid var(--uveg-keret);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.cica-buborek.latszik {
  opacity: 1;
  transform: none;
}

/* ---------- a chat-ablak ---------- */

.cica-panel {
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 190px));
  margin-bottom: 8px;
  border-radius: 22px;
  background: linear-gradient(160deg, var(--uveg-feny), transparent 40%), rgba(10, 20, 42, 0.86);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.cica-panel.nyitva {
  opacity: 1;
  transform: none;
}

.cica-fej {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid var(--uveg-keret);
}

.cica-fej strong {
  display: block;
  color: #fff;
  font-size: 16px;
}

.cica-fej small {
  display: block;
  color: var(--halvany);
  font-size: 12.5px;
}

.cica-fej div {
  flex: 1;
  min-width: 0;
}

.cica-bezar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: none;
  color: var(--szoveg);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cica-bezar:hover,
.cica-bezar:focus-visible {
  background: rgba(159, 208, 255, 0.12);
  outline: none;
  border-color: rgba(159, 208, 255, 0.3);
}

.cica-uzenetek {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.cica-uzenet {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.cica-uzenet.tole {
  align-self: flex-start;
  background: rgba(159, 208, 255, 0.1);
  border: 1px solid rgba(159, 208, 255, 0.14);
  border-bottom-left-radius: 4px;
  color: var(--szoveg);
}

.cica-uzenet.en {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--kiemelt), var(--kek-3));
  border-bottom-right-radius: 4px;
  color: #fff;
}

.cica-uzenet strong {
  color: #fff;
}

.cica-uzenet a {
  text-decoration: underline;
}

.cica-ertekeles {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--halvany);
}

.cica-ertekeles button {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(159, 208, 255, 0.2);
  background: none;
  color: var(--szoveg);
  font-size: 13px;
  cursor: pointer;
}

.cica-ertekeles button:hover:not([disabled]) {
  background: rgba(159, 208, 255, 0.12);
}

.cica-ertekeles button[disabled] {
  cursor: default;
  opacity: 0.5;
}

.cica-ertekeles button.valasztva {
  opacity: 1;
  border-color: var(--zold);
}

.cica-gepel {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(159, 208, 255, 0.08);
}

.cica-gepel span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cim);
  animation: cica-pont 1.2s ease-in-out infinite;
}

.cica-gepel span:nth-child(2) { animation-delay: 0.15s; }
.cica-gepel span:nth-child(3) { animation-delay: 0.3s; }

@keyframes cica-pont {
  0%, 60%, 100% { opacity: 0.25; transform: none; }
  30% { opacity: 1; transform: translateY(-3px); }
}

.cica-keret {
  padding: 0 16px 6px;
  font-size: 12px;
  color: var(--halvany);
  min-height: 18px;
}

.cica-urlap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--uveg-keret);
}

.cica-urlap textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(159, 208, 255, 0.22);
  background: rgba(3, 11, 34, 0.55);
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.4;
}

.cica-urlap textarea:focus {
  outline: none;
  border-color: var(--cim);
}

.cica-urlap .gomb {
  padding: 10px 16px;
}

@media (max-width: 640px) {
  .cica-sarok {
    right: 8px;
  }

  .cica-gomb {
    width: 82px;
    height: 100px;
  }

  .cica-panel {
    height: min(520px, calc(100vh - 150px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cica-farok,
  .cica-gomb.integet .cica-mancs,
  .cica-gepel span {
    animation: none;
  }

  .cica-panel,
  .cica-buborek,
  .cica-ul,
  .cica-integeto {
    transition: none;
  }
}
