/* Main WhatsApp Button */
.whatsapp-container {
  position: fixed;
  bottom: clamp(15px, 4vw, 30px);
  left: clamp(15px, 4vw, 30px);
  z-index: 1000;
}

.whatsapp-container .whatsapp-btn {
  position: relative;
  width: clamp(55px, 10vw, 70px);
  height: clamp(55px, 10vw, 70px);
  border-radius: 50%;
  background: linear-gradient(145deg, #2edc72, #25D366);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 230, 118, 0.4),
              0 0 0 5px rgba(37, 211, 102, 0.05),
              0 0 20px rgba(37, 211, 102, 0.2) inset;
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
}

/* Pulsing Ring Animation */
.whatsapp-container .ring {
  position: absolute;
  width: 150%;
  height: 150%;
  border-radius: 50%;
  border: 3px solid rgba(37, 211, 102, 0.3);
  animation: ring-pulse 2s infinite;
  pointer-events: none;
}

.whatsapp-container .ring:nth-child(2) {
  animation-delay: 0.5s;
}

@keyframes ring-pulse {
  0% {
      transform: scale(0.8);
      opacity: 0.8;
  }
  100% {
      transform: scale(1.5);
      opacity: 0;
  }
}

/* Icon Styling */
.whatsapp-container .whatsapp-btn i {
  font-size: clamp(30px, 5vw, 38px);
  color: white;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
  transition: transform 0.4s ease;
}

/* Hover Effects */
@media (hover: hover) {
  .whatsapp-container .whatsapp-btn:hover {
      transform: scale(1.05) translateY(-5px);
      box-shadow: 0 15px 35px rgba(0, 230, 118, 0.5),
                  0 0 0 8px rgba(37, 211, 102, 0.1),
                  0 0 30px rgba(37, 211, 102, 0.3) inset;
  }

  .whatsapp-container .whatsapp-btn:hover i {
      transform: scale(1.1);
  }
  
  .whatsapp-container:hover .whatsapp-card {
      transform: translateY(0) scale(1);
      opacity: 1;
      pointer-events: all;
  }
  
  .whatsapp-container .cta-button:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
  }

  .whatsapp-container .cta-button:hover::before {
      left: 100%;
  }
}

/* Active state for touch devices */
.whatsapp-container .whatsapp-btn:active {
  transform: scale(0.95);
  box-shadow: 0 5px 15px rgba(0, 230, 118, 0.3);
}

/* Expandable Card */
.whatsapp-container .whatsapp-card {
  position: absolute;
  bottom: calc(100% + 15px);
  left: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  width: clamp(260px, 80vw, 300px);
  padding: clamp(15px, 4vw, 20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.whatsapp-container .whatsapp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), transparent);
  z-index: -1;
}

.whatsapp-container .card-header {
  display: flex;
  align-items: center;
  margin-bottom: clamp(10px, 3vw, 15px);
}

.whatsapp-container .card-header .logo {
  width: clamp(40px, 8vw, 45px);
  height: clamp(40px, 8vw, 45px);
  background: linear-gradient(135deg, #25D366, #128C7E);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 15px;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.whatsapp-container .card-header .logo i {
  font-size: clamp(22px, 4vw, 26px);
  color: white;
}

.whatsapp-container .card-header .title {
  flex: 1;
}

.whatsapp-container .card-header h3 {
  margin: 0 0 5px;
  font-size: clamp(16px, 3vw, 18px);
  font-weight: 600;
  background: linear-gradient(90deg, #fff, #dedede);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.whatsapp-container .card-header p {
  margin: 0;
  font-size: clamp(12px, 2vw, 13px);
  color: #aaa;
}

.whatsapp-container .card-body {
  margin-bottom: clamp(15px, 4vw, 20px);
}

.whatsapp-container .card-body p {
  margin: 0;
  font-size: clamp(13px, 2.5vw, 14px);
  line-height: 1.5;
  color: #ddd;
}

.whatsapp-container .timeframe {
  font-size: clamp(11px, 2vw, 12px);
  color: #00E676;
  font-weight: 500;
  margin-bottom: clamp(12px, 3vw, 15px);
  display: flex;
  align-items: center;
}

.whatsapp-container .timeframe i {
  margin-right: 5px;
}

.whatsapp-container .cta-button {
  width: 100%;
  background: linear-gradient(135deg, #25D366, #128C7E);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: clamp(14px, 2.5vw, 15px);
  font-weight: 600;
  padding: clamp(10px, 3vw, 12px);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
  position: relative;
  overflow: hidden;
}

.whatsapp-container .cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: all 0.5s ease;
}

.whatsapp-container .cta-button i {
  margin-right: 8px;
}

/* Shimmer Animation */
.whatsapp-container .shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
  transform: skewX(-20deg);
}

@keyframes shimmer {
  0% {
      transform: translateX(-150%) skewX(-20deg);
  }
  100% {
      transform: translateX(150%) skewX(-20deg);
  }
}

/* Better Mobile Optimization */
@media (max-width: 480px) {
  .whatsapp-container .whatsapp-card {
      width: 230px;
      left: 0;
      right: auto;
  }
  
  /* Handle edge case when card would overflow screen */
  @media (max-width: 280px) {
      .whatsapp-container .whatsapp-card {
          left: -20px;
      }
  }
  
  .whatsapp-container .card-body p {
      font-size: 13px;
  }
  
  .whatsapp-container.show-card .whatsapp-card {
      transform: translateY(0) scale(1);
      opacity: 1;
      pointer-events: all;
  }
}

/* For tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .whatsapp-container .whatsapp-card {
      width: 260px;
  }
}

/* Full media query fix for iOS Safari */
@media (hover: none) {
  .whatsapp-container .whatsapp-btn:active {
      transform: scale(0.95);
  }
}