/* DiamondMind MVP — Dark, premium baseball analytics aesthetic */

:root {
  --bg-dark: #0c0f12;
  --bg-card: #141920;
  --bg-elevated: #1a1f28;
  --border: #2a3140;
  --text: #e8eaed;
  --text-muted: #8b95a5;
  --accent-green: #22c55e;
  --accent-gold: #eab308;
  --accent-blue: #3b82f6;
  --negative: #ef4444;
  --positive: #22c55e;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Source Sans 3", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  letter-spacing: 0.02em;
}

.logo-accent {
  color: var(--accent-gold);
}

.tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Main layout */
.main {
  flex: 1;
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 1.5rem;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
}

.sidebar h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

.filter-section .filter-group {
  margin-bottom: 1rem;
}

.filter-section label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.filter-section select,
.filter-section input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.filter-section select:focus,
.filter-section input:focus {
  outline: none;
  border-color: var(--accent-green);
}

/* Methodology */
.methodology {
  margin-top: 2rem;
}

.methodology-content {
  font-size: 0.8rem;
}

.method-block {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 6px;
  border-left: 3px solid var(--accent-green);
}

.method-block h4 {
  margin: 0 0 0.35rem 0;
  font-size: 0.85rem;
  color: var(--accent-gold);
}

.method-block p {
  margin: 0;
  color: var(--text-muted);
}

.method-block code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-green);
  background: rgba(34, 197, 94, 0.1);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.method-block .muted {
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.method-block.highlight {
  border-left-color: var(--accent-gold);
}

.method-block.highlight h4 {
  color: var(--accent-gold);
}

/* Content */
.content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-x: hidden;
}

.stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Chart */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.chart-container h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
}

.chart-hint {
  margin: 0 0 1rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-container .chart-wrapper {
  position: relative;
  height: 360px;
  width: 100%;
}

#chartScatter {
  width: 100% !important;
  height: 360px !important;
}

/* Table */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.table-container h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
}

.table-scroll {
  overflow-x: auto;
}

.player-table {
  width: 100%;
  border-collapse: collapse;
}

.player-table th,
.player-table td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.player-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

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

.player-table td.loading {
  color: var(--text-muted);
  font-style: italic;
}

.value-positive {
  color: var(--positive);
}

.value-negative {
  color: var(--negative);
}

.num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .stats-row {
    flex-direction: column;
  }
}
