@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

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

:root {
  --bg:        #080810;
  --bg2:       #0f0f1a;
  --bg3:       #161622;
  --bg4:       #1e1e2e;
  --border:    #1e1e2e;
  --border2:   #2a2a3a;
  --text:      #e8e8f0;
  --text2:     #8888a0;
  --text3:     #44445a;
  --amber:     #f5a623;
  --amber-dim: rgba(245,166,35,0.1);
  --blue:      #4a9eff;
  --blue-dim:  rgba(74,158,255,0.1);
  --green:     #00c853;
  --green-dim: rgba(0,200,83,0.1);
  --red:       #ff3d57;
  --red-dim:   rgba(255,61,87,0.1);
  --mono:      'IBM Plex Mono', 'Courier New', monospace;
  --sans:      'IBM Plex Sans', sans-serif;
  --nav-h:     48px;
  --tab-h:     56px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── TOP NAV ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.5px;
  margin-right: 2.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.nav-logo-icon span {
  display: block;
  width: 4px;
  background: var(--blue);
  border-radius: 1px 1px 0 0;
}

.nav-logo-icon span:nth-child(1) { height: 8px; }
.nav-logo-icon span:nth-child(2) { height: 12px; }
.nav-logo-icon span:nth-child(3) { height: 16px; background: var(--amber); }
.nav-logo-icon span:nth-child(4) { height: 10px; }

.nav-logo-text { display: flex; align-items: baseline; gap: 0; }
.nav-logo-text .w { color: var(--text); }
.nav-logo-text .a { color: var(--amber); }

.nav-links {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--amber); border-bottom-color: var(--amber); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.nav-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  letter-spacing: 0.5px;
}

.nav-badge-dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

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

.nav-tg-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 28px;
  background: var(--blue-dim);
  border: 1px solid rgba(74,158,255,0.25);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: background 0.15s;
}

.nav-tg-btn:hover { background: rgba(74,158,255,0.2); }

/* ── MOBILE BOTTOM TAB BAR ── */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-tabs-inner {
  display: flex;
  height: 100%;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.15s;
  padding-top: 6px;
}

.tab-item.active { color: var(--amber); }
.tab-item:hover { color: var(--text2); }

.tab-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── TICKER TAPE ── */
.ticker-tape {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: 28px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-inner {
  display: flex;
  gap: 2.5rem;
  animation: scroll-left 30s linear infinite;
  white-space: nowrap;
  padding-left: 100%;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3px;
}

.ticker-name { color: var(--text2); }
.ticker-val { color: var(--text); font-weight: 600; }
.ticker-chg.up { color: var(--green); }
.ticker-chg.dn { color: var(--red); }

/* ── PAGE WRAPPER ── */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* ── PAGE HEADER ── */
.page-header {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.page-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.4rem;
}

.page-title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.page-title-hindi {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--text3);
  margin-top: 2px;
}

.page-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.3px;
  margin-top: 0.5rem;
}

/* ── STAT ROW ── */
.stat-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.stat-cell {
  flex: 1;
  padding: 0.75rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--bg2);
}

.stat-cell:last-child { border-right: none; }

.stat-cell-val {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 3px;
}

.stat-cell-val.pos { color: var(--green); }
.stat-cell-val.neg { color: var(--red); }
.stat-cell-val.amb { color: var(--amber); }

.stat-cell-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text3);
}

/* ── DATA TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
}

.data-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  white-space: nowrap;
}

.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.data-table tr:hover td { background: var(--bg2); }
.data-table tr:last-child td { border-bottom: none; }

/* ── PILL BADGES ── */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.pill-buy { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,200,83,0.2); }
.pill-sell { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,61,87,0.2); }
.pill-hold { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,166,35,0.2); }
.pill-win { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,200,83,0.2); }
.pill-loss { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,61,87,0.2); }
.pill-pending { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,166,35,0.2); }

/* ── ANALYST CARD (leaderboard) ── */
.analyst-row {
  display: grid;
  grid-template-columns: 2rem 3rem 1fr 80px 80px 80px 80px 6rem;
  align-items: center;
  gap: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  cursor: default;
}

.analyst-row:hover { background: var(--bg2); }

.analyst-row-rank {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
}

.analyst-row-rank.gold { color: #ffd700; }
.analyst-row-rank.silver { color: #c0c0c0; }
.analyst-row-rank.bronze { color: #cd7f32; }

.analyst-row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  border: 1px solid var(--border2);
}

.analyst-row-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
}

.analyst-row-name {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  padding-left: 0.75rem;
}

.analyst-row-name a {
  color: inherit;
  text-decoration: none;
}

.analyst-row-name a:hover { color: var(--amber); }

.analyst-row-name-sub {
  font-size: 9px;
  color: var(--text3);
  font-weight: 400;
  margin-top: 1px;
}

.data-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  padding-right: 0.5rem;
}

.data-val.pos { color: var(--green); }
.data-val.neg { color: var(--red); }
.data-val.neu { color: var(--text); }
.data-val.dim { color: var(--text2); }

