/* WhatsApp Widget Styles - Advanced UI */
.whatsapp-widget {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
  font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif;
  direction: rtl;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Main WhatsApp Button */
.whatsapp-button {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    transform: scale(1);
  }
}

.whatsapp-button:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.whatsapp-icon {
  width: 35px;
  height: 35px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* Welcome Tooltip */
.welcome-tooltip {
  position: absolute;
  bottom: 80px;
  right: 0;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  min-width: 300px;
  max-width: 300px;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  border-right: 4px solid #25D366;
  display: flex;
  align-items: center;
}

.welcome-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: bounce 0.6s;
}

.welcome-tooltip-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-left: 12px;
  object-fit: cover;
  border: 2px solid #25D366;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
  40% {transform: translateY(-10px);}
  60% {transform: translateY(-5px);}
}

.welcome-tooltip:after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 25px;
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: #f5f5f5 transparent transparent;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.05));
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 85px;
  right: 0;
  width: 320px;
  background-color: #F7F7F7;
  border-radius: 15px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: none;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform: scale(0.8);
  transform-origin: bottom right;
  opacity: 0;
  max-height: 570px;
}

.chat-window.open {
  display: block;
  opacity: 1;
  transform: scale(1);
  animation: slideIn 0.4s forwards;
}

@keyframes slideIn {
  from {
    transform: translateY(20px) scale(0.8);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.chat-header {
  background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
  color: white;
  padding: 15px 11px;
  display: flex;
  align-items: center;
  position: relative;
}

.chat-header img {
  width: 60px;
  height: 60px;
  margin-left: 11px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-header-text h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
}

.chat-header-text p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

.online-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #4CAF50;
  border-radius: 50%;
  margin-left: 5px;
  position: relative;
}

.online-indicator:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #4CAF50;
  opacity: 0.5;
  animation: pulse-online 1.5s infinite;
}

@keyframes pulse-online {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  70% {
    transform: scale(1.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.chat-body {
  padding: 20px;
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAFKADAAQAAAABAAAAFAAAAACRFdLHAAAAJklEQVQ4EWNgGAWjYBSMglEwCkbBKBgFo2AUjIJRMApGAT0BAAeQAAFB0QIRAAAAAElFTkSuQmCC');
  background-repeat: repeat;
  min-height: 180px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #bbb transparent;
}

.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.chat-message {
  background-color: white;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 15px;
  max-width: 90%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  position: relative;
  border-top-right-radius: 2px;
  animation: messageAppear 0.3s forwards;
}

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

/* شماره تماس در پنل گفتگو */
.contact-number {
  background-color: #eeffe4;
  padding:0;
  border-radius: 10px;
  text-align: center;
  margin: 15px 0;
  border: 1px dashed #25D366;
  animation: highlightNumber 2s infinite;
  direction: ltr;
}

@keyframes highlightNumber {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.3);
  }
  50% {
    box-shadow: 0 0 10px 0 rgba(37, 211, 102, 0.5);
  }
}

.contact-number-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #075E54;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  direction: ltr;
}

.contact-number-link:hover {
  color: #128C7E;
  transform: scale(1.05);
}

.whatsapp-mini-icon {
  width: 40px;
  height: 40px;
  margin-left: -5px;
  vertical-align: middle;
  display: inline-block;
}

.contact-number-text {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #075E54;
  font-weight: 600;
  font-size: 16px;
  padding: 0;
  /* background-color: rgba(37, 211, 102, 0.1); */
  border-radius: 8px;
  margin: 0;
  text-align: center;
}

.chat-footer {
  padding: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background-color: white;
}

.whatsapp-link {
  display: block;
  background-color: #25D366;
  color: white;
  text-align: center;
  padding: 12px 15px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 10px;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.2);
}

.whatsapp-link:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  top: 0;
  right: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.whatsapp-link:hover:before {
  transform: translateX(0);
}

.whatsapp-link:hover {
  background-color: #128C7E;
  color: white;
  box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
  transform: translateY(-2px);
}

.whatsapp-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(37, 211, 102, 0.2);
}

.close-chat {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  transform-origin: center;
}

.close-chat:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background-color: #ff4c4c;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 3px 5px rgba(255, 76, 76, 0.3);
  animation: badgePulse 1.5s infinite;
}

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

.cta-note {
  font-size: 11px;
  color: #666;
  text-align: center;
  margin-bottom: 15px;
  line-height: 1.5;
}

.cta-note strong {
  color: #128C7E;
}

.guarantee-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #128C7E;
  font-size: 12px;
  margin-top: 5px;
  opacity: 0.8;
}

.guarantee-tag svg {
  width: 15px;
  height: 15px;
  margin-left: 5px;
  color: #25D366;
}

@media (max-width: 480px) {
  .chat-window {
    width: 80vw;
    right: 10px;
    left: 10vw;
    bottom: 80px;
    max-width: none;
  }

  .welcome-tooltip {
    width: 80vw;

    min-width: unset;
    max-width: unset;
    box-sizing: border-box;
  }

  .chat-header img {
    width: 50px;
    height: 50px;
  }

  .chat-header-text h4 {
    font-size: 16px;
  }

  .chat-header-text p {
    font-size: 11px;
  }
}
