/* ============================================================
   Ask InsureCat — Styles
   Palette: InsurEco brand — deep blue #2e3192, hot pink/red #ec008c,
   gold #ffcb05, slate #334047, near-black bg
   ============================================================ */

/* --- Reset & base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #0a0a0f;
  --bg-surface:   #10101a;
  --bg-card:      #14141f;
  --brand-blue:   #2e3192;
  --brand-pink:   #ec008c;
  --brand-gold:   #ffcb05;
  --brand-slate:  #334047;
  --accent-red:   #c8003a;
  --accent-purple:#7b2d8b;
  --accent-violet:#a855f7;
  --text-primary: #f0f0f5;
  --text-muted:   #6b7280;
  --text-dim:     #9ca3af;
  --border:       #1e1e2e;
  --border-glow:  #ec008c55;
  --cat-color:    #e2e8f0;
  --font-mono:    'Courier New', Courier, monospace;
  --font-ui:      'Segoe UI', system-ui, sans-serif;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Subtle scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.insureco-logo {
  height: 38px;
  width: auto;
  /* Invert the dark fill to look good on dark bg, keep gradients */
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(236,0,140,0.4));
}

/* ============================================================
   MAIN
   ============================================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 32px;
  gap: 32px;
}

/* --- Hero tagline --- */
.hero-tagline {
  text-align: center;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.tagline-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-right: 6px;
}

.tagline-name {
  color: var(--brand-pink);
  font-size: 1rem;
  font-weight: bold;
  text-shadow: 0 0 16px rgba(236,0,140,0.6);
}

.tagline-sub {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-left: 4px;
}

/* ============================================================
   CAT STAGE
   ============================================================ */
.cat-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 700px;
}

/* --- Speech bubble --- */
.speech-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  padding: 16px 22px;
  max-width: 580px;
  width: 100%;
  min-height: 72px;
  position: relative;
  box-shadow: 0 0 20px rgba(236,0,140,0.08), inset 0 0 30px rgba(0,0,0,0.3);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  transition: border-color 0.3s ease;
}

/* Bubble tail pointing down to cat */
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--border-glow);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid var(--bg-card);
  z-index: 1;
}

.speech-bubble.thinking {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.12);
}

.speech-bubble.answering {
  border-color: rgba(236, 0, 140, 0.6);
  box-shadow: 0 0 24px rgba(236, 0, 140, 0.15);
}

#speechText {
  min-height: 1.6em;
}

/* Cursor blink for typewriter */
#speechText.typing::after {
  content: '█';
  animation: blink 0.7s step-end infinite;
  color: var(--brand-pink);
  font-size: 0.85em;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* --- Cat art --- */
.cat-container {
  position: relative;
}

.cat-art {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 1.5vw, 0.82rem);
  line-height: 1.25;
  color: var(--cat-color);
  text-align: left;
  white-space: pre;
  text-shadow: 0 0 10px rgba(236,0,140,0.2);
  transition: color 0.4s ease, text-shadow 0.4s ease;
  user-select: none;
}

.cat-art.thinking {
  color: #c4b5fd;
  text-shadow: 0 0 12px rgba(168,85,247,0.4);
}

.cat-art.answering {
  color: #fda4d0;
  text-shadow: 0 0 12px rgba(236,0,140,0.5);
}

/* ============================================================
   ASK SECTION
   ============================================================ */
.ask-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 640px;
}

.ask-bar-wrapper {
  display: flex;
  width: 100%;
  gap: 0;
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(236,0,140,0.08);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.ask-bar-wrapper:focus-within {
  border-color: var(--brand-pink);
  box-shadow: 0 0 28px rgba(236,0,140,0.2);
}

.ask-input {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-primary);
  border: none;
  outline: none;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  caret-color: var(--brand-pink);
}

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

.ask-btn {
  background: linear-gradient(135deg, var(--brand-pink), var(--accent-red));
  color: #fff;
  border: none;
  padding: 14px 22px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.ask-btn:hover {
  background: linear-gradient(135deg, #ff1aa0, var(--brand-pink));
}

.ask-btn:active {
  transform: scale(0.97);
}

.ask-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ask-btn-arrow {
  font-size: 0.7rem;
}

/* --- Knowledge panel --- */
.knowledge-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 680px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

/* Pre-fill chip variant — clickable, sets input text without auto-submitting */
.chip--prefill {
  opacity: 0.8;
}

/* California law chip variant */
.chip--ca {
  border-color: rgba(245,158,11,0.3);
  color: rgba(245,158,11,0.85);
}
.chip--ca:hover {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.6);
  color: rgba(245,158,11,1);
}

/* --- Quick chips --- */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.chip-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 2px;
}

.chip {
  background: transparent;
  border: 1px solid #2a1a3a;
  color: var(--accent-violet);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.chip:hover {
  background: rgba(168,85,247,0.12);
  border-color: var(--accent-violet);
  color: #d8b4fe;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  border-top: 1px solid var(--border);
  letter-spacing: 0.04em;
}

/* ============================================================
   COSTUME SWITCHER
   ============================================================ */
.costume-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.costume-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 2px;
}

.costume-btn {
  background: transparent;
  border: 1px solid #1e1e2e;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.costume-btn:hover {
  background: rgba(236,0,140,0.08);
  border-color: rgba(236,0,140,0.35);
  color: var(--text-primary);
}

.costume-btn.active {
  background: rgba(236,0,140,0.14);
  border-color: var(--brand-pink);
  color: var(--brand-pink);
  box-shadow: 0 0 12px rgba(236,0,140,0.2);
}

/* Sleeping mode — blue-purple tint */
.cat-art.sleeping-idle {
  color: #93c5fd;
  text-shadow: 0 0 10px rgba(147,197,253,0.3);
}

/* Keyboard Cat mode — cyan/teal tint */
.cat-art.dancing-idle {
  color: #67e8f9;
  text-shadow: 0 0 12px rgba(103,232,249,0.35);
}

/* Pasta mode — warm orange tint */
.cat-art.pasta-idle {
  color: #fca5a5;
  text-shadow: 0 0 10px rgba(252,165,165,0.3);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .main-content {
    padding: 24px 16px 24px;
    gap: 24px;
  }

  .cat-art {
    font-size: 0.6rem;
  }

  .tagline-sub {
    display: none;
  }

  .quick-chips {
    gap: 6px;
  }

  .ask-btn-text {
    display: none;
  }

  .ask-btn {
    padding: 14px 16px;
  }
}
