.whatsapp-popup {
  position: fixed;
  bottom: 150px;
  right: 20px;
  width: 360px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(30px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9999;
}

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

.popup-header {
  background: linear-gradient(to right, #6134b7, #ffa700) !important;

  padding: 20px;
  border-radius: 15px 15px 0 0;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-header-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.profile-image {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: contain;
  padding: 2px;
  border: 2px solid #fff;
  background-color: white;
}

.header-text h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.online-status {
  margin: 5px 0 0;
  font-size: 1rem;
  opacity: 0.9;
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.9rem;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.3s ease;
}

.close-btn:hover {
  transform: scale(1.1);
}

.popup-body {
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.message {
  margin-bottom: 15px;
  max-width: 85%;
}

.message.received {
  background: #f0f0f0;
  padding: 12px 15px;
  border-radius: 15px;
  margin-right: auto;
}

.message.sent {
  background: linear-gradient(to right, #6134b7, #ffa700) !important;

  color: #fff;
  padding: 12px 15px;
  border-radius: 15px;
  margin-left: auto;
}

.message-time {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 5px;
  display: block;
}

.popup-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  align-items: center;
}

#message-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 25px;
  outline: none;
  transition: border-color 0.3s ease;
}

#message-input:focus {
  border-color: #6134b7;
}

.send-btn {
  background: linear-gradient(to right, #6134b7, #ffa700) !important;

  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.send-btn:hover {
  transform: scale(1.1);
}

.whatsapp-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(to right, #6134b7, #ffa700) !important;

  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  z-index: 1;
  margin-bottom: 60px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(160, 32, 240, 0.2);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(160, 32, 240, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(160, 32, 240, 0.2);
  }
}

/* Update hover state to work with animation */
.whatsapp-trigger:hover {
  animation: none;
  transform: scale(1.15);
}

/* Add ripple effect */
.whatsapp-trigger::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(to right, #ffa700, #6134b7) !important;

  opacity: 0.4;
  z-index: -1;
  animation: ripple 1.5s infinite;
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Add prefers-reduced-motion support */
@media (prefers-reduced-motion: reduce) {
  .whatsapp-trigger {
    animation: none;
  }

  .whatsapp-trigger::after {
    animation: none;
    display: none;
  }
}

.trigger-content {
  position: relative;
}

.fa-whatsapp {
  font-size: 2rem;
  color: #fff;
}

.notification-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff4444;
  color: white;
  font-size: 12px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Tablet Devices */
@media (max-width: 768px) {
  .whatsapp-popup {
    width: 320px;
    right: 15px;
    bottom: 120px;
  }

  .header-text h3 {
    font-size: 1.2rem;
  }

  .online-status {
    font-size: 0.9rem;
  }

  .popup-body {
    max-height: 280px;
  }

  .message {
    max-width: 90%;
  }

  .whatsapp-trigger {
    width: 55px;
    height: 55px;
    margin-bottom: 50px;
  }

  .fa-whatsapp {
    font-size: 1.8rem;
  }
}

/* Mobile Devices */
@media (max-width: 480px) {
  .whatsapp-popup {
    width: 90%;
    right: 5%;
    left: 5%;
    bottom: 140px;
  }

  .popup-header {
    padding: 15px;
  }

  .profile-image {
    width: 40px;
    height: 40px;
  }

  .header-text h3 {
    font-size: 1.1rem;
  }

  .online-status {
    font-size: 0.8rem;
  }

  .popup-body {
    max-height: 250px;
    padding: 15px;
  }

  .message {
    max-width: 95%;
    font-size: 0.9rem;
  }

  .message-time {
    font-size: 0.65rem;
  }

  .popup-footer {
    padding: 12px 15px;
  }

  #message-input {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .send-btn {
    width: 35px;
    height: 35px;
  }

  .whatsapp-trigger {
    width: 50px;
    height: 50px;
    right: 20px;
    bottom: 15px;
    margin-bottom: 60px;
  }

  .fa-whatsapp {
    font-size: 1.6rem;
  }

  .notification-badge {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }
}

/* Small Mobile Devices */
@media (max-width: 360px) {
  .whatsapp-popup {
    width: 95%;
    bottom: 130px;
    left: 2.5%;
    right: 2.5%;
  }

  .popup-header {
    padding: 12px;
  }

  .profile-image {
    width: 35px;
    height: 35px;
  }

  .header-text h3 {
    font-size: 1rem;
  }

  .online-status {
    font-size: 0.75rem;
  }

  .message {
    padding: 10px 12px;
  }

  .whatsapp-trigger {
    width: 45px;
    height: 45px;
    margin-bottom: 55px;
  }
}

/* Landscape Mode */
@media (max-height: 480px) and (orientation: landscape) {
  .whatsapp-popup {
    width: 360px;
    height: 80vh;
    bottom: 85px;
  }

  .popup-body {
    max-height: calc(80vh - 140px);
  }

  .whatsapp-trigger {
    bottom: 10px;
    margin-bottom: 30px;
  }
}

/* High-DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .profile-image {
    border-width: 1.5px;
  }

  .notification-badge {
    border-width: 1.5px;
  }
}

/* Handle Notch Devices */
@supports (padding: max(0px)) {
  .whatsapp-popup {
    padding-bottom: max(15px, env(safe-area-inset-bottom));
  }

  .whatsapp-trigger {
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}
