/* WhatsApp Chatbot Widget Styles */

/* Floating WhatsApp Button */
.whatsapp-chatbot-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

.whatsapp-chatbot-button:hover {
  background-color: #20BA5A;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.whatsapp-chatbot-button i {
  color: white;
  font-size: 32px;
}

/* Chat Modal */
.whatsapp-chatbot-modal {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  flex-direction: column;
  overflow: hidden;
}

.whatsapp-chatbot-modal.open {
  display: flex;
}

/* Chat Header */
.whatsapp-chatbot-header {
  background-color: #25D366;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px 10px 0 0;
}

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

.whatsapp-chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.whatsapp-chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Content Wrapper */
.whatsapp-chatbot-content-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar de Conversas */
.whatsapp-chatbot-sidebar {
  width: 200px;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease;
}

.whatsapp-chatbot-sidebar.minimized {
  width: 50px;
}

.whatsapp-chatbot-sidebar.minimized .whatsapp-chatbot-sidebar-header {
  padding: 10px 5px;
}

.whatsapp-chatbot-sidebar.minimized .whatsapp-chatbot-new-conversation,
.whatsapp-chatbot-sidebar.minimized .whatsapp-chatbot-conversations-list {
  display: none;
}

.whatsapp-chatbot-sidebar-header {
  padding: 10px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.whatsapp-chatbot-toggle-sidebar {
  background-color: #e9ecef;
  color: #495057;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 12px;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.whatsapp-chatbot-toggle-sidebar:hover {
  background-color: #dee2e6;
}

.whatsapp-chatbot-sidebar.minimized .whatsapp-chatbot-toggle-sidebar {
  width: 100%;
  justify-content: center;
}

.whatsapp-chatbot-new-conversation {
  flex: 1;
  padding: 8px 12px;
  background-color: #25D366;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.whatsapp-chatbot-new-conversation:hover {
  background-color: #20BA5A;
}

.whatsapp-chatbot-new-conversation i {
  font-size: 10px;
}

.whatsapp-chatbot-conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.whatsapp-chatbot-conversation-item {
  padding: 10px;
  margin-bottom: 4px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
  font-size: 12px;
}

.whatsapp-chatbot-conversation-item:hover {
  background-color: #e9ecef;
}

.whatsapp-chatbot-conversation-item.active {
  background-color: #d4edda;
  font-weight: bold;
}

.whatsapp-chatbot-conversation-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #333;
}

.whatsapp-chatbot-conversation-delete {
  color: #dc3545;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  font-size: 10px;
  margin-left: 8px;
}

.whatsapp-chatbot-conversation-delete:hover {
  opacity: 1;
}

/* Chat Messages Area */
.whatsapp-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.whatsapp-chatbot-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeIn 0.3s ease;
}

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

.whatsapp-chatbot-message.user {
  align-self: flex-end;
}

.whatsapp-chatbot-message.bot {
  align-self: flex-start;
}

.whatsapp-chatbot-message-content {
  padding: 10px 14px;
  border-radius: 8px;
  word-wrap: break-word;
  line-height: 1.4;
}

.whatsapp-chatbot-message.user .whatsapp-chatbot-message-content {
  background-color: #DCF8C6;
  border-bottom-right-radius: 2px;
}

.whatsapp-chatbot-message.bot .whatsapp-chatbot-message-content {
  background-color: white;
  border-bottom-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.whatsapp-chatbot-message-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  padding: 0 4px;
}

.whatsapp-chatbot-message.user .whatsapp-chatbot-message-time {
  text-align: right;
}

.whatsapp-chatbot-message.bot .whatsapp-chatbot-message-time {
  text-align: left;
}

/* Loading Indicator */
.whatsapp-chatbot-loading {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background-color: white;
  border-radius: 8px;
  align-self: flex-start;
}

.whatsapp-chatbot-loading span {
  width: 8px;
  height: 8px;
  background-color: #999;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.whatsapp-chatbot-loading span:nth-child(1) {
  animation-delay: -0.32s;
}

.whatsapp-chatbot-loading span:nth-child(2) {
  animation-delay: -0.16s;
}

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

/* Chat Input Area */
.whatsapp-chatbot-input-area {
  padding: 15px;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.whatsapp-chatbot-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.whatsapp-chatbot-input:focus {
  border-color: #25D366;
}

.whatsapp-chatbot-send {
  background-color: #25D366;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
  padding: 0;
}

.whatsapp-chatbot-send:hover {
  background-color: #20BA5A;
}

.whatsapp-chatbot-send:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.whatsapp-chatbot-send i {
  font-size: 18px;
}

/* Welcome Message */
.whatsapp-chatbot-welcome {
  text-align: center;
  color: #666;
  padding: 20px;
  font-size: 14px;
}

/* Error Message */
.whatsapp-chatbot-error {
  background-color: #ffebee;
  color: #c62828;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin: 10px 20px;
}

/* Modal de Confirmação */
.whatsapp-chatbot-confirm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 20000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.whatsapp-chatbot-confirm-modal.show {
  display: flex;
  opacity: 1;
}

.whatsapp-chatbot-confirm-content {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.whatsapp-chatbot-confirm-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
}

.whatsapp-chatbot-confirm-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.whatsapp-chatbot-confirm-header i {
  font-size: 20px;
}

.whatsapp-chatbot-confirm-body {
  padding: 24px;
}

.whatsapp-chatbot-confirm-body p {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: #333;
  line-height: 1.5;
}

.whatsapp-chatbot-confirm-warning {
  color: #dc3545;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px !important;
}

.whatsapp-chatbot-confirm-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background-color: #f8f9fa;
}

.whatsapp-chatbot-confirm-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.whatsapp-chatbot-confirm-cancel {
  background-color: #6c757d;
  color: white;
}

.whatsapp-chatbot-confirm-cancel:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.whatsapp-chatbot-confirm-delete {
  background-color: #dc3545;
  color: white;
}

.whatsapp-chatbot-confirm-delete:hover {
  background-color: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.whatsapp-chatbot-confirm-btn:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
  .whatsapp-chatbot-modal {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 80px;
    height: calc(100vh - 100px);
  }
  
  .whatsapp-chatbot-sidebar {
    width: 150px;
  }
  
  .whatsapp-chatbot-conversation-title {
    font-size: 10px;
  }
  
  .whatsapp-chatbot-button {
    bottom: 15px;
    right: 15px;
    width: 56px;
    height: 56px;
  }
  
  .whatsapp-chatbot-button i {
    font-size: 28px;
  }
}
