/* RLINE AI Chatbot Styles */

/* Chat Button */
#rline-chat-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
  z-index: 9999;
  color: white;
}

#rline-chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

#rline-chat-button.active {
  transform: scale(0.95);
}

#rline-chat-button .chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  font-weight: 600;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat Window */
#rline-chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 580px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
}

#rline-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  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;
}

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

.chat-status {
  font-size: 12px;
  opacity: 0.9;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

.chat-action-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
}

/* Welcome Screen */
.chat-welcome {
  text-align: center;
  padding: 32px 16px;
}

.welcome-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
}

.chat-welcome h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #1e293b;
}

.chat-welcome p {
  margin: 0 0 20px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.suggested-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggested-question {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.suggested-question:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: #f8f7ff;
}

/* Message Bubbles */
.chat-message {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

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

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

.message-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.message-content {
  max-width: 75%;
  background: white;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.user .message-content {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
}

.chat-message.user .message-time {
  color: rgba(255, 255, 255, 0.7);
}

/* Typing Indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #6366f1;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

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

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

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

/* Quick Actions */
.chat-quick-actions {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
}

.quick-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  background: #6366f1;
  border-color: #6366f1;
  color: white;
}

.quick-action-btn:first-child:hover {
  background: #10b981;
  border-color: #10b981;
}

/* Chat Input */
.chat-input-container {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

#chat-form {
  display: flex;
  gap: 8px;
}

#chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#chat-input:focus {
  border-color: #6366f1;
}

#chat-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s;
}

#chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#chat-send:not(:disabled):hover {
  transform: scale(1.1);
}

/* Modals */
.chat-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.chat-modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 340px;
  overflow: hidden;
  animation: modalSlide 0.3s ease;
}

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

.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.chat-modal-header h4 {
  margin: 0;
  font-size: 16px;
  color: #1e293b;
}

.chat-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.chat-modal-close:hover {
  color: #64748b;
}

/* Form Styles */
.chat-form-group {
  padding: 12px 16px;
}

.chat-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

.chat-form-group input,
.chat-form-group textarea,
.chat-form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.chat-form-group input:focus,
.chat-form-group textarea:focus,
.chat-form-group select:focus {
  border-color: #6366f1;
}

.chat-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.chat-form-actions {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e2e8f0;
}

.chat-form-actions button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.btn-cancel:hover {
  background: #e2e8f0;
}

.btn-submit {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none;
  color: white;
}

.btn-submit:hover {
  opacity: 0.9;
}

/* Call Modal */
.call-info {
  padding: 24px 16px;
  text-align: center;
}

.call-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
}

.call-info h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #1e293b;
}

.support-hours {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 20px;
}

.call-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.call-button:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.support-email {
  margin-top: 16px;
  font-size: 13px;
  color: #64748b;
}

.support-email a {
  color: #6366f1;
  text-decoration: none;
}

.support-email a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  #rline-chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  #rline-chat-button {
    bottom: 16px;
    right: 16px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  #rline-chat-window {
    background: #1e293b;
  }

  .chat-messages {
    background: #0f172a;
  }

  .message-content {
    background: #334155;
    color: #f1f5f9;
  }

  .chat-message.user .message-content {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  }

  .chat-welcome h3 {
    color: #f1f5f9;
  }

  .chat-welcome p {
    color: #94a3b8;
  }

  .suggested-question {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
  }

  .suggested-question:hover {
    background: #3b4863;
    border-color: #6366f1;
    color: #a5b4fc;
  }

  .chat-quick-actions {
    background: #1e293b;
    border-color: #334155;
  }

  .quick-action-btn {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
  }

  .chat-input-container {
    background: #1e293b;
    border-color: #334155;
  }

  #chat-input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
  }

  .chat-modal-content {
    background: #1e293b;
  }

  .chat-modal-header {
    border-color: #334155;
  }

  .chat-modal-header h4 {
    color: #f1f5f9;
  }

  .chat-form-group label {
    color: #e2e8f0;
  }

  .chat-form-group input,
  .chat-form-group textarea,
  .chat-form-group select {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
  }

  .chat-form-actions {
    border-color: #334155;
  }

  .btn-cancel {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
  }

  .call-info h3 {
    color: #f1f5f9;
  }
}
