/* SGDM Physics AI Assistant Widget Styles */
#sgdm-widget-root {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  z-index: 99999;
  position: relative;
}

/* Floating Launcher Button */
.sgdm-launcher-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #0284c7;
  border-radius: 9999px;
  padding: 8px 18px 8px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.25), 0 8px 10px -6px rgba(2, 132, 199, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999;
}

.sgdm-launcher-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 32px -4px rgba(2, 132, 199, 0.35);
  border-color: #0369a1;
  background: #f8fafc;
}

.sgdm-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sgdm-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0284c7;
}

.sgdm-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.sgdm-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.sgdm-launcher-title {
  font-size: 14px;
  font-weight: 800;
  color: #0284c7;
  letter-spacing: -0.01em;
}

.sgdm-launcher-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

/* Chat Drawer Window */
.sgdm-chat-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 48px);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100000;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Header */
.sgdm-drawer-header {
  background: linear-gradient(135deg, #0284c7 0%, #1e40af 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sgdm-header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sgdm-header-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.sgdm-header-info span {
  font-size: 11px;
  color: #bae6fd;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sgdm-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sgdm-action-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sgdm-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Body */
.sgdm-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.sgdm-welcome-box {
  text-align: center;
  margin: auto 0;
  padding: 10px 0;
}

.sgdm-welcome-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid #0284c7;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.sgdm-welcome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sgdm-welcome-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.sgdm-welcome-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 16px;
}

/* Quick Prompts */
.sgdm-quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.sgdm-prompt-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sgdm-prompt-btn:hover {
  background: #eff6ff;
  border-color: #0284c7;
  color: #0369a1;
  transform: translateX(2px);
}

/* Messages */
.sgdm-message {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.sgdm-message.user {
  justify-content: flex-end;
}

.sgdm-msg-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  word-break: break-word;
}

.sgdm-message.user .sgdm-msg-bubble {
  background: #0284c7;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.sgdm-message.bot .sgdm-msg-bubble {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sgdm-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1.5px solid #0284c7;
}

.sgdm-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Typing Indicator */
.sgdm-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.sgdm-typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: sgdmPulse 1.4s infinite ease-in-out both;
}

.sgdm-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.sgdm-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes sgdmPulse {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Footer Input */
.sgdm-drawer-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.sgdm-input-wrapper {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 4px 6px 4px 14px;
  transition: all 0.2s;
}

.sgdm-input-wrapper:focus-within {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.sgdm-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  padding: 6px 0;
}

.sgdm-send-btn {
  width: 32px;
  height: 32px;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sgdm-send-btn:hover {
  background: #0369a1;
  transform: scale(1.05);
}

.sgdm-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}
