/* ===================================================
   WhatsApp Floating Button & Popup - Multiple Styles
   =================================================== */

/* WhatsApp Floating Button (fab1) */
.fab1 {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 998;

  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #25d366 0%, #20ba58 100%);
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  color: white;
  text-decoration: none;
  font-size: 0;

  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  cursor: pointer;
  overflow: hidden;
}

.fab1::before {
  content: "\f232";
  font-family: "Font Awesome 6 Brands";
  font-size: 28px;
  color: white;
}

.fab1:hover {
  background: linear-gradient(135deg, #20ba58 0%, #1da851 100%);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.7);
  transform: scale(1.08);
}

.fab1:active {
  transform: scale(0.95);
}

.fab1::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  transition: transform 0.5s;
}

.fab1:active::after {
  transform: scale(1.5);
  opacity: 0;
}

/* تحريك الفاب كنبضة */
@keyframes pulseGreen {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  }

  70% {
    transform: scale(1.07);
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* تطبيق الحركة على الفاب */
.fab1 {
  animation: pulseGreen 1.8s infinite;
}


/* ===================================================
   BASE POPUP STYLES
   =================================================== */

.whatsapp-popup {
    position: fixed;
    bottom: 30px;
    right: auto;
    left: 105px;
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-width: 280px;
    width: 280px;
    z-index: 999;
    display: none;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    direction: rtl;
    text-align: right;
}

/* للعربي (RTL) */
[dir="rtl"] .whatsapp-popup {
  right: 105px;
  left: auto;
}

.whatsapp-popup.show {
  display: block;
  animation: popupSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes popupSlideIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===================================================
   STYLE 2 - Modern with Header
   =================================================== */

.whatsapp-popup.style2 {
  background: white;
  padding: 0;
  overflow: hidden;
}

.whatsapp-popup.style2 .popup-header {
  background: linear-gradient(to left, #22c55e 0%, #16a34a 100%);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: white;
  border-radius: 12px 12px 0 0;
}

.whatsapp-popup.style2 .header-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.whatsapp-popup.style2 .icon-circle {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.whatsapp-popup.style2 .header-text h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: white;
  line-height: 1.3;
}

.whatsapp-popup.style2 .header-text p {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  padding: 0;
}

.whatsapp-popup.style2 .close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: white;
  font-size: 16px;
  line-height: 1;
}

.whatsapp-popup.style2 .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.whatsapp-popup.style2::before {
  display: none;
}

.whatsapp-popup.style2 .popup-body {
  padding: 16px 14px;
}

.whatsapp-popup.style2 .popup-body p {
  font-size: 13px;
  color: #333;
  margin: 0 0 12px 0;
  line-height: 1.5;
  font-weight: 400;
  padding: 0;
}

.whatsapp-popup.style2 p img.emoji {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-left: 6px;
}

.whatsapp-popup.style2 .chat-btn {
  width: 100%;
  background: linear-gradient(135deg, #25d366 0%, #20ba58 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  margin: 0;
  font-size: 13px !important;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.whatsapp-popup.style2 .chat-btn:hover {
  background: linear-gradient(135deg, #20ba58 0%, #1da851 100%);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
  transform: translateY(-2px);
}

.whatsapp-popup.style2::after {
  display: none;
}

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 768px) {

  .fab1 {
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
  }

  .fab1::before {
    font-size: 26px;
  }

  .whatsapp-popup {
    bottom: 20px;
    left: 90px;
    right: 20px;
    max-width: none;
    width: auto;
  }

  [dir="rtl"] .whatsapp-popup {
    right: 90px;
    left: 20px;
  }

 
  .whatsapp-popup.style2 .popup-header {
    padding: 8px 10px;
  }

  .whatsapp-popup.style2 .icon-circle {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .whatsapp-popup.style2 .header-text h3 {
    font-size: 11px;
  }

  .whatsapp-popup.style2 .header-text p {
    font-size: 9px;
  }

  .whatsapp-popup.style2 .popup-body {
    padding: 10px;
  }

  .whatsapp-popup.style2 .popup-body p {
    font-size: 11px;
    margin: 0 0 8px 0;
    padding: 0;
  }

  .whatsapp-popup.style2 .chat-btn {
    padding: 8px 12px;
    font-size: 11px !important;
  }


  .whatsapp-popup.style4::before {
    height: 52px;
  }

  .whatsapp-popup.style4 .popup-header {
    padding: 12px 14px;
  }

  .whatsapp-popup.style4 .emoji-circle {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .whatsapp-popup.style4 .header-text h3 {
    font-size: 12px;
  }

  .whatsapp-popup.style4 .header-text p {
    font-size: 11px;
  }

  .whatsapp-popup.style4 p {
    font-size: 12px;
    padding: 58px 14px 14px 14px;
  }

  .whatsapp-popup.style4 .chat-btn {
    width: calc(100% - 28px);
    margin: 0 14px 14px 14px;
    padding: 10px 14px;
    font-size: 12px;
  }

  .whatsapp-popup::after {
    left: 24px;
  }
}

@media (max-width: 480px) {
  .fab1 {
    bottom: 16px;
    left: 16px;
    width: 52px;
    height: 52px;
  }

  .fab1::before {
    font-size: 24px;
  }

  .whatsapp-popup {
    bottom: 16px;
    left: 82px;
    right: 16px;
    max-width: none;
    width: auto;
  }

  [dir="rtl"] .whatsapp-popup {
    right: 82px;
    left: 16px;
  }
}

/* ACCESSIBILITY */
.fab1:focus-visible,
.whatsapp-popup .chat-btn:focus-visible,
.whatsapp-popup .close-btn:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.5);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {


  .whatsapp-popup.style2
 {
    background: #1a1a1a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  }

  .whatsapp-popup p {
    color: #e0e0e0;
  }

  
  .whatsapp-popup.style2::after {
    border-top-color: #1a1a1a;
  }

  .whatsapp-popup.style2::before {
    background: linear-gradient(135deg, #1da851 0%, #1a7f47 100%);
  }

  .whatsapp-popup .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-popup {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .fab1,
  .whatsapp-popup .chat-btn {
    transition: none;
  }
}
