/* ============================================================
   style.css — MarketPulse Sentiment Predictor
   Sections:
     1. Reset & Variables
     2. Base / Body
     3. Navigation
     4. Layout
     5. Hero
     6. Input Card
     7. Tabs
     8. Form Elements
     9. Analyze Button & Spinner
    10. Result Card
    11. Gauge & Breakdown Bars
    12. Sample Prompts
    13. Footer
    14. Animations
   ============================================================ */


/* ── 1. Reset & Variables ─────────────────────────────────── */

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

:root {
  --bg:        #080608;
  --surface:   #100d10;
  --card:      #160f16;
  --border:    #2a1a2a;
  --border2:   #3d2040;
  --text:      #fffeff;
  --muted:     #b9a3b9;
  --dim:       #744b74;

  --pink:      #f0429a;
  --pink-dim:  #5c0f38;
  --rose:      #ff9ed2;
  --rose-dim:  #4a0a2a;
  --magenta:   #c020a0;
  --magenta-dim: #400830;

  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}


/* ── 2. Base / Body ───────────────────────────────────────── */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ── 3. Navigation ────────────────────────────────────────── */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(8, 6, 8, 0.92);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 10px var(--pink);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.nav-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--muted);
  letter-spacing: 0.06em;
}


/* ── 4. Layout ────────────────────────────────────────────── */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1.5rem 6rem;
}


/* ── 5. Hero ──────────────────────────────────────────────── */

.hero {
  text-align: center;
  margin-bottom: 3.5rem;
  animation: fade-up 0.6s ease both;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--pink);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

h1 {
  font-family: var(--sans);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}

h1 strong {
  font-weight: 600;
  background: linear-gradient(90deg, #f0429a, #ff9ed2, #ffe1f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 300;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}


/* ── 6. Input Card ────────────────────────────────────────── */

.input-card {
  width: 100%;
  max-width: 680px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  animation: fade-up 0.6s 0.1s ease both;
}


/* ── 7. Tabs ──────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.tab {
  flex: 1;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-family: var(--sans);
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
  letter-spacing: 0.01em;
}

.tab.active {
  background: var(--border2);
  color: var(--text);
}

.tab:hover:not(.active) {
  color: var(--text);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}


/* ── 8. Form Elements ─────────────────────────────────────── */

label.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

textarea,
input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.6;
  padding: 0.85rem 1rem;
  resize: vertical;
  transition: border-color 0.2s;
  outline: none;
}

textarea {
  min-height: 110px;
}

textarea:focus,
input[type="text"]:focus {
  border-color: var(--pink-dim);
  box-shadow: 0 0 0 2px rgba(240, 66, 154, 0.08);
}

textarea::placeholder,
input::placeholder {
  color: var(--dim);
}

.ticker-row {
  display: flex;
  gap: 10px;
}

.ticker-row input {
  flex: 1;
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--dim);
  margin-top: 0.4rem;
}


/* ── 9. Analyze Button & Spinner ──────────────────────────── */

.btn-analyze {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  background: linear-gradient(90deg, #c020a0, #f0429a);
  color: #f5eef5;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-analyze:hover   { opacity: 0.88; }
.btn-analyze:active  { transform: scale(0.98); }
.btn-analyze:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-analyze svg {
  width: 16px;
  height: 16px;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(245, 238, 245, 0.3);
  border-top-color: #f5eef5;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}


/* ── 10. Result Card ──────────────────────────────────────── */

#result {
  width: 100%;
  max-width: 680px;
  margin-top: 1.5rem;
  animation: fade-up 0.4s ease both;
}

#result.hidden {
  display: none;
}

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
}

.result-label-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sentiment-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 6px;
}

.badge-bullish { background: var(--pink-dim);    color: var(--pink);    }
.badge-bearish { background: var(--magenta-dim); color: var(--magenta); }
.badge-neutral { background: var(--rose-dim);    color: var(--rose);    }

.result-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.result-score-text {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
}

.score-bullish { color: var(--pink);    }
.score-bearish { color: var(--magenta); }
.score-neutral { color: var(--rose);    }

.result-body {
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.result-summary {
  background: var(--surface);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
  font-style: italic;
  border-left: 2px solid var(--pink-dim);
}

.result-summary span {
  color: var(--text);
  font-style: normal;
}

.result-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--dim);
  letter-spacing: 0.06em;
  padding: 0.75rem 1.75rem;
  border-top: 1px solid var(--border);
}


/* ── 11. Gauge & Breakdown Bars ───────────────────────────── */

.gauge-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.gauge-track {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  position: relative;
}

.gauge-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fill-bullish { background: linear-gradient(90deg, #f0429a, #f8a5cf); }
.fill-bearish { background: linear-gradient(90deg, #c020a0, #ca9cc1); }
.fill-neutral { background: linear-gradient(90deg, #ff9ed2, #fff0f8); }

.breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 80px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.breakdown-key {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.mini-track {
  background: var(--surface);
  border-radius: 3px;
  height: 4px;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.breakdown-val {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-align: right;
}


/* ── 12. Sample Prompts ───────────────────────────────────── */

.samples-section {
  width: 100%;
  max-width: 680px;
  margin-top: 2rem;
  animation: fade-up 0.6s 0.2s ease both;
}

.samples-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.samples-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sample-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}

.sample-chip:hover {
  border-color: var(--pink-dim);
  color: var(--text);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--pink-dim);
}


/* ── 13. Footer ───────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--dim);
  letter-spacing: 0.06em;
}


/* ── 14. Animations ───────────────────────────────────────── */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1);   box-shadow: 0 0 10px var(--pink); }
  50%       { opacity: 0.5; transform: scale(0.7); box-shadow: 0 0 4px var(--pink);  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}