/* ==========================================================================
   Capital Curadoria Imobiliária — Widget de Triagem Interativo Premium
   Rogério Campos — CRECI/ES 4399-F · CNAI 33648
   ========================================================================== */

/* Botão Flutuante (Launcher) */
.cc-widget-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  font-family: inherit;
}

.cc-launcher-bubble {
  background: #0b192c;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(11, 25, 44, 0.35);
  border: 1.5px solid rgba(197, 160, 89, 0.55);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  animation: ccPulseGlow 3s infinite ease-in-out;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cc-launcher-bubble span.cc-gold {
  color: #c5a059;
}

/* Botão Redondo com Borda Dourada Encorpada & Radar Pulsante */
.cc-launcher-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b192c 0%, #1e3a8a 100%);
  border: 3.5px solid #c5a059;
  box-shadow: 0 8px 24px rgba(11, 25, 44, 0.45), 0 0 18px rgba(197, 160, 89, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cc-launcher-btn:hover {
  transform: scale(1.08);
}

/* Onda 1 de Radar Dourada */
.cc-launcher-btn::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 2.5px solid #c5a059;
  animation: ccGoldenRadar 2.4s infinite cubic-bezier(0.2, 0.8, 0.4, 1);
  pointer-events: none;
  z-index: -1;
}

/* Onda 2 de Radar Dourada (defasada para efeito contínuo) */
.cc-launcher-btn::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 2px solid rgba(197, 160, 89, 0.75);
  animation: ccGoldenRadar 2.4s infinite 0.8s cubic-bezier(0.2, 0.8, 0.4, 1);
  pointer-events: none;
  z-index: -2;
}

@keyframes ccGoldenRadar {
  0% {
    transform: scale(0.95);
    opacity: 0.95;
    box-shadow: 0 0 12px rgba(197, 160, 89, 0.8);
  }
  50% {
    opacity: 0.45;
  }
  100% {
    transform: scale(1.48);
    opacity: 0;
    box-shadow: 0 0 28px rgba(197, 160, 89, 0);
  }
}

.cc-launcher-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.cc-launcher-badge-online {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 15px;
  height: 15px;
  background: #00c950;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 201, 80, 0.85);
}

/* Caixa Principal de Chat */
.cc-chat-box {
  position: fixed;
  bottom: 102px;
  right: 24px;
  z-index: 10000;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(11, 25, 44, 0.28), 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(197, 160, 89, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Header */
.cc-chat-header {
  background: linear-gradient(135deg, #0b192c 0%, #172a45 100%);
  border-bottom: 2px solid #c5a059;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.cc-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cc-header-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #c5a059;
  flex-shrink: 0;
}

.cc-header-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.cc-header-text h3 {
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.cc-header-text p {
  font-size: 0.76rem;
  color: #94a3b8;
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cc-header-text p span.cc-status-dot {
  width: 8px;
  height: 8px;
  background: #00c950;
  border-radius: 50%;
  display: inline-block;
}

.cc-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.cc-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Corpo do Chat */
.cc-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Mensagens */
.cc-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: ccFadeIn 0.3s ease-out;
}

.cc-msg-row.cc-bot {
  align-self: flex-start;
}

.cc-msg-row.cc-user {
  align-self: flex-end;
}

.cc-bubble {
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.cc-msg-row.cc-bot .cc-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-bottom-left-radius: 3px;
}

.cc-msg-row.cc-user .cc-bubble {
  background: #0b192c;
  color: #ffffff;
  border: 1px solid rgba(197, 160, 89, 0.35);
  box-shadow: 0 2px 8px rgba(11, 25, 44, 0.15);
  border-bottom-right-radius: 3px;
}

.cc-msg-time {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 4px;
  align-self: flex-end;
}

/* Opções Interativas */
.cc-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  animation: ccFadeIn 0.35s ease-out;
}

.cc-opt-btn {
  background: #ffffff;
  color: #0b192c;
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-opt-btn:hover {
  background: #f1f5f9;
  border-color: #c5a059;
  color: #0b192c;
  transform: translateX(3px);
  box-shadow: 0 3px 8px rgba(197, 160, 89, 0.2);
}

.cc-opt-btn::after {
  content: '→';
  font-size: 1rem;
  color: #c5a059;
  transition: transform 0.2s ease;
}

.cc-opt-btn:hover::after {
  transform: translateX(3px);
}

/* Botão WhatsApp Final */
.cc-wpp-cta {
  background: #00c950;
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 800;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 201, 80, 0.4);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.cc-wpp-cta:hover {
  background: #00b045;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 201, 80, 0.55);
}

.cc-wpp-cta svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Typing Dots */
.cc-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  width: fit-content;
  border-bottom-left-radius: 3px;
}

.cc-typing-dots span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: ccDotBounce 1.2s infinite ease-in-out;
}

.cc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.cc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Animações */
@keyframes ccDotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

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

@keyframes ccPulseGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(11, 25, 44, 0.25); }
  50% { box-shadow: 0 4px 22px rgba(197, 160, 89, 0.6); }
}

/* Responsividade Mobile */
@media (max-width: 480px) {
  .cc-widget-launcher {
    bottom: 18px;
    right: 18px;
  }
  .cc-launcher-bubble {
    display: none;
  }
  .cc-chat-box {
    bottom: 90px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    height: 480px;
  }
}
