/* ============================================================
   Floating Contact Widget — hongmin66.com
   Shared styles for all language versions.
   ============================================================ */

/* --- Container --- */
.floating-contact {
  position: fixed;
  right: 24px;
  bottom: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* --- Toggle Button --- */
.floating-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent, #0066cc);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,102,204,0.35);
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  position: relative;
  z-index: 2;
  padding: 0;
}
.floating-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,102,204,0.5);
}
.floating-toggle.open {
  transform: rotate(45deg);
  background: #555;
}

/* --- Buttons Panel --- */
.floating-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.floating-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- Individual Chat Buttons --- */
.floating-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 50px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 14px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.floating-btn:hover {
  transform: translateX(-4px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.22);
  color: #fff;
  text-decoration: none;
}
.floating-btn .fb-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.floating-btn .fb-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.floating-btn .fb-label {
  font-size: 13px;
}

/* --- App-specific Colors --- */
.floating-btn.whatsapp { background: #25D366; }
.floating-btn.whatsapp:hover { background: #1ebe57; }
.floating-btn.wechat { background: #07C160; }
.floating-btn.wechat:hover { background: #06ad56; }
.floating-btn.telegram { background: #0088cc; }
.floating-btn.telegram:hover { background: #0077b3; }
.floating-btn.email { background: #555; }
.floating-btn.email:hover { background: #444; }

/* --- Pulse Dot --- */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.floating-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #ff3b30;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-dot 1.8s infinite;
}

/* --- WeChat QR Modal --- */
.wechat-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 99999;
  justify-content: center;
  align-items: center;
}
.wechat-modal.open {
  display: flex;
}
.wechat-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.wechat-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
}
.wechat-modal-title {
  font-weight: 700;
  margin: 0 0 6px 0;
  font-size: 17px;
  color: #1a1a2e;
}
.wechat-modal-sub {
  color: #888;
  font-size: 13px;
  margin: 0 0 16px 0;
}
.wechat-modal-qr {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  border: 1px solid #eee;
  object-fit: contain;
}
.wechat-modal-id {
  color: #07C160;
  font-size: 13px;
  margin: 12px 0 0 0;
}

/* --- RTL (Arabic) --- */
html[dir="rtl"] .floating-contact {
  right: auto;
  left: 24px;
  align-items: flex-start;
}
html[dir="rtl"] .floating-btn:hover {
  transform: translateX(4px);
}
html[dir="rtl"] .wechat-modal-close {
  right: auto;
  left: 16px;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .floating-contact {
    right: 16px;
    bottom: 24px;
    gap: 10px;
  }
  .floating-toggle {
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
  .floating-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  html[dir="rtl"] .floating-contact {
    right: auto;
    left: 16px;
  }
}
