/* ── Premium Live Chat Widget ── */
.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-main);
}

.chat-bubble {
  width: 65px;
  height: 65px;
  background: var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.chat-bubble:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.6);
}

.chat-bubble i {
  color: white;
  font-size: 24px;
}

.chat-bubble::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
}

.chat-window {
  width: 380px;
  height: 500px;
  background: rgba(13, 17, 26, 0.95);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: none; /* Controlled by JS */
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-window.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.chat-header {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), transparent);
  border-bottom: 1px solid var(--border-glass);
}

.chat-header h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.chat-status {
  font-size: 0.75rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.chat-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
}

.chat-body {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-msg {
  max-width: 80%;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-msg.agent {
  background: rgba(255, 255, 255, 0.05);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-msg.user {
  background: var(--accent-blue);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: white;
  font-size: 0.9rem;
}

.chat-send {
  background: var(--accent-blue);
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.dot {
  height: 6px;
  width: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
  animation: dot-pulse 1.4s infinite linear;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.2; transform: scale(0.8); }
}

.chat-msg.reveal {
  animation: msg-reveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes msg-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
