/* Ask AI drawer styles */

#ask-ai-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#ask-ai-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#ask-ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 95vw;
  background: #0f172a;
  border-left: 1px solid #1e293b;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', system-ui, sans-serif;
}
#ask-ai-drawer.open {
  transform: translateX(0);
}

#ask-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
#ask-ai-header span {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.01em;
}

#ask-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#ask-ai-clear {
  background: none;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
#ask-ai-clear:hover {
  color: #f1f5f9;
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.08);
}

#ask-ai-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}
#ask-ai-close:hover {
  color: #f1f5f9;
}

#ask-ai-context {
  background: #1e293b;
  margin: 1rem 1.25rem 0;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: #94a3b8;
  max-height: 90px;
  overflow: hidden;
  white-space: pre;
  text-overflow: ellipsis;
  flex-shrink: 0;
  border-left: 3px solid #7c3aed;
}

#ask-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ask-ai-msg {
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}
.ask-ai-msg.user {
  background: #1e293b;
  color: #e2e8f0;
  align-self: flex-end;
  max-width: 88%;
}
.ask-ai-msg.assistant {
  background: transparent;
  color: #cbd5e1;
  border-left: 2px solid #7c3aed;
  padding-left: 0.85rem;
  border-radius: 0;
}
.ask-ai-msg.typing {
  color: #475569;
  font-style: italic;
  border: none;
  padding-left: 0;
}

.ask-ai-msg code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  background: #1e293b;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: #a78bfa;
}
.ask-ai-msg pre {
  background: #1e293b;
  border-radius: 6px;
  padding: 0.75rem;
  overflow-x: auto;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

#ask-ai-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
}
#ask-ai-input {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 2.4rem;
  max-height: 7rem;
  transition: border-color 0.15s;
}
#ask-ai-input:focus {
  border-color: #7c3aed;
}
#ask-ai-input::placeholder {
  color: #475569;
}

#ask-ai-send {
  background: #7c3aed;
  color: #fff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-end;
  height: 2.4rem;
}
#ask-ai-send:hover {
  background: #6d28d9;
}
#ask-ai-send:disabled {
  background: #1e293b;
  color: #475569;
  cursor: not-allowed;
}

/* Ask AI button injected into code blocks */
.ask-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.ask-ai-btn:hover {
  color: #a78bfa;
  border-color: #7c3aed;
}
.ask-ai-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Floating Action Button (FAB) */
#ask-ai-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 998;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s, box-shadow 0.2s;
  padding: 0;
}
#ask-ai-fab svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  transition: transform 0.3s ease;
}
#ask-ai-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 35px rgba(124, 58, 237, 0.55);
}
#ask-ai-fab:hover svg {
  transform: rotate(15deg);
}
#ask-ai-fab:active {
  transform: translateY(0) scale(0.95);
}
#ask-ai-fab.drawer-open {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

/* Page Context bar in drawer */
#ask-ai-page-context {
  background: rgba(124, 58, 237, 0.08);
  border-left: 3px solid #7c3aed;
  margin: 1rem 1.25rem 0;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #a78bfa;
  font-weight: 500;
  flex-shrink: 0;
}

/* Fenced Code Blocks inside Message bubbles */
#ask-ai-messages pre.ask-ai-codeblock {
  margin: 0.6rem 0;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  font-family: inherit;
}
.ask-ai-codeblock-header {
  background: #151e2e;
  padding: 0.3rem 0.7rem;
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1e293b;
  user-select: none;
}
#ask-ai-messages pre.ask-ai-codeblock code {
  display: block;
  padding: 0.65rem 0.85rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: #cbd5e1;
  overflow-x: auto;
  background: none;
  border: none;
  border-radius: 0;
}

/* Bullet list items inside message bubbles */
.ask-ai-list-item {
  margin: 0.35rem 0;
  padding-left: 0.5rem;
  line-height: 1.5;
  color: #cbd5e1;
}


