/* WhatsApp Widget Styles */
#whatsapp-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Toggle Button */
.whatsapp-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.whatsapp-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

.whatsapp-toggle.hidden {
  display: none;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.8);
  }
}

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

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

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

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

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

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

.whatsapp-status {
  margin: 0;
  font-size: 12px;
  opacity: 0.9;
}

.whatsapp-minimize {
  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 0.2s;
}

.whatsapp-minimize:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

.whatsapp-message {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 8px;
  word-wrap: break-word;
  animation: slideIn 0.3s ease;
}

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

.whatsapp-message.user {
  background: #DCF8C6;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.whatsapp-message.bot {
  background: white;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

/* Quick Options */
.whatsapp-quick-options {
  padding: 12px 20px;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.whatsapp-quick-btn {
  padding: 8px 12px;
  background: #F0F0F0;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
}

.whatsapp-quick-btn:hover {
  background: #25D366;
  color: white;
}

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

#whatsapp-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  color: #333;
  background: white;
}

#whatsapp-input::placeholder {
  color: #999;
}

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

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

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

/* Transfer Button */
.whatsapp-transfer {
  padding: 12px 20px;
  background: #F8F8F8;
  border-top: 1px solid #e0e0e0;
}

.whatsapp-transfer-btn {
  width: 100%;
  padding: 12px;
  background: #25D366;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.whatsapp-transfer-btn:hover {
  background: #20BA5A;
}

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

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

.whatsapp-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.whatsapp-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
  .whatsapp-chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    bottom: 70px;
    right: 10px;
    border-radius: 20px 20px 0 0;
  }

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