:root {
  --bg: #0a0e17;
  --bg-card: #131826;
  --bg-card-hover: #1a2030;
  --border: #1e2538;
  --text: #e4e7ef;
  --text-dim: #8b92a8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.7;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.header {
  background: linear-gradient(135deg, #131826 0%, #1a1f35 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 0; position: sticky; top: 0; z-index: 100;
}
.header-content {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.logo { display: flex; align-items: center; gap: 14px; }
.logo-icon { font-size: 36px; }
.logo h1 { font-size: 22px; font-weight: 700; }
.logo p { font-size: 13px; color: var(--text-dim); }
.header-actions { display: flex; gap: 10px; }
.btn {
  padding: 10px 20px; border-radius: 10px; border: none;
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); }
.market-selector { padding: 24px 0; }
.market-selector h3 { font-size: 16px; color: var(--text-dim); margin-bottom: 16px; }
.market-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.market-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: all 0.2s; text-align: center;
}
.market-card:hover { background: var(--bg-card-hover); border-color: var(--primary); }
.market-card.active { border-color: var(--primary); background: rgba(99,102,241,0.1); }
.market-card .mc-symbol { font-size: 20px; font-weight: 700; }
.market-card .mc-name { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.market-card .mc-price { font-size: 14px; margin-top: 8px; }
.market-card .mc-change { font-size: 12px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: var(--yellow); }
.main-content { padding-bottom: 40px; display: grid; gap: 20px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h2 { font-size: 18px; font-weight: 600; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-bullish, .badge-POSITIVE { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-bearish, .badge-NEGATIVE { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-neutral, .badge-NEUTRAL { background: rgba(245,158,11,0.15); color: var(--yellow); }
.price-display { display: flex; flex-direction: column; gap: 12px; }
.price-main { display: flex; align-items: baseline; gap: 16px; }
.price-value { font-size: 36px; font-weight: 700; }
.price-change { font-size: 18px; font-weight: 600; }
.price-meta { display: flex; gap: 24px; font-size: 13px; color: var(--text-dim); }
.prediction-content { display: flex; flex-direction: column; gap: 16px; }
.pred-reasoning { font-size: 14px; color: var(--text-dim); line-height: 1.8; }
.pred-factors { display: flex; flex-wrap: wrap; gap: 8px; }
.pred-factor {
  background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3);
  padding: 6px 12px; border-radius: 8px; font-size: 13px;
}
.pred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.pred-stat { background: rgba(255,255,255,0.03); border-radius: 10px; padding: 12px 16px; }
.pred-stat .label { font-size: 12px; color: var(--text-dim); }
.pred-stat .value { font-size: 18px; font-weight: 600; margin-top: 4px; }
.sentiment-content { display: flex; flex-direction: column; gap: 16px; }
.sentiment-bar { display: flex; height: 24px; border-radius: 12px; overflow: hidden; }
.sentiment-bar .seg-positive { background: var(--green); }
.sentiment-bar .seg-negative { background: var(--red); }
.sentiment-bar .seg-neutral { background: var(--yellow); }
.sentiment-legend { display: flex; gap: 20px; font-size: 13px; }
.sentiment-legend span { display: flex; align-items: center; gap: 6px; }
.sentiment-legend .dot { width: 10px; height: 10px; border-radius: 50%; }
.news-feed { display: flex; flex-direction: column; gap: 12px; }
.news-item {
  background: rgba(255,255,255,0.02); border-radius: 12px;
  padding: 16px; border: 1px solid var(--border);
}
.news-item .ni-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.news-item .ni-title { font-size: 14px; font-weight: 500; }
.news-item .ni-sentiment { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.news-item .ni-source { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.analyzer-content { display: flex; flex-direction: column; gap: 12px; }
.analyzer-content textarea {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; color: var(--text);
  font-family: inherit; font-size: 14px; resize: vertical;
}
.analyzer-content textarea:focus { outline: none; border-color: var(--primary); }
.analyzer-actions { display: flex; gap: 10px; }
.symbol-input {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; color: var(--text);
  font-family: inherit; font-size: 14px; width: 150px;
}
.custom-result {
  background: rgba(99,102,241,0.05); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-top: 8px;
}
.custom-result .cr-sentiment { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.custom-result .cr-text { font-size: 14px; color: var(--text-dim); }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal-content {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; max-width: 400px; width: 90%;
}
.modal-content h3 { margin-bottom: 16px; }
.modal-input {
  width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; color: var(--text);
  font-family: inherit; font-size: 14px; margin-bottom: 12px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.footer {
  text-align: center; padding: 30px 20px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-dim);
}
.loading { text-align: center; padding: 30px; color: var(--text-dim); }
.loading-text { color: var(--text-dim); font-size: 14px; }
@media (max-width: 768px) {
  .header-content { flex-direction: column; gap: 12px; }
  .market-cards { grid-template-columns: repeat(2, 1fr); }
  .price-value { font-size: 28px; }
  .price-meta { flex-direction: column; gap: 6px; }
}
