/* ============================================
   Zombori Tamás – Chatbot Widget Stílusok
   Design: illeszkedik a fő oldal designjához
   Színek: sage (#7A9E7E), warm (#42302A), cream (#FAF8F5)
   ============================================ */

/* --- Chat buborék gomb (jobb alsó sarok) --- */
.chat-bubble-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #7A9E7E 0%, #5C7E60 100%);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(122, 158, 126, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.chat-bubble-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(122, 158, 126, 0.5);
}

.chat-bubble-btn svg {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.3s ease;
}

.chat-bubble-btn.open svg.icon-chat {
  display: none;
}

.chat-bubble-btn.open svg.icon-close {
  display: block;
}

.chat-bubble-btn:not(.open) svg.icon-chat {
  display: block;
}

.chat-bubble-btn:not(.open) svg.icon-close {
  display: none;
}

/* --- Chat ablak --- */
.chat-window {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 8rem);
  background-color: #FAF8F5;
  border-radius: 1rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* --- Chat fejléc --- */
.chat-header {
  background: linear-gradient(135deg, #7A9E7E 0%, #5C7E60 100%);
  color: #FFFFFF;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.chat-header-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.chat-header-info p {
  font-size: 0.75rem;
  opacity: 0.85;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

/* --- GDPR hozzájárulás --- */
.chat-consent {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.chat-consent p {
  font-size: 0.85rem;
  color: #42302A;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  font-family: 'Inter', sans-serif;
}

.chat-consent p a {
  color: #7A9E7E;
  text-decoration: underline;
}

.chat-consent-btn {
  background-color: #7A9E7E;
  color: #FFFFFF;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.chat-consent-btn:hover {
  background-color: #5C7E60;
}

/* --- Üzenetek terület --- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

/* Scrollbar stílus */
.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(122, 158, 126, 0.3);
  border-radius: 10px;
}

/* --- Üzenet buborékok --- */
.chat-msg {
  max-width: 85%;
  padding: 0.7rem 1rem;
  border-radius: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  line-height: 1.55;
  word-wrap: break-word;
  animation: chatMsgIn 0.3s ease;
}

@keyframes chatMsgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg.assistant {
  background-color: #FFFFFF;
  color: #42302A;
  border-bottom-left-radius: 0.25rem;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.chat-msg.user {
  background-color: #7A9E7E;
  color: #FFFFFF;
  border-bottom-right-radius: 0.25rem;
  align-self: flex-end;
}

/* Linkek az asszisztens üzenetben */
.chat-msg.assistant a {
  color: #7A9E7E;
  text-decoration: underline;
}

/* --- Gépelés animáció --- */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 0.7rem 1rem;
  background-color: #FFFFFF;
  border-radius: 1rem;
  border-bottom-left-radius: 0.25rem;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.chat-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #7A9E7E;
  opacity: 0.4;
  animation: typingBounce 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* --- Beviteli mező --- */
.chat-input-area {
  padding: 0.75rem;
  border-top: 1px solid #e5e1dc;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  background-color: #FFFFFF;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid #d5d0ca;
  border-radius: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #42302A;
  background-color: #FAF8F5;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
  transition: border-color 0.3s ease;
}

.chat-input:focus {
  outline: none;
  border-color: #7A9E7E;
  box-shadow: 0 0 0 2px rgba(122, 158, 126, 0.15);
}

.chat-input::placeholder {
  color: #7B6458;
  opacity: 0.6;
}

.chat-send-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background-color: #7A9E7E;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background-color: #5C7E60;
}

.chat-send-btn:disabled {
  background-color: #d5d0ca;
  cursor: not-allowed;
}

.chat-send-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* --- AI jelzés (EU AI Act átláthatóság) --- */
.chat-ai-notice {
  padding: 0.4rem 0.75rem;
  text-align: center;
  font-size: 0.68rem;
  color: #7B6458;
  font-family: 'Inter', sans-serif;
  background-color: #FFFFFF;
  border-top: 1px solid #e5e1dc;
  flex-shrink: 0;
}

/* --- Hiba üzenet --- */
.chat-error {
  background-color: #fef2f2;
  color: #991b1b;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  text-align: center;
  margin: 0.5rem 0;
}

/* --- Mobil reszponzív --- */
@media (max-width: 480px) {
  .chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .chat-bubble-btn {
    bottom: 1rem;
    right: 1rem;
  }
}

/* Sticky CTA-val ne ütközzön */
@media (max-width: 1023px) {
  .chat-bubble-btn {
    bottom: 4.5rem;
  }

  .chat-window {
    bottom: 8rem;
    max-height: calc(100vh - 10rem);
  }
}

@media (max-width: 480px) {
  .chat-window {
    bottom: 0;
    max-height: 100vh;
  }

  .chat-bubble-btn {
    bottom: 4.5rem;
  }
}
