/* ============================================
   StraightShot — Honest AI Core
   ============================================ */

:root {
  --ai-bg: var(--cream);
  --ai-surface: #FFFFFF;
  --ai-border: rgba(27, 67, 50, 0.12);
  --ai-text: var(--forest);
  --ai-text-muted: var(--forest-mid);
  --ai-accent: var(--gold);
  --ai-assistant-bg: #F0F7F4;
  --ai-user-bg: #1B4332;
  --ai-user-text: var(--cream);
  --ai-log-border: #E8F0EC;
  --ai-badge-honest: #2D6A4F;
  --ai-badge-limitation: #8B6914;
  --ai-badge-warning: #9B2C2C;
}

.ai-core {
  padding: 6rem 8rem;
  background: var(--cream-warm);
}

.ai-core-header {
  text-align: center;
  margin-bottom: 3rem;
}

.ai-core-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: block;
}

.ai-core-title {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--forest);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.ai-core-sub {
  font-size: 0.95rem;
  color: var(--text-dark-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Chat container */
.ai-chat-wrapper {
  max-width: 840px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.ai-chat-panel {
  background: var(--ai-surface);
  border: 1.5px solid var(--ai-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(27, 67, 50, 0.06);
}

/* Honest badge */
.ai-honest-badge {
  background: var(--ai-badge-honest);
  color: var(--cream);
  padding: 0.4rem 1rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

.ai-honest-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5DBF8A;
  box-shadow: 0 0 0 2px rgba(93, 191, 138, 0.3);
}

/* Chat messages */
.ai-messages {
  height: 360px;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.ai-messages::-webkit-scrollbar { width: 4px; }
.ai-messages::-webkit-scrollbar-track { background: transparent; }
.ai-messages::-webkit-scrollbar-thumb { background: var(--ai-border); border-radius: 2px; }

.ai-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.6;
  animation: msgIn 0.25s ease-out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-msg.user {
  align-self: flex-end;
  background: var(--ai-user-bg);
  color: var(--ai-user-text);
  border-bottom-right-radius: 4px;
}

.ai-msg.assistant {
  align-self: flex-start;
  background: var(--ai-assistant-bg);
  color: var(--ai-text);
  border-bottom-left-radius: 4px;
}

.ai-msg-meta {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.35rem;
  opacity: 0.6;
}

.ai-msg.assistant .ai-msg-meta { color: var(--ai-badge-honest); }
.ai-msg.user .ai-msg-meta { color: var(--text-muted); }

/* Typing indicator */
.ai-typing {
  align-self: flex-start;
  background: var(--ai-assistant-bg);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 0.75rem 1rem;
  display: none;
  gap: 4px;
  align-items: center;
}

.ai-typing.visible { display: flex; }

.ai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest-mid);
  opacity: 0.5;
  animation: typingDot 1.2s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Input area */
.ai-input-area {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--ai-border);
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.ai-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--ai-border);
  border-radius: 10px;
  font-size: 0.875rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ai-text);
  background: var(--cream);
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}

.ai-input:focus {
  border-color: var(--forest-mid);
}

.ai-input::placeholder { color: var(--text-dark-muted); }

.ai-send-btn {
  background: var(--forest);
  color: var(--cream);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: 'DM Sans', system-ui, sans-serif;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-send-btn:hover { background: var(--forest-mid); }
.ai-send-btn:active { transform: scale(0.97); }
.ai-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Quick prompts */
.ai-quick-prompts {
  padding: 0 1.25rem 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-quick-prompt {
  background: transparent;
  border: 1.5px solid var(--ai-border);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  color: var(--ai-text-muted);
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.ai-quick-prompt:hover {
  border-color: var(--forest-mid);
  color: var(--forest);
  background: var(--cream);
}

/* Decision log panel */
.ai-log-panel {
  background: var(--ai-surface);
  border: 1.5px solid var(--ai-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(27, 67, 50, 0.06);
}

.ai-log-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ai-border);
  background: var(--forest);
}

.ai-log-title {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.05em;
}

.ai-log-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.ai-log-entries {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 440px;
  overflow-y: auto;
}

.ai-log-entries::-webkit-scrollbar { width: 3px; }
.ai-log-entries::-webkit-scrollbar-thumb { background: var(--ai-border); }

.ai-log-entry {
  border: 1px solid var(--ai-log-border);
  border-radius: 8px;
  overflow: hidden;
}

.ai-log-entry-header {
  padding: 0.5rem 0.75rem;
  background: var(--cream);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.ai-log-role {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ai-log-role.user { color: var(--forest); }
.ai-log-role.assistant { color: var(--ai-badge-honest); }

.ai-log-type {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-log-type.general { background: #F0F7F4; color: var(--ai-badge-honest); }
.ai-log-type.limitation_admission { background: #FEF9EC; color: #8B6914; }
.ai-log-type.knowledge_boundary { background: #F3F0FF; color: #6B5FA8; }
.ai-log-type.pricing_transparency { background: #F0FDF4; color: #166534; }
.ai-log-type.upsell_check_failed { background: #FEF2F2; color: #9B2C2C; }
.ai-log-type.capability_response { background: #F0F7F4; color: var(--ai-badge-honest); }

.ai-log-content {
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  color: var(--ai-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-log-time {
  font-size: 0.6rem;
  color: var(--text-dark-muted);
  padding: 0.3rem 0.75rem;
  background: var(--cream);
  border-top: 1px solid var(--ai-log-border);
}

/* Manifest card */
.ai-manifest {
  background: var(--ai-surface);
  border: 1.5px solid var(--ai-border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}

.ai-manifest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.ai-manifest-col h3 {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.ai-manifest-col.can h3 { color: var(--ai-badge-honest); }
.ai-manifest-col.cannot h3 { color: #9B2C2C; }

.ai-manifest-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ai-manifest-list li {
  font-size: 0.82rem;
  color: var(--ai-text-muted);
  line-height: 1.5;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.ai-manifest-list li::before {
  content: '';
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border-radius: 50%;
}

.ai-manifest-col.can li::before { background: #2D6A4F; }
.ai-manifest-col.cannot li::before { background: #9B2C2C; }

/* Responsive */
@media (max-width: 900px) {
  .ai-core { padding: 5rem 2.5rem; }
  .ai-chat-wrapper { grid-template-columns: 1fr; }
  .ai-log-panel { display: none; }
  .ai-manifest-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .ai-core { padding: 4rem 1.5rem; }
}