/**
 * WhatsApp Chat Widget - Frontend CSS
 */

.wcw-widget-container {
  position: fixed;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.wcw-position-bottom-right {
  right: 24px;
  bottom: 24px;
}

.wcw-position-bottom-left {
  left: 24px;
  bottom: 24px;
}

/* Toggle Button */
.wcw-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #25D366;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.wcw-toggle-btn:hover {
  background-color: #128C7E;
  transform: scale(1.05);
}

.wcw-toggle-icon {
  width: 28px;
  height: 28px;
  color: #fff;
  display: inline-block;
}

.wcw-icon {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 28px;
}

.wcw-icon:before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background-color: #fff;
  border-radius: 50%;
}

.wcw-icon:after {
  content: '';
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 39 39'%3E%3Cpath fill='%2325D366' d='M10.7 32.8l.6.3c2.5 1.5 5.3 2.2 8.1 2.2 8.8 0 16-7.2 16-16 0-4.2-1.7-8.3-4.7-11.3s-7-4.7-11.3-4.7c-8.8 0-16 7.2-15.9 16.1 0 3 .9 5.9 2.4 8.4l.4.6-1.6 5.9 6-1.5z'%3E%3C/path%3E%3Cpath fill='%23FFF' d='M32.4 6.4C29 2.9 24.3 1 19.5 1 9.3 1 1.1 9.3 1.2 19.4c0 3.2.9 6.3 2.4 9.1L1 38l9.7-2.5c2.7 1.5 5.7 2.2 8.7 2.2 10.1 0 18.3-8.3 18.3-18.4 0-4.9-1.9-9.5-5.3-12.9zM19.5 34.6c-2.7 0-5.4-.7-7.7-2.1l-.6-.3-5.8 1.5L6.9 28l-.4-.6c-4.4-7.1-2.3-16.5 4.9-20.9s16.5-2.3 20.9 4.9 2.3 16.5-4.9 20.9c-2.3 1.5-5.1 2.3-7.9 2.3zm8.8-11.1l-1.1-.5s-1.6-.7-2.6-1.2c-.1 0-.2-.1-.3-.1-.3 0-.5.1-.7.2 0 0-.1.1-1.5 1.7-.1.2-.3.3-.5.3h-.1c-.1 0-.3-.1-.4-.2l-.5-.2c-1.1-.5-2.1-1.1-2.9-1.9-.2-.2-.5-.4-.7-.6-.7-.7-1.4-1.5-1.9-2.4l-.1-.2c-.1-.1-.1-.2-.2-.4 0-.2 0-.4.1-.5 0 0 .4-.5.7-.8.2-.2.3-.5.5-.7.2-.3.3-.7.2-1-.1-.5-1.3-3.2-1.6-3.8-.2-.3-.4-.4-.7-.5h-1.1c-.2 0-.4.1-.6.1l-.1.1c-.2.1-.4.3-.6.4-.2.2-.3.4-.5.6-.7.9-1.1 2-1.1 3.1 0 .8.2 1.6.5 2.3l.1.3c.9 1.9 2.1 3.6 3.7 5.1l.4.4c.3.3.6.5.8.8 2.1 1.8 4.5 3.1 7.2 3.8.3.1.7.1 1 .2h1c.5 0 1.1-.2 1.5-.4.3-.2.5-.2.7-.4l.2-.2c.2-.2.4-.3.6-.5s.4-.4.5-.6c.2-.4.3-.9.4-1.4v-.7s-.1-.1-.3-.2z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.wcw-whatsapp-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  margin-right: 8px;
  position: relative;
}

.wcw-whatsapp-icon:before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 39 39'%3E%3Cpath fill='%23FFF' d='M10.7 32.8l.6.3c2.5 1.5 5.3 2.2 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1-.1-.3-.2z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Chat Box */
.wcw-chat-box {
  width: 300px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
  animation: wcw-fade-in 0.3s ease forwards;
}

@keyframes wcw-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.wcw-chat-header {
  background-color: #25D366;
  padding: 12px 16px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wcw-chat-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wcw-chat-avatar {
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wcw-avatar-icon {
  width: 20px;
  height: 20px;
}

.wcw-chat-user-info {
  display: flex;
  flex-direction: column;
}

.wcw-business-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.wcw-chat-status {
  display: flex;
  align-items: center;
  font-size: 12px;
  gap: 4px;
}

.wcw-status-indicator {
  width: 8px;
  height: 8px;
  background-color: #c8e6c9;
  border-radius: 50%;
}

.wcw-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.wcw-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.wcw-close-icon {
  width: 20px;
  height: 20px;
}

/* Chat Body */
.wcw-chat-body {
  padding: 16px;
  background-color: #f5f5f5;
  min-height: 100px;
  max-height: 250px;
  overflow-y: auto;
}

.wcw-chat-message {
  background-color: #fff;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  color: #333;
}

.wcw-chat-message p {
  margin: 0 0 8px 0;
}

.wcw-chat-message p:last-child {
  margin-bottom: 0;
}

/* Chat Footer */
.wcw-chat-footer {
  padding: 12px;
  border-top: 1px solid #e0e0e0;
  background-color: #fff;
}

.wcw-start-chat-btn {
  width: 100%;
  padding: 10px;
  background-color: #25D366;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.3s ease;
}

.wcw-start-chat-btn:hover {
  background-color: #128C7E;
}

.wcw-whatsapp-icon {
  width: 18px;
  height: 18px;
}

/* Dark Theme */
.wcw-widget-container.dark-theme .wcw-chat-box {
  background-color: #1e1e1e;
  border: 1px solid #333;
}

.wcw-widget-container.dark-theme .wcw-chat-body {
  background-color: #262626;
}

.wcw-widget-container.dark-theme .wcw-chat-message {
  background-color: #333;
  color: #e0e0e0;
}

.wcw-widget-container.dark-theme .wcw-chat-footer {
  background-color: #1e1e1e;
  border-top-color: #333;
}

/* Responsive */
@media screen and (max-width: 480px) {
  .wcw-chat-box {
    width: 280px;
  }
  
  .wcw-position-bottom-right,
  .wcw-position-bottom-left {
    bottom: 12px;
  }
  
  .wcw-position-bottom-right {
    right: 12px;
  }
  
  .wcw-position-bottom-left {
    left: 12px;
  }
}