/**
 * Boma Fuels - Live Chat Widget Styles
 * Clean, modern chat interface
 */

.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  z-index: 9999;
}

/* Chat Toggle Button */
.chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f37020 0%, #ff6d35 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(243, 112, 32, 0.4);
  transition: all 0.3s ease;
  padding: 0;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(243, 112, 32, 0.5);
}

.chat-toggle-btn:active {
  transform: scale(0.95);
}

.chat-toggle-btn svg {
  width: 28px;
  height: 28px;
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: calc(100vh - 150px);
  max-height: 700px;
  min-height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  animation: slideUp 0.3s ease-out;
}

.chat-window.active {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #f37020 0%, #ff6d35 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  opacity: 0.9;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Messages Container */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fa;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Message Bubble */
.message-bubble {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-bubble.user {
  justify-content: flex-end;
}

.message-text {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.message-bubble.user .message-text {
  background: #f37020;
  color: white;
  border-bottom-right-radius: 4px;
}

.message-bubble.bot .message-text {
  background: white;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Message Content Styling */
.message-text strong {
  font-weight: 600;
  color: inherit;
}

.message-text a {
  color: #f37020;
  text-decoration: none;
  font-weight: 500;
}

.message-bubble.user .message-text a {
  color: white;
}

.message-text a:hover {
  text-decoration: underline;
}

/* Loading State */
.loading-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: typingAnimation 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0%, 60%, 100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* Input Area */
.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #f37020;
}

.chat-input::placeholder {
  color: #999;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f37020;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
}

.chat-send-btn:hover {
  background: #ff6d35;
}

.chat-send-btn:active {
  transform: scale(0.95);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
}

/* Error State */
.message-error {
  background: #fee !important;
  border-left: 3px solid #f44336;
}

.message-error .message-text {
  color: #d32f2f;
}

/* Welcome Message */
.welcome-bubble {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

/* Action Buttons in Message */
.message-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.action-btn {
  display: inline-block;
  padding: 10px 12px;
  background: #f37020;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.action-btn:hover {
  background: #ff6d35;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(243, 112, 32, 0.3);
}

/* Fallback Action Buttons */
.message-bubble.bot .message-actions {
  max-width: 85%;
}

.message-bubble.bot .action-btn {
  background: linear-gradient(135deg, #f37020 0%, #ff6d35 100%);
  color: white;
  border: 1px solid #f37020;
}

/* Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 120px);
    max-height: none;
    bottom: 70px;
    right: 10px;
  }

  .chat-toggle-btn {
    width: 50px;
    height: 50px;
  }

  .chat-toggle-btn svg {
    width: 24px;
    height: 24px;
  }
}
