/* Ghost Chat Widget - Ultra Premium Design */

/* Widget Container */
.whatsapp-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Ghost Button - Transparent Floating */
.whatsapp-button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0;
}

.whatsapp-button::before {
  display: none;
}

.whatsapp-button:hover {
  transform: scale(1.15) translateY(-5px);
}

.whatsapp-icon-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
  transition: all 0.3s;
}

.whatsapp-button:hover .whatsapp-icon-img {
  filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.8));
  transform: scale(1.05);
}

/* Chat Window - Compact */
.whatsapp-chat {
  position: absolute;
  bottom: 85px;
  right: 0;
  width: 320px;
  max-height: 480px;
  background: linear-gradient(180deg,
      rgba(10, 10, 20, 0.95) 0%,
      rgba(13, 21, 37, 0.98) 100%);
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(59, 130, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(30px) scale(0.9);
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.25);
  backdrop-filter: blur(20px);
}

.whatsapp-chat.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header - Premium Gradient */
.whatsapp-header {
  background: linear-gradient(135deg,
      rgba(59, 130, 246, 0.2) 0%,
      rgba(96, 165, 250, 0.1) 50%,
      rgba(59, 130, 246, 0.15) 100%);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.whatsapp-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
  animation: header-shimmer 5s linear infinite;
}

@keyframes header-shimmer {
  0% {
    transform: translateX(-50%) translateY(-50%) rotate(0deg);
  }

  100% {
    transform: translateX(-50%) translateY(-50%) rotate(360deg);
  }
}

/* Logo de fundo cobrindo todo o header */
.chat-header-bg {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: url('/dist/images/ghost-app-logo-oficial.png') center/auto 90% no-repeat;
  opacity: 0.8;
  z-index: 0;
}

.whatsapp-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.whatsapp-icon-header {
  font-size: 38px;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.7));
  animation: ghost-float 2.5s ease-in-out infinite;
}

@keyframes ghost-float {

  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }

  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

.whatsapp-header h4 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.status-online {
  font-size: 12px;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

/* Removido a bolinha verde - texto simples */
.status-online::before {
  display: none;
}

@keyframes pulse-online {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
  }
}

.whatsapp-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.3s;
  position: relative;
  z-index: 1;
}

.whatsapp-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  transform: rotate(90deg) scale(1.1);
}

/* Chat Body - Clean Design */
.whatsapp-body {
  padding: 20px;
  max-height: 320px;
  overflow-y: auto;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
}

.whatsapp-body::-webkit-scrollbar {
  width: 5px;
}

.whatsapp-body::-webkit-scrollbar-track {
  background: rgba(59, 130, 246, 0.05);
  border-radius: 10px;
}

.whatsapp-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.4), rgba(96, 165, 250, 0.3));
  border-radius: 10px;
}

