/* Quas Labs AI Live Chat Widget Styles */
:root {
  --ql-chat-bg: #0f172a;
  --ql-chat-panel: #1e293b;
  --ql-chat-border: #334155;
  --ql-chat-accent: #38bdf8;
  --ql-chat-accent-glow: rgba(56, 189, 248, 0.3);
  --ql-chat-text: #f8fafc;
  --ql-chat-muted: #94a3b8;
  --ql-chat-bot-bubble: #1e293b;
  --ql-chat-user-bubble: #0284c7;
  --ql-chat-agent-bubble: #0d9488;
}

/* Floating Trigger Button */
.ql-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.4), 0 0 15px var(--ql-chat-accent-glow);
  border: none;
  cursor: pointer;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.ql-chat-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 30px rgba(2, 132, 199, 0.6);
}

.ql-chat-trigger svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

.ql-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ql-chat-bg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Chat Widget Container */
.ql-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: var(--ql-chat-bg);
  border: 1px solid var(--ql-chat-border);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 99991;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.ql-chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.ql-chat-header {
  background: var(--ql-chat-panel);
  padding: 16px;
  border-bottom: 1px solid var(--ql-chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.ql-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  position: relative;
}

.ql-chat-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--ql-chat-panel);
}

.ql-chat-status-dot.away {
  background: #f59e0b;
}

.ql-chat-title {
  color: var(--ql-chat-text);
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.ql-chat-subtitle {
  color: var(--ql-chat-muted);
  font-size: 12px;
  margin-top: 2px;
}

.ql-chat-close-btn {
  background: transparent;
  border: none;
  color: var(--ql-chat-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.ql-chat-close-btn:hover {
  color: var(--ql-chat-text);
  background: rgba(255,255,255,0.1);
}

/* Body / Message List */
.ql-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.05), transparent 60%);
}

.ql-chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  animation: qlFadeIn 0.25s ease-out;
}

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

.ql-chat-msg.bot {
  background: var(--ql-chat-bot-bubble);
  color: var(--ql-chat-text);
  border: 1px solid var(--ql-chat-border);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.ql-chat-msg.customer {
  background: var(--ql-chat-user-bubble);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.ql-chat-msg.agent {
  background: var(--ql-chat-agent-bubble);
  color: #ffffff;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.ql-chat-msg-time {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  text-align: right;
}

/* Escalation Action Box */
.ql-escalate-bar {
  padding: 8px 16px;
  background: rgba(56, 189, 248, 0.1);
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ql-escalate-btn {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ql-escalate-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

/* Quick Question Pills */
.ql-quick-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  background: var(--ql-chat-panel);
  border-top: 1px solid var(--ql-chat-border);
}

.ql-pill {
  background: rgba(255,255,255,0.06);
  color: var(--ql-chat-accent);
  border: 1px solid var(--ql-chat-border);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s;
}

.ql-pill:hover {
  background: rgba(56, 189, 248, 0.15);
}

/* Footer / Input Area */
.ql-chat-footer {
  padding: 12px;
  background: var(--ql-chat-panel);
  border-top: 1px solid var(--ql-chat-border);
  display: flex;
  gap: 8px;
}

.ql-chat-input {
  flex: 1;
  background: var(--ql-chat-bg);
  border: 1px solid var(--ql-chat-border);
  color: var(--ql-chat-text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
}

.ql-chat-input:focus {
  border-color: var(--ql-chat-accent);
}

.ql-chat-send-btn {
  background: var(--ql-chat-accent);
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.ql-chat-send-btn:hover {
  opacity: 0.9;
}
