/* Enhanced WhatsApp Chat Feature for CheapOTT */

.whatsapp-floating {
  position: fixed;
  bottom: 25px;
  left: 25px;
  z-index: 1000;
}

/* Main WhatsApp button */
.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #25D366;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  position: relative;
  z-index: 2;
}

.whatsapp-btn i {
  font-size: 30px;
  color: white;
}

/* Pulse animation for the button */
.whatsapp-btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #25D366;
  z-index: -1;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* Expanded chat window */
.whatsapp-popup {
  position: absolute;
  bottom: 80px;
  left: 0;
  width: 300px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow: hidden;
}

.whatsapp-floating.active .whatsapp-popup {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Chat header */
.whatsapp-header {
  background-color: #075E54;
  color: white;
  padding: 15px;
  display: flex;
  align-items: center;
}

.whatsapp-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
}

.whatsapp-header-info h4 {
  margin: 0;
  font-size: 16px;
}

.whatsapp-header-info p {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

.whatsapp-close {
  margin-left: auto;
  cursor: pointer;
  font-size: 18px;
}

/* Chat body */
.whatsapp-body {
  padding: 15px;
  max-height: 200px;
  overflow-y: auto;
  background-color: #E5DDD5;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23bbb' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.whatsapp-message {
  background-color: white;
  padding: 10px 15px;
  border-radius: 7px;
  margin-bottom: 10px;
  position: relative;
  max-width: 80%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation: messageIn 0.3s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes messageIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.whatsapp-message::after {
  content: '';
  position: absolute;
  top: 0;
  left: -10px;
  width: 0;
  height: 0;
  border-top: 10px solid white;
  border-left: 10px solid transparent;
}

.whatsapp-message.user {
  background-color: #DCF8C6;
  margin-left: auto;
}

.whatsapp-message.user::after {
  left: auto;
  right: -10px;
  border-top: 10px solid #DCF8C6;
  border-left: none;
  border-right: 10px solid transparent;
}

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

.whatsapp-message .time {
  font-size: 11px;
  color: #999;
  text-align: right;
  margin-top: 5px;
}

/* Chat footer */
.whatsapp-footer {
  padding: 10px 15px;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
}

.whatsapp-input {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 20px;
  background-color: white;
  font-size: 14px;
  outline: none;
}

.whatsapp-send {
  background-color: #25D366;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.whatsapp-send:hover {
  background-color: #128C7E;
}

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

/* Quick action buttons */
.whatsapp-actions {
  position: absolute;
  bottom: 70px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.whatsapp-floating:hover .whatsapp-actions {
  opacity: 1;
  visibility: visible;
}

.whatsapp-action {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  transform: translateY(10px);
  opacity: 0;
}

.whatsapp-floating:hover .whatsapp-action {
  transform: translateY(0);
  opacity: 1;
}

.whatsapp-action:nth-child(1) {
  transition-delay: 0.1s;
}

.whatsapp-action:nth-child(2) {
  transition-delay: 0.2s;
}

.whatsapp-action:nth-child(3) {
  transition-delay: 0.3s;
}

.whatsapp-action i {
  font-size: 18px;
  color: #075E54;
}

.whatsapp-action:hover {
  transform: scale(1.1);
}

/* Tooltip */
.whatsapp-tooltip {
  position: absolute;
  left: 60px;
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.whatsapp-action:hover .whatsapp-tooltip,
.whatsapp-btn:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
}

.whatsapp-tooltip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 5px solid #333;
}

/* Mobile styles */
@media (max-width: 768px) {
  .whatsapp-floating {
    bottom: 20px;
    left: 20px;
  }
  
  .whatsapp-btn {
    width: 55px;
    height: 55px;
  }
  
  .whatsapp-popup {
    width: 280px;
    bottom: 70px;
  }
  
  .whatsapp-actions {
    display: none;
  }
}

@media (max-width: 480px) {
  .whatsapp-floating {
    bottom: 15px;
    left: 15px;
  }
  
  .whatsapp-btn {
    width: 50px;
    height: 50px;
  }
  
  .whatsapp-btn i {
    font-size: 24px;
  }
  
  .whatsapp-popup {
    width: 260px;
    left: 0;
  }
  
  .whatsapp-header img {
    width: 35px;
    height: 35px;
  }
}

/* Dark mode support */
body.dark-mode .whatsapp-popup {
  background-color: #222;
}

body.dark-mode .whatsapp-header {
  background-color: #1F2C34;
}

body.dark-mode .whatsapp-body {
  background-color: #0B141A;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23333' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

body.dark-mode .whatsapp-message {
  background-color: #2A3942;
  color: #E9EDEF;
}

body.dark-mode .whatsapp-message::after {
  border-top-color: #2A3942;
}

body.dark-mode .whatsapp-message.user {
  background-color: #005C4B;
}

body.dark-mode .whatsapp-message.user::after {
  border-top-color: #005C4B;
}

body.dark-mode .whatsapp-message .time {
  color: #8696A0;
}

body.dark-mode .whatsapp-footer {
  background-color: #1F2C34;
}

body.dark-mode .whatsapp-input {
  background-color: #2A3942;
  color: #E9EDEF;
}

body.dark-mode .whatsapp-action {
  background-color: #2A3942;
}

body.dark-mode .whatsapp-action i {
  color: #E9EDEF;
}
