/* ── Floating walkie-talkie widget ────────────────── */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-body, system-ui, sans-serif);
}

/* Call-to-action label */
.chat-label {
  position: absolute;
  bottom: 68px;
  right: 4px;
  background: #1a1a2e;
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: labelFadeIn 0.4s ease;
  pointer-events: none;
}
.chat-label.hidden {
  display: none;
}
@keyframes labelFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Walkie-talkie bubble */
.chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1a1a2e;
  color: #e6b422;
  border: none;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}
.chat-bubble svg {
  width: 26px;
  height: 26px;
}

/* Pulse ring */
.pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: pulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Online badge (green dot) */
.online-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #1a1a2e;
}

/* Mini chat panel */
.chat-panel {
  display: none;
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 370px;
  max-height: 540px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.open {
  display: flex;
}

.chat-panel-header {
  background: #1a1a2e;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-panel-header .walkie-icon {
  font-size: 22px;
  line-height: 1;
}
.chat-panel-header h3 {
  margin: 0;
  font-size: 0.95rem;
  flex: 1;
  font-weight: 600;
}
.online-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
}
.online-text {
  font-size: 0.75rem;
  color: #22c55e;
  margin-right: 4px;
}
.chat-panel-header button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.chat-panel-header button:hover { color: #fff; }

.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  background: #f8f9fb;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg.assistant {
  background: #fff;
  border: 1px solid #e5e7eb;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  background: #1a1a2e;
  color: #e6b422;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-panel-footer {
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  background: #fff;
}
.chat-panel-footer input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
}
.chat-panel-footer input:focus {
  border-color: #1a1a2e;
}
.chat-panel-footer button {
  padding: 8px 16px;
  background: #1a1a2e;
  color: #e6b422;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 48px);
    right: 0;
  }
}

/* RTL */
[dir="rtl"] .chat-widget { left: 24px; right: auto; }
[dir="rtl"] .chat-label { left: 4px; right: auto; }
[dir="rtl"] .chat-panel { left: 0; right: auto; }
