/* Chatbot Container (Floating Button) */
.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Inter', sans-serif;
}

.chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.chat-button:hover {
  transform: scale(1.1);
}

.chat-button svg {
  width: 32px;
  height: 32px;
  color: white;
  transition: opacity 0.3s ease;
}

.chat-button .close-icon {
  position: absolute;
  opacity: 0;
}

.chat-widget.open .chat-button .message-icon {
  opacity: 0;
}

.chat-widget.open .chat-button .close-icon {
  opacity: 1;
}

/* Chat Box (Window) */
.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-width: 90vw;
  height: 500px;
  max-height: 70vh;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Safari support */
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  visibility: hidden;
}

.chat-widget.open .chat-window {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

/* Dark mode support for window */
@media (prefers-color-scheme: dark) {
  .chat-window {
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
  }
  
  .chat-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  }
}

/* Chat Header */
.chat-header {
  padding: 1rem;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
}

.chat-info h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.chat-info span {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
  display: inline-block;
}

/* Chat Body (Messages) */
.chat-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.4;
  animation: fadeIn 0.3s ease;
}

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

.message.bot {
  background: #f0f0f5;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message.user {
  background: #2575fc;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

@media (prefers-color-scheme: dark) {
  .message.bot {
    background: #444;
    color: #eee;
  }
}

/* Chat Input Area */
.chat-footer {
  padding: 10px;
  background: rgba(245, 245, 245, 0.5);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 8px;
}

@media (prefers-color-scheme: dark) {
  .chat-footer {
    background: rgba(40, 40, 40, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
}

.chat-input {
  flex: 1;
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #2575fc;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #2575fc;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.send-btn:hover {
  background: #1a65d8;
}

.send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
