/* Live Chat Widget */
.chat-bubble-launcher {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  border: 2px solid #ffffff;
  color: #ffffff;
  display: none; /* Controlled dynamically by JS when backoffice is online */
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.5);
  cursor: pointer;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-bubble-launcher:hover {
  transform: scale(1.1);
}

.chat-bubble-pulse {
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  border: 2px solid #ec4899;
  animation: chatPulse 2s infinite;
  pointer-events: none;
}

.chat-window {
  position: fixed;
  bottom: 95px;
  right: 25px;
  width: 360px;
  height: 480px;
  background: #110f27;
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  display: none;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.chat-window.open {
  display: flex;
}

.chat-header {
  background: linear-gradient(135deg, #2e1065 0%, #4c1d95 100%);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-cosmic);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.chat-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.chat-header-subtitle {
  font-size: 0.75rem;
  color: #cbd5e1;
}

.chat-close-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 1.3rem;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg-operator {
  align-self: flex-start;
  background: #231f47;
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.chat-msg-visitor {
  align-self: flex-end;
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-input-row {
  display: flex;
  padding: 12px;
  background: #0d0c1f;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: #191738;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
}

.chat-send-btn {
  background: var(--primary-purple);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
}

@keyframes chatPulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.2; }
  100% { transform: scale(1.25); opacity: 0; }
}
