.chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #9f001b;
  color: #fff;
  font-size: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: background 0.3s;
}
.chat-toggle:hover {
  background: #7c0015;
}

/* Chat ablak */
.chat-window {
  position: fixed;
  bottom: 0;
  right: 0;
  background: #fff;
  border-left: 1px solid #ccc;
  border-top: 1px solid #ccc;
  display: none;
  flex-direction: column;
  z-index: 1000;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
}

/* Fejléc */
.chat-header {
  background: #9f001b;
  color: #fff;
  padding: 0px 10px 0px 10px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
}

.chat-header button {
  background: transparent;
  border: none;
  color: #fff;
  padding: 0px;
  font-size: 18px;
  cursor: pointer;
}

/* Tartalom */
.chat-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

/* Input rész */
input[type="button"] {
  cursor: pointer;
}
.chat-footer {
  border-top: 1px solid #ccc;

  flex-shrink: 0; /* ne nyomódjon fel */
  background: #fff;
}

.chat-footer textarea {
  flex: 1;
  border: none;
  padding: 10px;

  height: 100px;
}
.chat-footer button {
  background: #9f001b;
  color: #fff;
  border: none;
  padding: 0 14px;
  cursor: pointer;
}
.read-receipt {
  text-align: right;

  color: #444;
  margin: 5px 10px 5px 0;
  font-style: italic;
}
.chat-footer {
  display: none;
} /* alapból rejtve */

/* Beszélgetés lista */
.chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
a.unread {
  border-left: 10px solid RED;
}

.chat-list li {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.chat-list a {
  flex: 1; /* kitölti a helyet a gombig */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-decoration: none;
  color: #333;
  transition: background 0.2s;
}

.chat-list .removechat {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;

  float: right;
  font-size: x-large;
}

.chat-list a:hover {
  background: #f9f9f9;
}
img.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.chat-list .chat-info {
  flex: 1;
}
.chat-list .chat-info .chat-name {
  font-weight: bold;
}
.chat-list .chat-info .chat-time {
  color: #777;
}
.chat-list .chat-info .chat-preview {
  color: #555;
}
.chat-list a:hover .chat-preview {
  visibility: visible;
}

/* Üzenetek megjelenítése */
/* .chat-messages {
  flex-direction: row-reverse;
   align-self: flex-end;
   gap: 12px;/*

}
*/
.message {
  display: flex;
  align-items: flex-end;
  overflow-x: hidden;
  /* gap: 10px;*/
  padding: 0px 0px 15px 0px;
}

.message img,
.list-group-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* Másik fél üzenete (bal oldalt) */
.message.other {
  flex-direction: row;
  align-self: flex-start;
}
.message.other .bubble {
  background: #9f001b;
  color: #fff;
  border-radius: 12px 12px 12px 0px;
  padding: 8px 12px;
}
.message.other .time {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
  text-align: left;
}

/* Saját üzenet (jobb oldalt) */
.message.me {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.message.me .bubble {
  background: #f1f1f1;
  color: #222;
  border-radius: 12px 12px 0px 12px;
  padding: 8px 12px;
}
.message.me .time {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  text-align: right;
}
#chatToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #9f001b;
  color: #fff;
  font-size: 28px;
  text-align: center;
  line-height: 60px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  border-width: 2px;
  border-style: solid;
  border-color: #9f001b; /* alap állapot */
}

/* amikor van új üzenet */
#chatToggle.has-new {
  animation: blinkBorder 1s infinite;
}

/* animáció: keret villog */
@keyframes blinkBorder {
  0% {
    background: #9f001b;
  }
  50% {
    background: transparent;
  }
  100% {
    background: #9f001b;
  }
}
.chat-body.loading {
  position: relative;
}

.chat-body.loading::after {
  content: "Betöltés...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 1);
  padding: 100px 100px;
  border-radius: 10px;

  color: #9f001b;
  z-index: 10;
}
/* Overlay a chat ablak fölé */
.chat-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

