/* Sayele AI Assistant - Chat Widget Styles */

/* Chat Toggle Button */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(179, 57, 57, 0.4);
  transition: all 0.3s ease;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(179, 57, 57, 0.6);
}

.chat-toggle.hidden {
  opacity: 0;
  pointer-events: none;
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #10b981;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid white;
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 100px);
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  overflow: hidden;
}

.chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 16px 16px 0 0;
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.chat-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.9;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  transition: opacity 0.3s;
}

.chat-close-btn:hover {
  opacity: 0.8;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

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

.user-message {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary-red);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.user-message .message-avatar {
  background: var(--text-dark);
}

.message-content {
  background: white;
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 75%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
  line-height: 1.5;
  font-size: 14px;
}

.user-message .message-content {
  background: var(--primary-red);
  color: white;
}

.message-time {
  display: block;
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
}

.error-message .message-content {
  background: #fee;
  color: #c00;
  border: 1px solid #fcc;
}

/* Typing Indicator */
.typing-indicator .message-content {
  padding: 16px 20px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

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

/* Chat Input */
.chat-input-container {
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
}

.chat-quick-questions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.quick-question {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-question:hover {
  background: var(--primary-red);
  color: white;
  border-color: var(--primary-red);
}

.quick-question i {
  font-size: 11px;
}

.chat-form {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
  background: var(--bg-white);
  color: var(--text-dark);
}

.chat-input:focus {
  border-color: var(--primary-red);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  background: var(--primary-red);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--primary-red-dark);
  transform: scale(1.05);
}

.chat-footer-text {
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  opacity: 0.7;
}

/* Dark Mode Support */
[data-theme="dark"] .chat-window {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .chat-messages {
  background: #000000;
}

[data-theme="dark"] .message-content {
  background: var(--card-bg);
  color: var(--text-dark);
}

[data-theme="dark"] .user-message .message-content {
  background: var(--primary-red);
  color: white;
}

[data-theme="dark"] .chat-input-container {
  background: var(--card-bg);
}

[data-theme="dark"] .chat-input {
  background: #000000;
  color: var(--text-dark);
  border-color: var(--border-color);
}

[data-theme="dark"] .quick-question {
  background: #000000;
  color: var(--text-dark);
  border-color: var(--border-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-window {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

  .chat-toggle {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }

  .chat-header {
    border-radius: 0;
  }

  .message-content {
    max-width: 80%;
  }

  .chat-quick-questions {
    flex-wrap: nowrap;
  }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--primary-red);
}

/* Accessibility */
.chat-toggle:focus,
.chat-close-btn:focus,
.chat-send-btn:focus,
.quick-question:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
}
