:root {
  --chat-gold: #c9a84c;
  --chat-gold-rgb: 201, 168, 76;
  --chat-gold-dark: #b8962e;
  --chat-gold-light: #d4b85c;
}

.ai-chat {
  position: fixed;
  right: 30px;
  bottom: 35px;
  z-index: 9999;
}

.ai-chat-toggle {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: var(--chat-gold);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(var(--chat-gold-rgb), 0.35);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.ai-chat-toggle:hover {
  color: #fff;
  transform: scale(1.06);
  filter: brightness(0.92);
  box-shadow: 0 8px 25px rgba(var(--chat-gold-rgb), 0.45);
}

.ai-chat-toggle:active {
  transform: scale(0.95);
}

.ai-chat-window {
  position: absolute;
  right: 0;
  bottom: 75px;
  width: 380px;
  height: 500px;
  max-width: calc(100vw - 30px);
  max-height: calc(100vh - 130px);
  display: none;
  flex-direction: column;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: aiChatShow 0.25s ease;
}

.ai-chat-window.active {
  display: flex;
}

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

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--chat-gold), var(--chat-gold-dark));
  color: #fff;
  flex-shrink: 0;
}

.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ai-chat-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff;
}

.ai-chat-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.ai-chat-status {
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.85;
}

.ai-chat-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: #fff;
  border: none;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}

.ai-chat-close:hover {
  opacity: 1;
}

.ai-chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  overflow-y: auto;
  background: #f8f9fa;
}

.ai-chat-messages::-webkit-scrollbar {
  width: 5px;
}

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

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(var(--chat-gold-rgb), 0.35);
  border-radius: 10px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--chat-gold-rgb), 0.55);
}

.ai-message {
  max-width: 80%;
  padding: 10px 13px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 12px;
  word-break: break-word;
  animation: messageShow 0.2s ease;
}

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

.ai-message-bot {
  align-self: flex-start;
  background: #fff;
  color: #333;
  border: 1px solid #e5e5e5;
  border-bottom-left-radius: 4px;
}

.ai-message-user {
  align-self: flex-end;
  background: var(--chat-gold);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai-message-error {
  align-self: flex-start;
  background: rgba(220, 53, 69, 0.1);
  color: #842029;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.ai-typing span {
  width: 7px;
  height: 7px;
  background: var(--chat-gold);
  border-radius: 50%;
  animation: typing 1.3s infinite;
}

.ai-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.ai-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.ai-chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.ai-chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 100px;
  padding: 9px 11px;
  resize: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.ai-chat-input:focus {
  outline: none;
  border-color: var(--chat-gold);
  box-shadow: 0 0 0 0.15rem rgba(var(--chat-gold-rgb), 0.15);
}

.ai-chat-input::placeholder {
  color: #999;
}

.ai-chat-send {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--chat-gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
}

.ai-chat-send:hover {
  color: #fff;
  filter: brightness(0.92);
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(var(--chat-gold-rgb), 0.3);
}

.ai-chat-send:active {
  transform: scale(0.95);
}

.ai-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 576px) {
  .ai-chat {
    right: 15px;
    bottom: 25px;
  }
  .ai-chat-toggle {
    width: 55px;
    height: 55px;
  }
  .ai-chat-window {
    right: 0;
    bottom: 65px;
    width: calc(100vw - 30px);
    height: 75vh;
    max-width: calc(100vw - 30px);
    max-height: 75vh;
    border-radius: 14px;
  }
}

/* ================== notif demo */
/* ================== notif demo */
