/* ── css/wa-widget.css ── */
/* Styling untuk WhatsApp Floating Widget PGC */

/* 1. Floating Button */
.wa-float-btn {
  position: fixed;
  bottom: calc(36px + env(safe-area-inset-bottom, 0px) + 20px); /* Di atas PGC global footer */
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9980;
  transition: transform 0.3s ease, background-color 0.3s;
}

.wa-float-btn:hover {
  background-color: #128c7e;
  transform: scale(1.05);
}

.wa-float-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

/* Pulse Animation */
.wa-pulse {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  animation: waPulseAnim 2s infinite;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  z-index: -1;
}

@keyframes waPulseAnim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* 2. Chat Box Popup (Glassmorphic) */
.wa-chat-box {
  position: fixed;
  bottom: calc(36px + env(safe-area-inset-bottom, 0px) + 90px);
  right: 20px;
  width: 350px;
  background: rgba(25, 26, 31, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(69, 243, 255, 0.1);
  z-index: 9980;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  
  /* Hidden by default with transition */
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-chat-box.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Header */
.wa-chat-header {
  background: rgba(11, 12, 16, 0.8);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative;
}

.wa-admin-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 15px;
  border: 2px solid #25d366;
}

.wa-admin-info {
  display: flex;
  flex-direction: column;
}

.wa-admin-name {
  font-family: 'Outfit', sans-serif;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
}

.wa-admin-status {
  color: #a0a0a0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.wa-status-dot {
  width: 8px;
  height: 8px;
  background-color: #25d366;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  animation: blink 2s infinite;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.wa-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #a0a0a0;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s;
}
.wa-close-btn:hover { color: #fff; }

/* Body */
.wa-chat-body {
  padding: 20px;
  flex: 1;
  background: linear-gradient(180deg, rgba(25, 26, 31, 0) 0%, rgba(11, 12, 16, 0.5) 100%);
  display: flex;
  flex-direction: column;
}

.wa-chat-welcome {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 12px 15px;
  border-radius: 12px;
  border-top-left-radius: 0;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
  font-family: 'Inter', sans-serif;
}

.wa-pills-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-pill {
  background: rgba(69, 243, 255, 0.1);
  border: 1px solid rgba(69, 243, 255, 0.3);
  color: #45f3ff;
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.wa-pill:hover, .wa-pill.active {
  background: rgba(69, 243, 255, 0.2);
  transform: translateX(5px);
}

.wa-selected-answer {
  margin-top: 15px;
  padding: 12px 15px;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: 12px;
  border-bottom-right-radius: 0;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  align-self: flex-end;
  display: none;
  font-family: 'Inter', sans-serif;
  animation: waFadeIn 0.3s ease;
}

@keyframes waFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom Input */
.wa-input-wrapper {
  margin-top: 15px;
  animation: waFadeIn 0.3s ease;
}

.wa-custom-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 12px 15px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.wa-custom-input:focus {
  border-color: #25d366;
  background: rgba(37, 211, 102, 0.05);
}

.wa-custom-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Footer */
.wa-chat-footer {
  padding: 15px 20px;
  background: rgba(11, 12, 16, 0.9);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.wa-send-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.3s;
  pointer-events: none; /* Disabled until a pill is clicked */
  opacity: 0.5;
}

.wa-send-btn.active {
  pointer-events: auto;
  opacity: 1;
}

.wa-send-btn.active:hover {
  background: #128c7e;
}

/* Responsive Mobile */
@media (max-width: 480px) {
  .wa-chat-box {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
    bottom: calc(36px + env(safe-area-inset-bottom, 0px) + 90px);
  }
}
