/* ==========================================================================
   ATENDIMENTO PREMIUM - FRONTEND STYLESHEET
   ========================================================================== */

#atendimento-premium-widget {
  position: fixed;
  z-index: 999999;
  bottom: var(--atendimento-bottom, 20px);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

#atendimento-premium-widget.position-right {
  right: var(--atendimento-side, 20px);
  align-items: flex-end;
}

#atendimento-premium-widget.position-left {
  left: var(--atendimento-side, 20px);
  align-items: flex-start;
}

/* Responsividade Mobile & Desktop */
@media (max-width: 768px) {
  #atendimento-premium-widget.hide-mobile { display: none !important; }
  .atendimento-channel-item.hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  #atendimento-premium-widget.hide-desktop { display: none !important; }
  .atendimento-channel-item.hide-desktop { display: none !important; }
}

/* Botão Trigger Principal - Proteção contra temas WordPress */
/* Botão Trigger Principal - Proteção contra temas WordPress */
#atendimento-premium-widget button#atendimento-trigger-btn,
#atendimento-premium-widget button#atendimento-trigger-btn:hover,
#atendimento-premium-widget button#atendimento-trigger-btn:focus,
#atendimento-premium-widget button#atendimento-trigger-btn:active,
#atendimento-premium-widget button#atendimento-trigger-btn:visited,
.atendimento-trigger-btn {
  background-color: var(--atendimento-main-bg, #25D366) !important;
  background: var(--atendimento-main-bg, #25D366) !important;
  color: var(--atendimento-main-color, #ffffff) !important;
  border: none !important;
  outline: none !important;
  margin: 0 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease !important;
  position: relative !important;
  user-select: none !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* Formato Circular padrão (quando NÃO tem texto) */
#atendimento-premium-widget button#atendimento-trigger-btn:not(.has-text),
.atendimento-trigger-btn:not(.has-text) {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  border-radius: 50% !important;
  -webkit-border-radius: 50% !important;
  clip-path: circle(50% at 50% 50%) !important;
  -webkit-clip-path: circle(50% at 50% 50%) !important;
  padding: 0 !important;
}

/* Modo Cápsula / Pílula arredondada quando possui texto */
#atendimento-premium-widget button#atendimento-trigger-btn.has-text,
.atendimento-trigger-btn.has-text {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  border-radius: 28px !important;
  -webkit-border-radius: 28px !important;
  padding: 0 22px 0 24px !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  gap: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#atendimento-premium-widget.position-left button#atendimento-trigger-btn.has-text,
.position-left .atendimento-trigger-btn.has-text {
  padding: 0 24px 0 22px !important;
}

#atendimento-premium-widget button#atendimento-trigger-btn:hover {
  transform: scale(1.04) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28) !important;
}

#atendimento-premium-widget button#atendimento-trigger-btn:active {
  transform: scale(0.96) !important;
}

#atendimento-premium-widget button#atendimento-trigger-btn .atendimento-trigger-text,
.atendimento-trigger-btn .atendimento-trigger-text {
  font-size: 15px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  color: inherit !important;
  line-height: 1 !important;
  letter-spacing: 0.2px !important;
  display: inline-block !important;
}

#atendimento-premium-widget button#atendimento-trigger-btn.has-text .btn-icon,
.atendimento-trigger-btn.has-text .btn-icon {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  flex-shrink: 0 !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
}

.atendimento-trigger-btn .btn-icon {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.atendimento-trigger-btn .btn-icon[style*="display:none"],
.atendimento-trigger-btn .btn-icon[style*="display: none"],
.atendimento-trigger-btn .btn-icon.is-hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.atendimento-trigger-btn svg {
  width: 28px !important;
  height: 28px !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
}

/* Animações */
#atendimento-premium-widget.anim-pulse .atendimento-trigger-btn {
  animation: atendPulse 2.2s infinite;
}

#atendimento-premium-widget.anim-bounce .atendimento-trigger-btn {
  animation: atendBounce 2.5s infinite;
}

#atendimento-premium-widget.anim-shake .atendimento-trigger-btn {
  animation: atendShake 4s infinite;
}

#atendimento-premium-widget.anim-glow .atendimento-trigger-btn {
  animation: atendGlow 2s infinite alternate;
}

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

@keyframes atendBounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-12px); }
  60% { transform: translateY(-6px); }
}

@keyframes atendShake {
  0%, 90%, 100% { transform: rotate(0deg); }
  92% { transform: rotate(-10deg); }
  94% { transform: rotate(10deg); }
  96% { transform: rotate(-8deg); }
  98% { transform: rotate(8deg); }
}

@keyframes atendGlow {
  from { filter: drop-shadow(0 0 4px rgba(37, 211, 102, 0.6)); }
  to { filter: drop-shadow(0 0 14px rgba(37, 211, 102, 1)); }
}

/* Balão de Boas-Vindas (Callout) */
.atendimento-callout-bubble {
  background: #ffffff;
  color: #1e293b;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
  position: relative;
  max-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: atendFadeSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
}

#atendimento-premium-widget.position-right .atendimento-callout-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-bottom-right-radius: 2px;
}

#atendimento-premium-widget.position-left .atendimento-callout-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 22px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
}

#atendimento-premium-widget #atendimento-callout-close-btn,
#atendimento-premium-widget button#atendimento-callout-close-btn,
.atendimento-callout-bubble button.atendimento-callout-close-btn,
.atendimento-callout-close-btn {
  all: unset !important;
  box-sizing: border-box !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 16px !important;
  line-height: 1 !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  padding: 0 4px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
}

#atendimento-premium-widget #atendimento-callout-close-btn:hover,
.atendimento-callout-close-btn:hover {
  color: #0f172a !important;
  background: transparent !important;
}

/* Menu Expansível de Canais */
.atendimento-popup-menu {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.22), 0 10px 15px -8px rgba(0, 0, 0, 0.12);
  width: 280px;
  margin-bottom: 14px;
  overflow: hidden;
  animation: atendPopUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

@keyframes atendPopUp {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.atendimento-popup-header {
  background: #f8fafc;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

.atendimento-channels-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.atendimento-channel-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 14px;
  text-decoration: none !important;
  transition: transform 0.2s ease, filter 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.atendimento-channel-item:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.atendimento-channel-item .channel-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.atendimento-channel-item .channel-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.atendimento-channel-item .channel-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.atendimento-channel-item .channel-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.atendimento-channel-item .channel-subtitle {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
  font-weight: 400;
}

.atendimento-channel-item .channel-arrow {
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}
