/* ======== FLOATING BUTTON ======== */
#wa-chat-toggle {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 99999 !important;
  background-color: var(--wa-color, #25d366);
  border-radius: 50%;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.3s ease;
  transform: none !important;
  will-change: transform;
}

#wa-chat-toggle:hover {
  transform: scale(1.05);
}

.wa-icon {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s ease;
}

.wa-icon img,
.wa-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.wa-rotate {
  transform: rotate(360deg);
}

/* ======== CHAT BOX ======== */
#wa-chat-box {
  position: fixed !important;
  bottom: 90px;
  right: 20px;
  width: 333px;
  max-width: 90%;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10000;
  display: none;
  will-change: transform, opacity;
}

#wa-chat-box.wa-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  display: block;
}

/* ======== HEADER ======== */
.wa-box-header {
  padding: 15px;
  background-color: var(--wa-color, #25d366);
  color: white;
  text-align: left;
}

.wa-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.wa-box-header h3 {
  margin: 0;
  font-size: 18px;
}

.wa-box-header .wa-description {
  font-size: 13px;
  margin: 5px 0 0;
}

.wa-box-header img {
  vertical-align: middle;
}

/* ======== KONTAK LIST ======== */
.wa-box-contacts {
  padding: 10px;
  max-height: 333px;
  overflow-y: auto;
}

.wa-contact {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 1s ease forwards;
  opacity: 0;
  transition: background 0.8s ease;
}
.wa-contact:nth-child(1)  { animation-delay: 0.5s; }
.wa-contact:nth-child(2)  { animation-delay: 1.3s; }
.wa-contact:nth-child(3)  { animation-delay: 2.1s; }
.wa-contact:nth-child(4)  { animation-delay: 2.9s; }
.wa-contact:nth-child(5)  { animation-delay: 3.7s; }
.wa-contact:nth-child(6)  { animation-delay: 4.5s; }
.wa-contact:nth-child(7)  { animation-delay: 5.3s; }
.wa-contact:nth-child(8)  { animation-delay: 6.1s; }
.wa-contact:nth-child(9)  { animation-delay: 6.9s; }
.wa-contact:nth-child(10) { animation-delay: 7.7s; }
.wa-contact:nth-child(10) { animation-delay: 8.5s; }

.wa-contact-inner {
  display: flex;
  align-items: center;
}

.wa-contact-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 15px;
  border: 1px solid var(--wa-color, #25d366);
}

.wa-contact-text {
  flex-grow: 1;
}

.wa-contact-name {
  font-weight: bold;
  font-size: 15px;
}

.wa-contact-role {
  font-size: 12px;
  color: #666;
}

.wa-offline-text {
  color: #d00;
  font-size: 11px;
  margin-top: 3px;
  font-style: italic;
}

.wa-contact-icon img {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

.wa-contact.online:hover {
  background: rgba(var(--wa-color-rgb, 37,211,102), 0.1);
}

.wa-contact.offline {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(100%);
  transition: all 0.3s ease;
}

.wa-contact.offline .wa-contact-inner {
  opacity: 0.68;
  filter: grayscale(88%);
  pointer-events: none;
  user-select: none;
  font-style: italic !important;
}

.wa-contact-link {
  position: absolute;
  top: 0; left: 0;
  right: 0; bottom: 0;
  text-indent: -9999px;
  z-index: 2;
}

/* ======== FOOTER ======== */
.wa-box-footer {
  padding: 10px;
  font-size: 12px;
  text-align: center;
  background: #f0f0f0;
  color: #444;
}

/* ======== SCROLLBAR ======== */
.wa-box-contacts::-webkit-scrollbar {
  width: 6px;
}
.wa-box-contacts::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.wa-box-contacts::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 3px;
}

/* ======== ANIMASI ======== */
@keyframes fadeInUp {
  0% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes pulse-flash {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ======== STATUS DOT ======== */
.wa-contact-avatar {
  position: relative;
}

.wa-status-dot {
  position: absolute;
  top: 4px;
  right: 12px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.wa-status-dot.online {
  background-color: #25d366;
  animation: pulse-flash 1.5s infinite;
}

.wa-status-dot.offline {
  background-color: #cc0000 !important;
  filter: none !important;
}

/* ======== IKON DINAMIS ======== */
.wa-dynamic-icon {
  color: var(--wa-color, #25d366) !important;
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease, filter 0.2s ease;
  filter: brightness(0) saturate(100%) sepia(100%) hue-rotate(85deg) brightness(1.1);
}

.wa-dynamic-icon:hover {
  transform: scale(1.1);
  opacity: 1;
}

/* ======== FLOAT FIX CHROME MOBILE & THEME INHERIT ======== */
html, body {
  overflow-x: visible !important;
  position: static !important;
  transform: none !important;
}

main, section, footer, header, .site, .site-content, .page-wrap {
  overflow: visible !important;
  position: static !important;
  transform: none !important;
}

/* ======== POSISI KIRI / KANAN (Body Class Controlled) ======== */
body.wa-left #wa-chat-toggle {
  left: 20px !important;
  right: auto !important;
}

body.wa-left #wa-chat-box {
  left: 20px !important;
  right: auto !important;
}

body.wa-right #wa-chat-toggle {
  right: 20px !important;
  left: auto !important;
}

body.wa-right #wa-chat-box {
  right: 20px !important;
  left: auto !important;
}
