/* ── Widget: floating button + slide-in panel ───────────────────────────── */

.ask-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  font-family: inherit;
}

.ask-fab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #18181b;
  color: #fff;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.15s, box-shadow 0.15s;
}

.ask-fab:hover {
  background: #3f3f46;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.ask-fab-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.ask-panel {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  height: 32rem;
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  z-index: 9001;
}

.ask-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #18181b;
  color: #fff;
}

.ask-panel-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.ask-panel-fullpage {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  white-space: nowrap;
}

.ask-panel-fullpage:hover {
  color: #fff;
  text-decoration: underline;
}

.ask-panel-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 0.25rem;
  opacity: 0.8;
}

.ask-panel-close:hover { opacity: 1; }

/* ── CV download button ──────────────────────────────────────────────────── */

.ask-cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  margin-top: 0.5rem;
  background: #18181b;
  color: #fff;
  text-decoration: none;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.12s;
}

.ask-cv-download::before {
  content: "↓";
  font-size: 0.85em;
}

.ask-cv-download:hover {
  background: #3f3f46;
  color: #fff;
}

/* ── Example question chips ─────────────────────────────────────────────── */

.ask-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.ask-example {
  padding: 0.45rem 0.9rem;
  background: #fff;
  border: 1px solid #d4d4d8;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #3f3f46;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
  text-align: left;
}

.ask-example:hover {
  background: #f4f4f5;
  border-color: #18181b;
  color: #18181b;
}

.ask-examples-widget {
  padding: 0.5rem 1rem 0;
  justify-content: flex-start;
}

/* ── Shared: messages ───────────────────────────────────────────────────── */

.ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

.ask-message {
  max-width: 85%;
  padding: 0.6rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.ask-message-user {
  align-self: flex-end;
  background: #18181b;
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

.ask-message-assistant {
  align-self: flex-start;
  background: #f4f4f5;
  color: #18181b;
  border-bottom-left-radius: 0.2rem;
}

.ask-message-assistant p { margin: 0 0 0.4rem; }
.ask-message-assistant p:last-child { margin-bottom: 0; }
.ask-message-assistant ul { margin: 0.25rem 0 0.4rem 1rem; padding: 0; }
.ask-message-assistant li { margin-bottom: 0.2rem; }

.ask-message-error {
  align-self: flex-start;
  background: #fff0f0;
  color: #b91c1c;
  font-size: 0.8rem;
  border: 1px solid #fca5a5;
  border-radius: 0.5rem;
  max-width: 90%;
}

.ask-message-loading {
  background: #f4f4f5;
  padding: 0.75rem 1rem;
}

.ask-message-loading span {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 0.1rem;
  background: #a1a1aa;
  border-radius: 50%;
  animation: ask-dot-bounce 1.2s infinite ease-in-out;
}

.ask-message-loading span:nth-child(2) { animation-delay: 0.2s; }
.ask-message-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ask-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-0.4rem); }
}

/* ── Shared: form ───────────────────────────────────────────────────────── */

.ask-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e4e4e7;
  background: #fff;
}

.ask-input {
  flex: 1;
  resize: none;
  border: 1px solid #d4d4d8;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  min-height: 2.5rem;
  max-height: 8rem;
  outline: none;
  transition: border-color 0.15s;
}

.ask-input:focus { border-color: #18181b; }
.ask-input:disabled { background: #fafafa; color: #a1a1aa; }

.ask-submit {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: #18181b;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ask-submit:hover:not(:disabled) { background: #3f3f46; }
.ask-submit:disabled { background: #a1a1aa; cursor: not-allowed; }
.ask-submit svg { width: 1.1rem; height: 1.1rem; }

/* ── Full-page chat ─────────────────────────────────────────────────────── */

.ask-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4rem);
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem 0;
}

.ask-page-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem 3rem;
}

.ask-page-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #18181b;
  margin-bottom: 0.5rem;
}

.ask-page-hero p { color: #71717a; margin-bottom: 2rem; }

.ask-page .ask-messages {
  flex: 1;
  max-height: none;
  padding-bottom: 1rem;
}

.ask-page .ask-form {
  position: sticky;
  bottom: 0;
  border-top: 1px solid #e4e4e7;
  background: #fff;
  padding: 1rem;
  margin: 0 -1rem;
}

.ask-page .ask-input { max-height: 12rem; }
