/* ============================================
   Sahayak — free public AI helper page
   ============================================ */

.sahayak-page {
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ---------- Hero ---------- */
.sahayak-hero {
  position: relative;
  padding: 64px 0 28px;
  text-align: center;
  background: var(--hero-grad);
  overflow: hidden;
}
.sahayak-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(26, 20, 16, 0.85);
  color: #fff;
  margin-bottom: 18px;
}
.sahayak-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 14px;
}
.sahayak-title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--orange-3), var(--orange-4));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sahayak-sub {
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ---------- App / mode strip ---------- */
.sahayak-app {
  max-width: 880px;
  margin-top: -10px;
  position: relative;
  z-index: 2;
}
.mode-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 18px 4px 14px;
  margin: 0 -4px;
}
.mode-strip::-webkit-scrollbar { display: none; }
.mode-chip {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.mode-chip:hover { border-color: var(--orange-2); color: var(--ink); }
.mode-chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ---------- Chat card ---------- */
.chat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 520px;
  max-height: 76vh;
}
.chat-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-scroll:empty { display: none; }

/* ---------- Empty state ---------- */
.chat-empty {
  padding: 12px 24px 8px;
  border-bottom: 1px dashed var(--line);
}
.chat-empty.hidden { display: none; }
.empty-suggestions h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.empty-suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.empty-suggestions h3 { grid-column: 1 / -1; }
.sugg-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-cream);
  border: 1px solid var(--line-soft);
  text-align: left;
  align-items: flex-start;
  cursor: pointer;
  transition: var(--transition);
}
.sugg-card:hover {
  background: var(--cream);
  border-color: var(--orange-2);
  transform: translateY(-1px);
}
.sugg-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.sugg-text { display: flex; flex-direction: column; gap: 3px; }
.sugg-text b { font-size: 14px; font-weight: 600; color: var(--ink); }
.sugg-text small { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
@media (max-width: 640px) {
  .empty-suggestions { grid-template-columns: 1fr; }
}

/* ---------- Messages ---------- */
.msg {
  display: flex;
  gap: 12px;
  max-width: 100%;
  animation: msgIn 0.2s var(--ease-out);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.msg-user .msg-avatar    { background: var(--ink); }
.msg-ai .msg-avatar      { background: linear-gradient(135deg, var(--orange-3), var(--orange-4)); }
.msg-body {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg-body img.msg-image {
  max-width: 240px;
  max-height: 240px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 4px 0 8px;
  border: 1px solid var(--line);
}
.msg-body strong { font-weight: 700; }
.msg-body code {
  background: var(--bg-cream);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.msg-ai .msg-body.streaming::after {
  content: "▍";
  color: var(--orange-3);
  animation: caret 0.9s steps(2) infinite;
  margin-left: 2px;
}
@keyframes caret { 50% { opacity: 0; } }
.msg-error .msg-body {
  background: #fff4f1;
  color: #b13313;
  border: 1px solid #ffd4c2;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* ---------- Quick prompts ---------- */
.quick-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-cream, #fbf6f1);
}
.quick-prompts:empty { display: none; }
.quick-prompts[hidden] { display: none; }
.quick-prompts::-webkit-scrollbar { display: none; }
.quick-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.quick-chip:hover {
  border-color: var(--orange-3);
  color: var(--ink);
  background: var(--orange-1, #fde5d8);
}
.quick-chip .qc-emoji { font-size: 13px; }

/* ---------- Input ---------- */
.chat-input {
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attach-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  background: var(--bg-cream);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
}
.attach-thumb {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--orange-1, #fde5d8);
  color: var(--orange-4, #d96a2b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.attach-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.attach-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-size {
  font-size: 11px;
  color: var(--ink-3);
}
.attach-remove {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(26, 20, 16, 0.08);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.attach-remove:hover {
  background: rgba(26, 20, 16, 0.85);
  color: #fff;
}
#chatInput {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  line-height: 1.5;
  max-height: 200px;
  padding: 6px 4px;
}
.chat-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-cream);
  color: var(--ink-2);
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover { background: var(--cream); color: var(--ink); }
.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.send-btn:hover { background: var(--orange-4); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--ink-3); }
.chat-footnote {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 12px;
  line-height: 1.5;
}

/* ---------- Why section ---------- */
.sahayak-why {
  margin-top: 60px;
  padding: 40px 0;
  text-align: center;
}
.sahayak-why h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 400;
  margin-bottom: 10px;
}
.sahayak-why em {
  font-style: italic;
  color: var(--orange-3);
}
.sahayak-why p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}
.sahayak-why a {
  color: var(--orange-4);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}

@media (max-width: 640px) {
  .sahayak-hero { padding: 40px 0 20px; }
  .chat-scroll  { padding: 16px; }
  .chat-input   { padding: 10px; }
  .sahayak-app  { max-width: 100%; }
  .chat-card    { border-radius: var(--radius); min-height: 60vh; }
}
