/* AlwaysReady Chatbot Widget — chatbot.css */

#ar-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #045D5D;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  z-index: 9998;
  transition: transform 0.15s, box-shadow 0.15s;
}
#ar-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
}
#ar-chat-btn:focus-visible {
  outline: 3px solid #00b8a6;
  outline-offset: 3px;
}
#ar-chat-btn svg { width: 26px; height: 26px; }

#ar-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #00b8a6;
  border-radius: 50%;
  border: 2px solid #faf9f6;
  display: block;
}
#ar-chat-badge.hidden { display: none; }

#ar-chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 360px;
  max-height: 520px;
  background: #fff;
  border: 1px solid #e0ddd6;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  transform: scale(0.95) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
#ar-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

#ar-chat-header {
  background: #045D5D;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ar-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ar-chat-avatar {
  width: 32px;
  height: 32px;
  background: #00b8a6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ar-chat-avatar svg { width: 18px; height: 18px; }
.ar-chat-title {
  font-family: 'Figtree', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #faf9f6;
  line-height: 1.2;
}
.ar-chat-subtitle {
  font-size: 11px;
  color: #00b8a6;
  font-weight: 500;
}
#ar-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.1s;
}
#ar-chat-close:hover { color: #faf9f6; }
#ar-chat-close:focus-visible { outline: 2px solid #00b8a6; }
#ar-chat-close svg { width: 18px; height: 18px; }

#ar-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#ar-chat-messages::-webkit-scrollbar { width: 4px; }
#ar-chat-messages::-webkit-scrollbar-thumb { background: #e0ddd6; border-radius: 4px; }

.ar-msg {
  max-width: 86%;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 10px 13px;
  border-radius: 12px;
  word-break: break-word;
}
.ar-msg.bot {
  background: #f0faf9;
  color: #045D5D;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.ar-msg.user {
  background: #045D5D;
  color: #faf9f6;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.ar-msg.error {
  background: #fef2f2;
  color: #991b1b;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.ar-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: #f0faf9;
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}
.ar-typing span {
  width: 6px;
  height: 6px;
  background: #00b8a6;
  border-radius: 50%;
  animation: ar-bounce 1.2s infinite;
}
.ar-typing span:nth-child(2) { animation-delay: 0.2s; }
.ar-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ar-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

.ar-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.ar-quick-btn {
  background: #fff;
  border: 1px solid #e0ddd6;
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 12px;
  color: #007a6e;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  font-family: inherit;
}
.ar-quick-btn:hover {
  background: #f0faf9;
  border-color: #00b8a6;
}
.ar-quick-btn:focus-visible { outline: 2px solid #00b8a6; }

#ar-chat-footer {
  padding: 12px;
  border-top: 1px solid #e8e6e0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  background: #fff;
}
#ar-chat-input {
  flex: 1;
  border: 1.5px solid #e0ddd6;
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: #045D5D;
  background: #faf9f6;
  outline: none;
  resize: none;
  transition: border-color 0.15s;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}
#ar-chat-input:focus { border-color: #00b8a6; }
#ar-chat-input::placeholder { color: #aaa; }

#ar-chat-send {
  width: 38px;
  height: 38px;
  background: #045D5D;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
#ar-chat-send:hover { background: #00b8a6; }
#ar-chat-send:active { transform: scale(0.95); }
#ar-chat-send:focus-visible { outline: 2px solid #00b8a6; outline-offset: 2px; }
#ar-chat-send:disabled { background: #ccc; cursor: not-allowed; }
#ar-chat-send svg { width: 17px; height: 17px; }

#ar-chat-clear {
  background: none;
  border: none;
  font-size: 11px;
  color: #aaa;
  cursor: pointer;
  padding: 4px 8px;
  text-align: center;
  display: block;
  width: 100%;
  font-family: inherit;
  transition: color 0.1s;
}
#ar-chat-clear:hover { color: #767676; }

@media (max-width: 480px) {
  #ar-chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 84px;
    max-height: 70vh;
  }
  #ar-chat-btn { right: 16px; bottom: 16px; }
}
