/* CHAT WIDGET */
.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  font-family: var(--font);
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--accent-glow);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-toggle:hover {
  transform: translateY(-5px) scale(1.05);
  background: var(--accent-bright);
}

.chat-toggle svg {
  width: 32px;
  height: 32px;
  stroke: white;
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 520px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

.chat-widget:not(.hidden) .chat-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-header {
  padding: 20px;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.chat-header-info {
  flex: 1;
}

.chat-header-info h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.chat-header-info p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-close:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.message {
  max-width: 85%;
  padding: 12px 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  animation: messageSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.message.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.message.assistant {
  align-self: flex-start;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 18px 18px 18px 4px;
}

.message-content strong {
  color: inherit;
  font-weight: 700;
}

.chat-input-area {
  padding: 16px;
  background: rgba(255, 255, 255, 0.4);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-send {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.chat-send svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  display: block;
}

.chat-send:hover {
  transform: translateY(-2px);
  background: var(--accent-bright);
}

.typing-indicator {
  padding: 0 20px 12px;
  display: none;
  gap: 4px;
}

.typing-indicator.active {
  display: flex;
}

.typing-dot {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.chat-widget.hidden .chat-window {
  pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 40px);
    height: 70vh;
    bottom: 80px;
    right: 0;
  }
}