/* Progress bar */
.chat-overlay .progress {
  width: 80%;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  overflow: hidden;
}
.chat-overlay .progress-bar {
  width: 0%;
  height: 100%;
  background: #9f001b;
  animation: progressAnim 2s linear forwards;
}
@keyframes progressAnim {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}
#chatActionContainer {
  border-bottom: 1px solid white;
  background: #911c22;
  color: white;

  font-weight: normal;
  text-align: left;
  padding: 0px;
}
#chatActionContainer.latszik {
  padding: 0px 5px 0px 5px;
  display: flow-root !important;
}
.chat-action img {
  width: 20px;
  height: 20px;
  cursor: pointer;
}
#chatTitle a {
  color: white !important;
}
.chatsarga {
  text-decoration: none;
  background-color: yellow !important;
  padding: 5px;
  margin: 5px;
  border: 1px solid red;
  border-radius: 4px;
  color: black !important;
}
.chatzold {
  text-decoration: none;
  background-color: green !important;
  padding: 5px;
  margin: 5px;
  border: 1px solid black !important;
  border-radius: 4px;
  cursor: pointer;
  color: yellow !important;
}
.chatpiros {
  text-decoration: none;
  background-color: red !important;
  padding: 5px;
  margin: 5px;
  border: 1px solid yellow !important;
  border-radius: 4px;
  cursor: pointer;

  color: white !important;
}
.chat-tabs .chat-tab {
  flex: 1;
  text-align: center;
  padding: 3px;
  margin: 0px;
  border-radius: 0px;
  border: none;
  background: #ffffff;
  cursor: pointer;
  font-size: 18px;
  text-decoration: none; /* az <a>-ra is vonatkozik */
  color: #333;
  box-shadow: none !important;
  filter: none;
}
.chat-tabs {
  border-bottom: 1px solid black;
  display: none;
  height: 38px;
}
.chat-tabs .chat-tab.active {
  background: #9f001b;
  font-weight: bold;
  font-size: 22px;
}
.chat-tab {
  overflow: visible; /* FONTOS: ne vágja le a kilógó animációt */
}

#chatTabs.latszik {
  display: flex !important;
}
.chat-tab.has-new {
  animation: blinkBorder 1s infinite;
}
.chatlist img.message-avatar {
  float: left;
}

.chat-body,
.chat-body .bubble,
.chat-list,
.chat-header,
.message,
.chat-footer textarea {
  font-size: var(--chat-font-size);
}

/* ROBOT */
.ai-icon {
  position: relative;
  display: inline-block;
  font-size: 22px;
  z-index: 2;
  animation: brutalPulse 0.9s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* dupla robbanó aura */
.ai-icon::before,
.ai-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

.ai-icon::before {
  background: radial-gradient(
    circle,
    rgba(0, 180, 255, 0.9) 0%,
    rgba(0, 180, 255, 0.6) 30%,
    rgba(0, 180, 255, 0.2) 55%,
    rgba(0, 180, 255, 0) 75%
  );
  animation: shockwave 1.2s infinite;
}

.ai-icon::after {
  background: radial-gradient(
    circle,
    rgba(255, 0, 150, 0.8) 0%,
    rgba(255, 0, 150, 0.5) 30%,
    rgba(255, 0, 150, 0.15) 55%,
    rgba(255, 0, 150, 0) 75%
  );
  animation: shockwave 1.2s infinite 0.4s;
}

/* agresszív méret + fény */
@keyframes brutalPulse {
  0% {
    transform: scale(1);
    filter: brightness(1) drop-shadow(0 0 0px #00b4ff);
  }
  40% {
    transform: scale(1.35);
    filter: brightness(1.6) drop-shadow(0 0 18px #00b4ff);
  }
  60% {
    transform: scale(1.15);
    filter: brightness(1.4) drop-shadow(0 0 25px #ff0095);
  }
  100% {
    transform: scale(1);
    filter: brightness(1) drop-shadow(0 0 0px #00b4ff);
  }
}

/* kifelé robbanó hullám */
@keyframes shockwave {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  70% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}
/* animáció leállítás */
.ai-icon.stop,
.ai-icon.stop::before,
.ai-icon.stop::after {
  animation: none !important;
  filter: none !important;
}
