/* ============================================================
   WhatsApp PRO — Frontend Styles
   ============================================================ */

:root {
  --wapro-color: #25D366;
  --wapro-size: 60px;
  --wapro-shadow: 0 4px 20px rgba(0, 0, 0, .25);
  --wapro-radius: 50%;
  --wapro-z: 99999;
  --wapro-transition: 0.3s cubic-bezier(.175, .885, .32, 1.275);
  --wapro-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Widget container ── */
.wapro-widget {
  position: fixed;
  bottom: 20px;
  z-index: var(--wapro-z);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: var(--wapro-font);
}

.wapro-widget.wapro-pos-right {
  right: 20px;
  left: auto;
  align-items: flex-end;
}

.wapro-widget.wapro-pos-left {
  left: 20px;
  right: auto;
  align-items: flex-start;
}

/* ── Botão principal ── */
.wapro-btn {
  width: var(--wapro-size);
  height: var(--wapro-size);
  border-radius: var(--wapro-radius);
  background: var(--wapro-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 25px rgba(37, 211, 102, 0.4);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

.wapro-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.6);
}

.wapro-btn:active {
  transform: translateY(0) scale(0.95);
}

.wapro-icon-wa {
  width: 55%;
  height: 55%;
  color: #fff;
  transition: opacity .2s, transform .2s;
}

.wapro-icon-close {
  width: 45%;
  height: 45%;
  color: #fff;
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg);
  transition: opacity .2s, transform .2s;
}

.wapro-widget.wapro-open .wapro-icon-wa {
  opacity: 0;
  transform: rotate(90deg);
}

.wapro-widget.wapro-open .wapro-icon-close {
  opacity: 1;
  transform: rotate(0);
}

/* ── Pulse animation ── */
.wapro-ring {
  display: block;
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--wapro-color);
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.wapro-anim-pulse .wapro-ring-1 {
  animation: wapro-pulse 2s ease-out infinite;
}

.wapro-anim-pulse .wapro-ring-2 {
  animation: wapro-pulse 2s 0.6s ease-out infinite;
}

@keyframes wapro-pulse {
  0% {
    transform: scale(1);
    opacity: .8;
  }

  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

/* ── Bounce animation ── */
.wapro-anim-bounce .wapro-ring {
  display: none;
}

.wapro-anim-bounce {
  animation: wapro-bounce 2s ease infinite;
}

@keyframes wapro-bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-10px);
  }

  60% {
    transform: translateY(-5px);
  }
}

/* ── Tooltip ── */
.wapro-tooltip {
  background: #1a1a1a;
  color: #fff;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--wapro-shadow);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  order: -1;
}

.wapro-widget:hover .wapro-tooltip,
.wapro-tooltip.wapro-show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Popup multi-atendentes ── */
.wapro-popup {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  width: 340px;
  overflow: hidden;
  transform: scale(0.8) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  height: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.175, .885, .32, 1.275), opacity .25s, visibility 0.3s;
  order: -1;
}

.wapro-pos-left .wapro-popup {
  transform-origin: bottom left;
}

.wapro-widget.wapro-open .wapro-popup {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
  height: auto;
  pointer-events: all;
}

.wapro-popup-header {
  background: linear-gradient(135deg, var(--wapro-color) 0%, #128C7E 100%);
  padding: 24px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-radius: 20px 20px 0 0;
  position: relative;
}

.wapro-popup-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
}

.wapro-popup-avatar-main {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wapro-popup-avatar-main svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.wapro-popup-brand strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.2;
}

.wapro-status-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.9;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
}

.wapro-popup-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.wapro-popup-close svg {
  width: 16px;
  height: 16px;
}

.wapro-popup-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.wapro-popup-body {
  padding: 24px 20px;
  background: #fafafa;
}

.wapro-popup-greeting {
  margin: 0 0 16px;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* ── Atendentes ── */
.wapro-agents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wapro-agent-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 14px;
  text-decoration: none;
  color: #1a1a1a;
  transition: all 0.25s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.wapro-agent-card:hover {
  border-color: var(--wapro-color);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.wapro-agent-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.wapro-agent-avatar img,
.wapro-agent-avatar span {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  background: rgba(37, 211, 102, 0.15);
  color: var(--wapro-color);
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wapro-agent-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wapro-agent-dot.offline {
  background: #cbd5e1;
}

.wapro-agent-info {
  flex: 1;
}

.wapro-agent-info strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 2px;
}

.wapro-agent-info small {
  font-size: 13px;
  color: #64748b;
  display: block;
}

.wapro-arrow {
  width: 20px;
  height: 20px;
  color: #cbd5e1;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.wapro-agent-card:hover .wapro-arrow {
  transform: translateX(4px);
  color: var(--wapro-color);
}

/* ── Status label ── */
.wapro-status-label.online {
  color: #d4f5d4;
}

.wapro-status-label.offline {
  color: #ffccc7;
}

/* ── Mobile hide/show ── */
@media (max-width: 768px) {
  .wapro-hide-mobile {
    display: none !important;
  }

  .wapro-popup {
    width: calc(100vw - 40px);
    max-width: 320px;
  }
}

@media (min-width: 769px) {
  .wapro-hide-desktop {
    display: none !important;
  }
}