/* Octave Resolution - Lead-First Chatbot Styles */

#octave-chatbot-lead {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Chat Button */
.chatbot-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2c7a7b 0%, #246060 100%);
  color: white;
  border: none;
  cursor: move;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(44, 122, 123, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.chatbot-button:active {
  cursor: grabbing;
}

.chatbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(44, 122, 123, 0.5);
}

.chatbot-button svg {
  width: 28px;
  height: 28px;
}

.chatbot-button .chatbot-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
}

.chatbot-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e53e3e;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
}

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

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #1a365d 0%, #2c7a7b 100%);
  color: white;
  padding: 16px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header-content h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.chatbot-header-content p {
  margin: 4px 0 0 0;
  font-size: 13px;
  opacity: 0.9;
}

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

.chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f7fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

/* Message */
.chatbot-message {
  display: flex;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

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

.bot-message {
  align-items: flex-start;
}

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

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

.message-content {
  max-width: 75%;
  background: white;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
  background: linear-gradient(135deg, #2c7a7b 0%, #246060 100%);
  color: white;
}

.message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Quick Actions */
.quick-actions-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 42px;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-action-btn {
  background: white;
  border: 2px solid #e2e8f0;
  color: #1a365d;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  border-color: #2c7a7b;
  background: #f0fdf9;
  transform: translateX(4px);
}

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

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e0;
  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;
  }
}

/* Input Area */
.chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: white;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
}

#chatbot-input-lead {
  flex: 1;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#chatbot-input-lead:focus {
  border-color: #2c7a7b;
}

.chatbot-send-btn {
  background: linear-gradient(135deg, #2c7a7b 0%, #246060 100%);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chatbot-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(44, 122, 123, 0.3);
}

.chatbot-send-btn:active {
  transform: scale(0.95);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #octave-chatbot-lead {
    bottom: 10px;
    right: 10px;
  }
  
  .chatbot-window {
    position: fixed !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 85vh !important;
    max-height: 85vh !important;
    border-radius: 16px 16px 0 0;
  }
  
  .chatbot-button {
    width: 56px;
    height: 56px;
  }
  
  .chatbot-header {
    border-radius: 16px 16px 0 0;
    padding: 14px;
  }
  
  .chatbot-header-content h3 {
    font-size: 16px;
  }
  
  .chatbot-header-content p {
    font-size: 12px;
  }
  
  .chatbot-messages {
    padding: 12px;
  }
  
  .message-content {
    max-width: 85%;
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .message-content p {
    font-size: 14px;
  }
  
  .quick-action-btn {
    font-size: 13px;
    padding: 9px 12px;
  }
  
  .chatbot-input-area {
    padding: 10px;
  }
  
  #chatbot-input-lead {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 9px 11px;
  }
  
  .chatbot-send-btn {
    width: 38px;
    height: 38px;
  }
  
  /* Ensure draggable button stays visible */
  .chatbot-button {
    z-index: 10000;
  }
  
  /* Prevent body scroll when chat is open */
  body.chatbot-open {
    overflow: hidden;
  }
}
