/* SaarthiX - Chat Assistant styles */
:root {
  --sx-bg: #0f2238;
  --sx-bg-2: #0b1a2c;
  --sx-accent: #5a8cff;
  --sx-accent-2: #2f6ef5;
  --sx-border: rgba(255,255,255,0.12);
  --sx-text: #e9f2ff;
  --sx-muted: rgba(233,242,255,0.75);
}

/* Launcher button */
#sx-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--sx-border);
  color: #fff;
  background: linear-gradient(135deg, var(--sx-accent-2), var(--sx-accent));
  box-shadow: 0 10px 28px rgba(47, 110, 245, 0.35);
  cursor: pointer;
  font-weight: 600;
}
#sx-chat-launcher .icon { width: 18px; height: 18px; }
#sx-chat-launcher .pulse {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #7cf;
  box-shadow: 0 0 0 0 rgba(123, 204, 255, 0.9);
  animation: sx-pulse 2s infinite;
}
@keyframes sx-pulse {
  0% { box-shadow: 0 0 0 0 rgba(123, 204, 255, 0.8); }
  70% { box-shadow: 0 0 0 12px rgba(123, 204, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(123, 204, 255, 0); }
}

/* Widget shell */
#sx-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: linear-gradient(180deg, rgba(18,31,52,0.98), rgba(14,24,41,0.98));
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid var(--sx-border);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0,0,0,0.45);
  color: var(--sx-text);
  display: none;
  overflow: hidden;
  z-index: 10000;
}
#sx-chat-widget.open { display: flex; flex-direction: column; }

/* Header */
#sx-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--sx-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}
#sx-chat-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
#sx-chat-title .icon { opacity: .9; }
#sx-chat-title .badge { font-size: 11px; font-weight: 700; color: #b9d1ff; background: rgba(90,140,255,.16); border: 1px solid rgba(185,209,255,.28); padding: 2px 6px; border-radius: 999px; }
#sx-chat-controls { display: inline-flex; gap: 6px; }
#sx-chat-controls button { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #e6f1ff; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; }
#sx-chat-controls button:hover { background: rgba(255,255,255,.12); }

/* Messages */
#sx-chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sx-msg { display: flex; flex-direction: column; max-width: 86%; }
.sx-msg.user { align-self: flex-end; align-items: flex-end; }
.sx-msg.bot { align-self: flex-start; align-items: flex-start; }
.sx-msg .bubble { padding: 10px 12px; border-radius: 12px; line-height: 1.4; border: 1px solid var(--sx-border); }
.sx-msg.bot .bubble { background: rgba(255,255,255,0.06); color: var(--sx-text); }
.sx-msg.user .bubble { background: linear-gradient(135deg, var(--sx-accent-2), var(--sx-accent)); color: #fff; border: none; }
.sx-time { margin-top: 4px; font-size: 11px; color: var(--sx-muted); }

/* Suggestions */
#sx-quick-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--sx-border); background: rgba(255,255,255,0.03); }
#sx-quick-suggestions button { padding: 6px 10px; border-radius: 999px; background: rgba(90,140,255,0.12); border: 1px solid rgba(185,209,255,0.28); color: #b9d1ff; cursor: pointer; font-weight: 600; }
#sx-quick-suggestions button:hover { background: rgba(90,140,255,0.18); }

/* Input */
#sx-chat-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--sx-border); background: rgba(255,255,255,0.03); }
#sx-chat-textarea { resize: none; outline: none; border-radius: 12px; border: 1px solid var(--sx-border); background: rgba(255,255,255,0.05); color: var(--sx-text); padding: 10px 12px; font-family: inherit; }
#sx-send-btn { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--sx-border); background: linear-gradient(135deg, var(--sx-accent-2), var(--sx-accent)); color: #fff; font-weight: 700; cursor: pointer; }
#sx-send-btn:hover { filter: brightness(1.05); }

/* Mobile tweaks */
@media (max-width: 520px) {
  #sx-chat-widget { right: 12px; left: 12px; width: auto; bottom: 84px; height: 60vh; }
  #sx-chat-launcher { right: 12px; bottom: 12px; }
}