/* ================================
   GALLITE — AI CHATBOT
   OLD STYLE, NEW CLASS NAMES
================================ */

#gallite-chat-toggle {
  position: fixed;
  right: 1.75rem;
  bottom: 6.5rem;
  z-index: 9998;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #6c3bff;
  color: #fff;
  font-size: 22px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(108, 59, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s;
  animation: galliteChatPulse 2.5s ease-in-out infinite;
}

#gallite-chat-toggle:hover {
  background: #5a2ee6;
  transform: scale(1.08);
  box-shadow: 0 12px 36px rgba(108, 59, 255, 0.55);
}

#gallite-chat-toggle:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

@keyframes galliteChatPulse {
  0%, 100% {
    box-shadow: 0 6px 24px rgba(108, 59, 255, 0.45), 0 0 0 0 rgba(108, 59, 255, 0.35);
  }
  50% {
    box-shadow: 0 6px 24px rgba(108, 59, 255, 0.45), 0 0 0 12px rgba(108, 59, 255, 0);
  }
}

#gallite-chat-window {
  position: fixed;
  right: 1.75rem;
  bottom: 11rem;
  width: 350px;
  height: 520px;
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid rgba(108, 59, 255, 0.12);
  box-shadow: 0 16px 56px rgba(108, 59, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9997;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-family: var(--font-body, 'Plus Jakarta Sans', 'Segoe UI', sans-serif);
}

#gallite-chat-window.gallite-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.97);
}

.gallite-chat-header {
  background: linear-gradient(135deg, #6c3bff 0%, #8d63ff 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.gallite-chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.gallite-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}

.gallite-chat-info {
  flex: 1;
  min-width: 0;
}

.gallite-chat-info .gallite-bot-name {
  font-family: var(--font-body, 'Plus Jakarta Sans', 'Segoe UI', sans-serif);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.gallite-chat-info .gallite-bot-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.74);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-family: var(--font-body, 'Plus Jakarta Sans', 'Segoe UI', sans-serif);
  font-weight: 500;
}

.gallite-chat-info .gallite-bot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #86efac;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.gallite-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 17px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallite-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

#gallite-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f7ff;
}

#gallite-messages::-webkit-scrollbar {
  width: 4px;
}

#gallite-messages::-webkit-scrollbar-thumb {
  background: rgba(108, 59, 255, 0.18);
  border-radius: 4px;
}

.gallite-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.65;
  word-wrap: break-word;
  font-family: var(--font-body, 'Plus Jakarta Sans', 'Segoe UI', sans-serif);
  font-weight: 500;
}

.gallite-msg.bot {
  background: #fff;
  color: #1f2937;
  border: 1.5px solid rgba(108, 59, 255, 0.1);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 2px 10px rgba(108, 59, 255, 0.08);
}

.gallite-msg.user {
  background: linear-gradient(135deg, #6c3bff, #8d63ff);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  box-shadow: 0 4px 14px rgba(108, 59, 255, 0.3);
  border: none;
  font-weight: 600;
}

.gallite-msg.error {
  background: #fff5f5;
  color: #dc2626;
  border: 1.5px solid #fecaca;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  font-size: 13px;
}

.gallite-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid rgba(108, 59, 255, 0.1);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(108, 59, 255, 0.07);
}

.gallite-typing span {
  width: 7px;
  height: 7px;
  background: #9b6dff;
  border-radius: 50%;
  animation: galliteBounce 1.2s infinite;
}

.gallite-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.gallite-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes galliteBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.gallite-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.gallite-qr-btn {
  background: #f3eeff;
  color: #6c3bff;
  border: 1.5px solid rgba(108, 59, 255, 0.2);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font-body, 'Plus Jakarta Sans', 'Segoe UI', sans-serif);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.gallite-qr-btn:hover {
  background: #6c3bff;
  color: #fff;
  border-color: #6c3bff;
  transform: translateY(-1px);
}

.gallite-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1.5px solid rgba(108, 59, 255, 0.1);
  background: #fff;
  align-items: center;
  flex-shrink: 0;
}

.gallite-chat-input input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid rgba(108, 59, 255, 0.15);
  border-radius: 12px;
  font-size: 13px;
  font-family: var(--font-body, 'Plus Jakarta Sans', 'Segoe UI', sans-serif);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #1f2937;
  background: #f9f7ff;
  font-weight: 500;
}

.gallite-chat-input input:focus {
  border-color: #6c3bff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108, 59, 255, 0.1);
}

.gallite-chat-input input::placeholder {
  color: rgba(108, 59, 255, 0.35);
}

.gallite-send-btn {
  background: #6c3bff;
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(108, 59, 255, 0.35);
}

.gallite-send-btn:hover {
  background: #5a2ee6;
  transform: scale(1.07);
  box-shadow: 0 6px 18px rgba(108, 59, 255, 0.45);
}

.gallite-send-btn:disabled {
  background: #c4b3ff;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 520px) {
  #gallite-chat-toggle {
    right: 1.25rem;
    bottom: 5.5rem;
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  #gallite-chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 9.5rem;
  }
}