/* GxLMS In-App AI Support Assistant Styles */

@keyframes gxlms-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gxlms-slide-left {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes gxlms-pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.95); }
}

@keyframes gxlms-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Floating Launcher */
.gxlms-assistant-launcher-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.gxlms-assistant-launcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
  color: #ffffff;
  border-radius: 9999px;
  border: none;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.4);
  cursor: pointer;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.gxlms-assistant-launcher-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.55);
  background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
}

.gxlms-assistant-launcher-btn:focus-visible {
  ring: 2px solid #3b82f6;
  ring-offset: 2px;
}

.gxlms-assistant-launcher-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: block;
  animation: gxlms-pulse-soft 2.5s infinite ease-in-out;
}

/* Drawer & Backdrop */
.gxlms-assistant-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10000;
  animation: gxlms-fade-in 0.2s ease-out;
}

.gxlms-assistant-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  z-index: 10001;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  animation: gxlms-slide-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

/* Header */
.gxlms-assistant-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.gxlms-assistant-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gxlms-assistant-header-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gxlms-assistant-header-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gxlms-assistant-header-tag {
  font-size: 10px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(147, 197, 253, 0.3);
}

.gxlms-assistant-header-subtitle {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #dbeafe;
  font-weight: 400;
}

.gxlms-assistant-close-btn {
  background: transparent;
  border: none;
  color: #bfdbfe;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gxlms-assistant-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Quota & Context Bar */
.gxlms-assistant-context-bar {
  padding: 6px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  flex-shrink: 0;
}

.gxlms-assistant-screen-badge {
  background: #e2e8f0;
  color: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
  font-weight: 500;
}

.gxlms-assistant-quota-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Privacy Notice */
.gxlms-assistant-privacy-notice {
  padding: 6px 16px;
  background: #fffbeb;
  border-bottom: 1px solid #fef3c7;
  color: #92400e;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
  flex-shrink: 0;
}

/* Messages Area */
.gxlms-assistant-messages {
  flex: 1 1 0%;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

/* Empty State / Welcome */
.gxlms-assistant-welcome {
  text-align: center;
  padding: 24px 8px;
  color: #64748b;
  margin: auto 0;
}

.gxlms-assistant-welcome-icon-wrap {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  background: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
}

.gxlms-assistant-welcome-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 6px 0;
}

.gxlms-assistant-welcome-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0 auto 16px;
  max-width: 280px;
  line-height: 1.4;
}

.gxlms-assistant-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}

.gxlms-assistant-example-btn {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #1d4ed8;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.gxlms-assistant-example-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Message Rows */
.gxlms-assistant-msg-user {
  display: flex;
  justify-content: flex-end;
}

.gxlms-assistant-bubble-user {
  max-width: 85%;
  background: #2563eb;
  color: #ffffff;
  border-radius: 14px 14px 2px 14px;
  padding: 9px 13px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  word-break: break-word;
}

.gxlms-assistant-bubble-user p {
  margin: 0;
  white-space: pre-wrap;
}

.gxlms-assistant-msg-bot {
  display: flex;
  justify-content: flex-start;
}

.gxlms-assistant-bubble-bot {
  max-width: 92%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px 14px 14px 2px;
  padding: 12px 14px;
  font-size: 12px;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  word-break: break-word;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gxlms-assistant-text-content {
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gxlms-assistant-text-content p {
  margin: 0;
}

.gxlms-assistant-cursor {
  display: inline-block;
  width: 6px;
  height: 13px;
  background-color: #2563eb;
  animation: gxlms-pulse-soft 0.8s infinite;
  margin-left: 2px;
  vertical-align: middle;
}

/* Citations & References */
.gxlms-assistant-citations-wrap {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.gxlms-assistant-citations-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}

.gxlms-assistant-citations-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gxlms-assistant-citation-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.gxlms-assistant-citation-pill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  text-decoration: none;
}

/* Bot Footer: Rating & Escalation */
.gxlms-assistant-msg-footer {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

.gxlms-assistant-feedback-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gxlms-assistant-rate-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 12px;
  transition: background 0.15s;
}

.gxlms-assistant-rate-btn:hover {
  background: #f1f5f9;
}

.gxlms-assistant-escalate-btn {
  background: transparent;
  border: none;
  color: #2563eb;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gxlms-assistant-escalate-btn:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.gxlms-assistant-feedback-box {
  margin-top: 6px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gxlms-assistant-feedback-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
}

.gxlms-assistant-feedback-input:focus {
  border-color: #3b82f6;
}

.gxlms-assistant-feedback-submit-btn {
  align-self: flex-end;
  padding: 4px 10px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

/* Escalation & Error Banners */
.gxlms-assistant-escalation-banner {
  padding: 10px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 11.5px;
  color: #166534;
}

.gxlms-assistant-escalation-banner-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.gxlms-assistant-error-banner {
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 11.5px;
  color: #991b1b;
}

.gxlms-assistant-error-banner-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

/* Input Area */
.gxlms-assistant-input-area {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.gxlms-assistant-input-wrapper {
  position: relative;
  display: flex;
}

.gxlms-assistant-textarea {
  width: 100%;
  font-size: 12px;
  padding: 8px 40px 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  resize: none;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.15s;
}

.gxlms-assistant-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.gxlms-assistant-textarea:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.gxlms-assistant-send-btn {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 28px;
  height: 28px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.gxlms-assistant-send-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.gxlms-assistant-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.gxlms-assistant-input-hint {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #94a3b8;
}

.gxlms-assistant-spinner {
  animation: gxlms-spin 1s linear infinite;
}