/* Win rate bar inline */
.win-bar-wrap { display: flex; align-items: center; gap: 6px; }
.win-bar { flex: 1; height: 3px; background: var(--border2); border-radius: 1px; overflow: hidden; }
.win-bar-fill { height: 100%; background: var(--green); border-radius: 1px; transition: width 0.8s ease; }

/* ── SEARCH INPUT ── */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 3px;
  padding: 0 1rem;
  height: 44px;
  transition: border-color 0.15s;
}

.search-box:focus-within { border-color: var(--amber); }

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.3px;
}

.search-box input::placeholder { color: var(--text3); }

.search-box svg { color: var(--text3); flex-shrink: 0; }

/* ── SUGGESTIONS DROPDOWN ── */
.suggestions {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-top: none;
  border-radius: 0 0 3px 3px;
  overflow: hidden;
  z-index: 50;
}

.suggestion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.suggestion-row:last-child { border-bottom: none; }
.suggestion-row:hover { background: var(--bg3); }

.suggestion-name { font-family: var(--mono); font-size: 11px; color: var(--text); font-weight: 500; }
.suggestion-ticker { font-family: var(--mono); font-size: 10px; color: var(--amber); margin-top: 1px; }
.suggestion-count { font-family: var(--mono); font-size: 10px; color: var(--text3); }

/* ── CHIP TAGS ── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}

.chip:hover { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }

/* ── TIMELINE ── */
.timeline-wrap { position: relative; }
.timeline-wrap::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.timeline-dot {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  margin-top: 0.8rem;
  z-index: 1;
}

.timeline-dot.win { border-color: var(--green); color: var(--green); }
.timeline-dot.loss { border-color: var(--red); color: var(--red); }
.timeline-dot.pending { border-color: var(--amber); color: var(--amber); }

.timeline-card {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border2);
  border-radius: 0 3px 3px 0;
  padding: 0.75rem 1rem;
  transition: border-color 0.15s;
}

.timeline-card:hover { border-color: var(--border2); }
.timeline-card.win { border-left-color: var(--green); }
.timeline-card.loss { border-left-color: var(--red); }
.timeline-card.pending { border-left-color: var(--amber); }

.timeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.timeline-analyst {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.timeline-analyst a { color: inherit; text-decoration: none; }
.timeline-analyst a:hover { color: var(--amber); }

.timeline-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
}

.timeline-prices {
  display: flex;
  gap: 1.5rem;
  margin: 0.4rem 0;
  flex-wrap: wrap;
}

.timeline-price-item { display: flex; flex-direction: column; gap: 1px; }

.timeline-price-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.timeline-price-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.timeline-excerpt {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
  margin-top: 0.4rem;
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 0.4rem;
}

.timeline-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.return-val {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.return-val.pos { color: var(--green); }
.return-val.neg { color: var(--red); }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 3px 3px 0 0;
}

.section-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text2);
}

.section-title-hindi {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--text3);
  margin-left: 0.5rem;
}

.section-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
}

/* ── TABLE WRAPPER ── */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 0 0 3px 3px;
  overflow: hidden;
  overflow-x: auto;
}

/* ── PROFILE HEADER ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border2);
  flex-shrink: 0;
}

.profile-avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--amber);
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.profile-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

.social-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--border2);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--text2);
  transition: all 0.15s;
}

.social-btn:hover { border-color: var(--amber); color: var(--amber); }
.social-btn.yt { color: #ff4444; border-color: rgba(255,68,68,0.2); }
.social-btn.yt:hover { background: rgba(255,68,68,0.08); }
.social-btn.tw { color: var(--blue); border-color: rgba(74,158,255,0.2); }
.social-btn.tw:hover { background: var(--blue-dim); }

/* ── BACK LINK ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text3);
  text-decoration: none;
  text-transform: uppercase;
  padding: 0.75rem 0;
  transition: color 0.15s;
}

.back-link:hover { color: var(--amber); }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.3px;
  line-height: 1.9;
  text-align: center;
}

.site-footer a { color: var(--text3); text-decoration: none; }
.site-footer a:hover { color: var(--amber); }

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
  .top-nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .bottom-tabs { display: flex; }
  .page { padding: 0 1rem 5rem; }
  .stat-row { flex-wrap: wrap; }
  .stat-cell { flex: 1 1 calc(50% - 0px); min-width: 0; }
  .analyst-row {
    grid-template-columns: 1.5rem 2.5rem 1fr 70px 70px;
    gap: 0;
  }
  .analyst-row .hide-mobile { display: none; }
  .data-table th:nth-child(n+5),
  .data-table td:nth-child(n+5) { display: none; }
  .nav-right .nav-tg-btn { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .page { padding: 0 1.25rem 2rem; }
  .analyst-row { grid-template-columns: 2rem 3rem 1fr 80px 80px 80px; }
  .analyst-row .hide-tablet { display: none; }
}

@media (min-width: 1024px) {
  .page { padding: 0 2rem 3rem; }
}

/* ── UTILITY ── */
.mono { font-family: var(--mono); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.amb { color: var(--amber); }
.dim { color: var(--text3); }
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 2px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 3rem; font-family: var(--mono); font-size: 11px; color: var(--text3); letter-spacing: 0.5px; }
