/* =============================================================
   NBA Trend Intelligence - Core Component Styles
   Theme: High-Density Dark Slate Carbon (Non-AI-Slop Standard)
   ============================================================= */

/* -------------------------------------------------------------
   1. Data Tables (Leaderboard & Breakdown)
   ------------------------------------------------------------- */
.table-container {
  width: 100%;
  overflow-x: auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.breakout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.breakout-table thead {
  background-color: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 10;
}

.breakout-table th {
  padding: 0.65rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}

.breakout-table th.num-col,
.breakout-table td.num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.breakout-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.12s ease;
  cursor: pointer;
}

.breakout-table tbody tr:hover {
  background-color: var(--bg-surface-elevated);
}

.breakout-table td {
  padding: 0.65rem 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  vertical-align: middle;
}

.breakout-table td .sub-stat {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 0.1rem;
}

/* Player Cell Avatar & Metadata */
.player-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.player-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.player-name-link {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.player-name-link:hover {
  color: var(--tappa-orange);
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.team-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--text-secondary);
  background-color: var(--bg-app);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* -------------------------------------------------------------
   2. Velocity Scores & Tier Badges
   ------------------------------------------------------------- */
.velocity-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-block;
}

.velocity-score.tier-1 { color: var(--accent-blue); }
.velocity-score.tier-2 { color: var(--accent-emerald); }
.velocity-score.tier-3 { color: var(--accent-amber); }
.velocity-score.base   { color: var(--text-muted); }

.stat-tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.stat-tag.tier-1,
.stat-tag.blue {
  background-color: var(--accent-blue-dim);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-border);
}

.stat-tag.tier-2,
.stat-tag.emerald {
  background-color: var(--accent-emerald-dim);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald-border);
}

.stat-tag.tier-3,
.stat-tag.amber {
  background-color: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.stat-tag.rose {
  background-color: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.stat-tag.purple {
  background-color: var(--accent-purple-dim);
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple-border);
}

.stat-tag.base {
  background-color: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.badges-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.scout-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 500;
  background-color: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Pin Action Button */
.pin-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pin-action-btn:hover {
  color: var(--tappa-orange);
  background-color: var(--tappa-orange-subtle);
}

.pin-action-btn.pinned {
  color: var(--tappa-orange);
}

/* -------------------------------------------------------------
   3. Modal & Deep-Dive Executive Components
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(4, 6, 10, 0.85);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1080px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-surface-elevated);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-header .details {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.metric-tile {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.metric-tile .tile-lbl {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metric-tile .tile-val {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.metric-tile .tile-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}

/* Charts Grid */
.charts-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1rem;
}

.chart-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.chart-card h4 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-canvas-container {
  height: 220px;
  position: relative;
  width: 100%;
}

/* Historical Comps */
.comps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
}

.comp-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.comp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.comp-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.comp-match {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent-emerald);
}

.comp-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* -------------------------------------------------------------
   4. Team Trends & 30-Team Hub
   ------------------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.team-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.team-card:hover {
  border-color: var(--border-default);
  background-color: var(--bg-surface-elevated);
}

.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-card-header .team-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.four-factors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  text-align: center;
  background-color: var(--bg-app);
  padding: 0.55rem 0.45rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.four-factors-grid .ff-val {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.four-factors-grid .ff-lbl {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.1rem;
}

/* -------------------------------------------------------------
   5. Fantasy Lab & Autocomplete Components
   ------------------------------------------------------------- */
.roster-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-primary);
  transition: border-color 0.12s ease;
}

.roster-chip:hover {
  border-color: var(--tappa-orange);
}

.remove-chip-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.12s ease;
}

.remove-chip-btn:hover {
  color: var(--accent-rose);
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  margin-top: 0.25rem;
}

.autocomplete-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* -------------------------------------------------------------
   6. Watchlist Drawer Elements
   ------------------------------------------------------------- */
.watchlist-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100vh;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.7);
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.watchlist-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-elevated);
}

.drawer-header h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-feed-item {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.85rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 1024px) {
  .charts-split {
    grid-template-columns: 1fr;
  }
  .modal-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* -------------------------------------------------------------
   7. Playstyle & Advanced Tactical Intelligence Badges & Bars
   ------------------------------------------------------------- */
.playstyle-pills-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.playstyle-pill {
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.playstyle-pill:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
}

.playstyle-pill.active {
  background: var(--tappa-orange-subtle);
  border-color: var(--tappa-orange);
  color: var(--tappa-orange);
}

.playstyle-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.playstyle-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--tappa-orange), #fb923c);
  transition: width 0.3s ease;
}

.archetype-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.archetype-tag.defensive {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.pct-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.pct-badge.elite {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pct-badge.good {
  background: rgba(59, 130, 246, 0.18);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.pct-badge.avg {
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pct-badge.poor {
  background: rgba(244, 63, 94, 0.18);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.pos-distribution-bar {
  display: flex;
  height: 10px;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.4rem 0;
  background: rgba(255, 255, 255, 0.05);
}

.pos-bar-seg {
  height: 100%;
  transition: width 0.25s ease;
}

.pos-bar-seg.pg { background: #38bdf8; }
.pos-bar-seg.sg { background: #818cf8; }
.pos-bar-seg.sf { background: #a78bfa; }
.pos-bar-seg.pf { background: #f472b6; }
.pos-bar-seg.c { background: #fb923c; }

