/* === Kutyablog Chatbot – Teljes stílus (asztali + mobil) ===
   Barna–bézs arculat, mobilbarát, nem takarja a laptetejére ugrás gombot.
*/

#chatbot-container {
  z-index: 2147483645;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Chatablak === */
#chatbot-window {
  display: none;
  position: fixed;
  bottom: 100px;    /* Elég magasan, hogy ne takarja a laptetejére ugrás gombot */
  right: 20px;      /* Asztali: jobb szél */
  width: 320px;
  max-height: 600px;
  background: #fdf9f3;
  border: 2px solid #d4b89a;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 2147483646;
  pointer-events: auto;
}

/* Megnyitott állapot (JS ezen az osztályon kapcsol) */
#chatbot-window.is-open {
  display: block !important;
}

#chatbot-header {
  background: #8B5E3C;
  color: white;
  padding: 10px 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

#chatbot-messages {
  height: 260px;
  overflow-y: auto;
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  background: #fffefb;
}

#chatbot-input-area {
  display: flex;
  padding: 8px;
  background: #f8f4ee;
  border-top: 1px solid #e8dccc;
}

#chatbot-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d4b89a;
  border-radius: 4px;
  font-size: 14px;
}

#chatbot-send {
  margin-left: 8px;
  padding: 8px 12px;
  background: #8B5E3C;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#chatbot-send:hover {
  background: #7a5232;
}

/* Törlés gomb */
.chatbot-reset {
  margin-top: 8px;
  padding: 6px 12px;
  background: #eee;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.chatbot-reset:hover {
  background: #f8d7a1;
}
/* Törlés gomb END */

/* === Toggle gomb (tappancs ikon) === */
#chatbot-toggle {
  position: fixed;
  bottom: 90px;
  right: 95px;
  background: #8B5E3C;
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2147483647; /* mindent üssön */
}

#chatbot-toggle:hover {
  background: #7a5232;
}

/* === Felirat az ikon fölött === */
#chatbot-label {
    position: fixed;
    bottom: 150px;
    right: 100px;
    width: 80px;
    text-align: center;
    font-size: 18px !important;
    color: #8B5E3C;
    font-weight: bold;
    z-index: 2147483646;
}

/* === Mobilbarát módosítások (768px alatt) === */
@media (max-width: 768px) {
  /* Chatablak: középre, margókkal, nem kilóg */
  #chatbot-window {
    width: auto !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 90px !important;
    max-height: 350px;
  }

  #chatbot-messages {
    height: 220px;
    font-size: 13px;
  }

  #chatbot-input {
    font-size: 14px;
    padding: 8px;
  }

  /* Ikon: közelebb a sarokhoz, könnyebb elérni */
  #chatbot-toggle {
    right: 80px !important;
    bottom: 20px !important;
    width: 48px;
    height: 48px;
  }

  /* Felirat: elrejtjük mobil nézetben (helytakarékos) */
  #chatbot-label {
    display: none !important;
  }
}

/* === Nagyon kis képernyők (pl. iPhone SE) === */
@media (max-width: 480px) {
  #chatbot-window {
    bottom: 80px !important;
    max-height: 300px;
  }

  #chatbot-messages {
    height: 180px;
  }
}

/* === Biztonsági margó iOS/Android aljához === */
@supports (bottom: env(safe-area-inset-bottom)) {
  #chatbot-toggle {
    bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  }

  @media (min-width: 769px) {
    #chatbot-toggle {
      bottom: calc(40px + env(safe-area-inset-bottom)) !important;
    }
  }
}
