/* ============================================
   SEMANTIC NLP AGENT — STYLES
   Palette: Indigo Ink
   Fonts: Cormorant Garamond + Manrope
   ============================================ */

:root {
  --bg:        #0D0818;
  --bg2:       #130D24;
  --bg3:       #1B1235;
  --surface:   #1F1640;
  --surface2:  #261C4E;
  --border:    rgba(123, 104, 238, 0.18);
  --border2:   rgba(123, 104, 238, 0.35);
  --accent:    #7B68EE;
  --accent2:   #9B8FFF;
  --accent3:   #C4BAFF;
  --text:      #E8E0F0;
  --text2:     #B8A8D8;
  --text3:     #7A6A9A;
  --critical:  #FF6B8A;
  --high:      #FFB347;
  --medium:    #7B68EE;
  --low:       #5A8A6A;
  --semantic:  #5B9BD5;
  --nlp:       #5BAD72;
  --entity:    #E8924A;
  --signal:    #E85A6A;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 8, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.logo-text {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: var(--text2);
  letter-spacing: 0.02em;
}
.logo-text strong {
  font-weight: 700;
  color: var(--text);
}
.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(123, 104, 238, 0.12);
  border: 1px solid var(--border2);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── HERO ── */
.hero {
  position: relative;
  padding: 52px 20px 40px;
  overflow: hidden;
}
.hero-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.orb1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(123,104,238,0.18) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.orb2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(91,155,213,0.12) 0%, transparent 70%);
  bottom: -50px; right: -80px;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}
.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 8vw, 52px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}
.hero-title em {
  font-style: italic;
  color: var(--accent2);
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text2);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.3s forwards;
}

/* ── INPUT CARD ── */
.input-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  opacity: 0;
  animation: fadeUp 0.6s ease 0.4s forwards;
}
.input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  gap: 10px;
  transition: border-color 0.2s;
  margin-bottom: 14px;
}
.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123,104,238,0.15);
}
.input-icon { font-size: 16px; flex-shrink: 0; }
.topic-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding: 14px 0;
  caret-color: var(--accent);
}
.topic-input::placeholder { color: var(--text3); font-weight: 400; }
.clear-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.clear-btn:hover { color: var(--text); }

/* ── CHIPS ── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.chip {
  background: rgba(123,104,238,0.08);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover {
  background: rgba(123,104,238,0.2);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* ── ANALYZE BUTTON ── */
.analyze-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #5B4FCC);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 15px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(123,104,238,0.4);
}
.analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(123,104,238,0.55);
}
.analyze-btn:active { transform: translateY(0); }
.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-loader { display: inline-block; animation: spin 1s linear infinite; }

/* ── STATS BAR ── */
.stats-bar {
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeUp 0.4s ease forwards;
}
.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  gap: 4px;
}
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent2);
  line-height: 1;
}
.stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── RESULTS SECTION ── */
.results {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* ── FILTER TABS ── */
.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab:hover { border-color: var(--accent); color: var(--text); }
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(123,104,238,0.4);
}

/* ── DOWNLOAD BAR ── */
.download-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(123,104,238,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.download-label {
  flex: 1;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}
.dl-btn {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.dl-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.dl-json { color: var(--accent2); }

/* ── RESULT CARDS ── */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all 0.2s;
  animation: fadeUp 0.3s ease forwards;
  opacity: 0;
}
.result-card:hover {
  border-color: var(--border2);
  transform: translateX(3px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.card-category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.dot-semantic { background: var(--semantic); }
.dot-nlp      { background: var(--nlp); }
.dot-entity   { background: var(--entity); }
.dot-signal   { background: var(--signal); }

.card-term {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  line-height: 1.3;
}
.card-importance {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}
.imp-CRITICAL { background: rgba(255,107,138,0.15); color: var(--critical); border: 1px solid rgba(255,107,138,0.3); }
.imp-HIGH     { background: rgba(255,179,71,0.12);  color: var(--high);     border: 1px solid rgba(255,179,71,0.3); }
.imp-MEDIUM   { background: rgba(123,104,238,0.12); color: var(--accent2);  border: 1px solid rgba(123,104,238,0.3); }
.imp-LOW      { background: rgba(90,138,106,0.12);  color: var(--low);      border: 1px solid rgba(90,138,106,0.3); }

.card-definition {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 8px;
}
.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 3px 8px;
  border-radius: 6px;
}
.meta-tag span { color: var(--accent3); }

/* ── EMPTY STATE ── */
.empty-state {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}
.empty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.empty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  transition: all 0.3s;
  animation: fadeUp 0.5s ease forwards;
  opacity: 0;
}
.ec1 { animation-delay: 0.1s; }
.ec2 { animation-delay: 0.2s; }
.ec3 { animation-delay: 0.3s; }
.ec4 { animation-delay: 0.4s; }
.empty-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.ec-icon { font-size: 24px; margin-bottom: 10px; }
.ec-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.ec-desc {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.6;
}

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.04em;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 4px; }

/* ── RESPONSIVE ── */
@media (max-width: 400px) {
  .hero-title { font-size: 28px; }
  .empty-grid { grid-template-columns: 1fr; }
  .stat-num { font-size: 22px; }
}