/* Bot Message - Premium Glass Effect */
.whatsapp-message-bot {
  background: linear-gradient(135deg,
      rgba(59, 130, 246, 0.12) 0%,
      rgba(59, 130, 246, 0.05) 100%);
  padding: 14px 18px;
  border-radius: 20px 20px 20px 6px;
  margin-bottom: 14px;
  max-width: 85%;
  position: relative;
  animation: message-slide-left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(59, 130, 246, 0.15);
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@keyframes message-slide-left {
  from {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.whatsapp-message-bot::before {
  display: none;
}

.whatsapp-message-bot p {
  margin: 0 0 4px 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  line-height: 1.5;
}

.whatsapp-message-bot p:last-of-type {
  margin-bottom: 4px;
}

/* User Message - Vibrant Gradient */
.whatsapp-message-user {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #3b82f6 100%);
  background-size: 200% 200%;
  animation: message-slide-right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), gradient-shift 3s ease infinite;
  padding: 14px 18px;
  border-radius: 20px 20px 6px 20px;
  margin-bottom: 14px;
  margin-left: auto;
  max-width: 85%;
  position: relative;
  box-shadow:
    0 4px 20px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@keyframes message-slide-right {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.whatsapp-message-user p {
  margin: 0 0 4px 0;
  color: white;
  font-size: 12px;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.whatsapp-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  text-align: right;
}

/* Typing Indicator - Modern Animation */
.whatsapp-typing {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  border-radius: 12px 12px 12px 4px;
  width: fit-content;
  margin-bottom: 8px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.whatsapp-typing span {
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  border-radius: 50%;
  animation: typing-bounce 1.4s ease-in-out infinite;
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

.whatsapp-typing span:nth-child(1) {
  animation-delay: 0s;
}

.whatsapp-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.whatsapp-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-12px) scale(1.2);
    opacity: 1;
  }
}

/* Footer - Glass Input Area */
.whatsapp-footer {
  padding: 16px;
  display: flex;
  gap: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
  border-top: 1px solid rgba(59, 130, 246, 0.15);
  backdrop-filter: blur(10px);
}

.whatsapp-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 12px;
  outline: none;
  transition: all 0.3s;
}

.whatsapp-input:focus {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.08);
  box-shadow:
    0 0 25px rgba(59, 130, 246, 0.15),
    inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.whatsapp-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

/* Mic Button - Premium Style */
.whatsapp-mic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.whatsapp-mic:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.whatsapp-mic.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  color: white;
  animation: recording-pulse 1s ease-in-out infinite;
}

@keyframes recording-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
}

/* Send Button - Premium Gradient */
.whatsapp-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
  box-shadow:
    0 4px 20px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.whatsapp-send:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.5);
}

.whatsapp-send:active {
  transform: scale(0.95);
}

/* Auto Message Popup - Premium */
.whatsapp-auto-message {
  position: absolute;
  bottom: 85px;
  right: 0;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 14px 22px;
  border-radius: 20px 20px 6px 20px;
  font-size: 14px;
  font-weight: 500;
  box-shadow:
    0 10px 40px rgba(59, 130, 246, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: translateY(15px) scale(0.9);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
  z-index: 9998;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.whatsapp-auto-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.whatsapp-auto-message::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 28px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #2563eb;
}

/* Quick Reply Buttons (Optional Enhancement) */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.quick-reply-btn {
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.quick-reply-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
  transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .whatsapp-widget {
    right: 15px;
    bottom: 15px;
  }

  .whatsapp-button {
    width: 60px;
    height: 60px;
  }

  .whatsapp-chat {
    width: calc(100vw - 30px);
    max-width: 380px;
    bottom: 75px;
    right: 0;
  }

  .whatsapp-message-bot::before {
    display: none;
  }

  .whatsapp-auto-message {
    bottom: 75px;
    font-size: 13px;
    padding: 12px 18px;
    max-width: calc(100vw - 100px);
    white-space: normal;
  }

  .whatsapp-body {
    max-height: 280px;
  }

  .quick-replies {
    padding: 8px 12px;
  }

  .quick-reply-btn {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* Chat Avatar */
.chat-avatar {
  position: relative;
  width: 48px;
  height: 48px;
}

.chat-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(59, 130, 246, 0.3);
}

.chat-avatar-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border-radius: 50%;
  border: 2px solid #0a0a14;
  animation: pulse-online 1.5s ease-in-out infinite;
}

.chat-header-info h4 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

/* Quick Reply Buttons - Grid 2x2 */
.quick-replies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.quick-reply-btn {
  padding: 6px 10px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  text-align: center;
}

.quick-reply-btn:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.15));
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

/* CTA Button in Chat */
.chat-cta-container {
  margin-top: 12px;
  text-align: center;
}

.chat-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow:
    0 4px 20px rgba(34, 197, 94, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
  animation: cta-pulse 2s ease-in-out infinite;
}

@keyframes cta-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 6px 30px rgba(34, 197, 94, 0.6);
  }
}

.chat-cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 35px rgba(34, 197, 94, 0.5);
}

.chat-cta-icon {
  font-size: 16px;
}

.chat-cta-text {
  font-size: 13px;
}

.chat-cta-guarantee {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}