/* Pflegebuddy Amis Chat – Deluxe 4.1
 * mit Sounds, Lichtreaktion & Wellenanimation
 * (c) Amedis Care e.V.
 */

/* ===== Grundlayout ===== */
#pflegebuddy-chat-container {
  position: fixed;
  bottom: 20px;
  right: 25px;
  width: 340px;
  max-width: 95vw;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  font-family: "Open Sans", Arial, sans-serif;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease-in-out;
}

/* ===== Mini-Float ===== */
#pflegebuddy-chat-container.pflegebuddy-chat-closed {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  cursor: pointer;
}

#pflegebuddy-chat-container.pflegebuddy-chat-closed::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 70px;
  height: 70px;
  background: url("../img/Amis_neutral.png") no-repeat center center / cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.3s ease-in-out;
}

#pflegebuddy-chat-container.pflegebuddy-chat-closed:hover::after {
  transform: scale(1.05);
}

/* ===== Header ===== */
#pflegebuddy-chat-header {
  background: linear-gradient(135deg, #5ec7f2, #047fb3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.pflegebuddy-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  transition: box-shadow 0.3s ease;
}

.pflegebuddy-avatar.active {
  box-shadow: 0 0 12px 4px rgba(79,195,247,0.6);
}

.pflegebuddy-title {
  font-weight: 600;
  font-size: 16px;
  flex: 1;
  margin-left: 10px;
}

/* ===== Body ===== */
#pflegebuddy-chat-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f8f8f8;
}

.pflegebuddy-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== Sprechblasen ===== */
.pflegebuddy-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 80%;
  font-size: 15px;
  line-height: 1.3;
  animation: fadeIn 0.3s ease;
}

.pflegebuddy-bubble.user {
  align-self: flex-end;
  background: #dcf8c6;
  border-bottom-right-radius: 4px;
}

.pflegebuddy-bubble.amis {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #ddd;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ===== Eingabebereich ===== */
.pflegebuddy-input {
  display: flex;
  align-items: center;
  padding: 8px;
  background: #fafafa;
  border-top: 1px solid #ddd;
}

#pflegebuddy-message-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 25px;
  padding: 10px 14px;
  outline: none;
}

#pflegebuddy-send-btn {
  background: #4fc3f7;
  color: white;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  margin-left: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s ease, transform 0.2s ease;
}

#pflegebuddy-send-btn:hover {
  background: #0288d1;
  transform: scale(1.05);
}

/* ===== Animationen ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(79,195,247,0.4); }
  50% { box-shadow: 0 0 16px rgba(79,195,247,0.8); }
}

.typing .pflegebuddy-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing .dot {
  width: 6px;
  height: 6px;
  background-color: #bbb;
  border-radius: 50%;
  animation: blink 1.3s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.3; transform: translateY(0px); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
  #pflegebuddy-chat-container {
    right: 10px;
    bottom: 10px;
    width: 92vw;
  }
  #pflegebuddy-chat-container.pflegebuddy-chat-open {
    height: 80vh;
  }
}
