/* MA4B — Match Analysis for Basketball */
/* Design: Dark, analytical, sports-data aesthetic */

:root {
  /* Colors */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #1c2128;
  --border: #30363d;
  --border-light: #484f58;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;

  --accent: #f78166;
  --accent-glow: rgba(247, 129, 102, 0.12);
  --accent-hover: #ffa28b;
  --green: #3fb950;
  --green-glow: rgba(63, 185, 80, 0.12);
  --blue: #58a6ff;
  --blue-glow: rgba(88, 166, 255, 0.12);
  --yellow: #d29922;
  --red: #f85149;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Work Sans', sans-serif;

  /* Spacing */
  --container: 1200px;
  --gap: 16px;
  --radius: 8px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  z-index: 100;
}

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

.logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  text-decoration: none;
}

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

.tagline {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 16px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav a:hover,
.nav a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* Hero / Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.stat-card .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-card .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

.stat-card .value.accent { color: var(--accent); }
.stat-card .value.green { color: var(--green); }
.stat-card .value.blue { color: var(--blue); }

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box::before {
  content: '⌕';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-group label {
  font-size: 13px;
  color: var(--text-muted);
}

select {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

select:focus {
  border-color: var(--accent);
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Data Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th:hover {
  color: var(--text-secondary);
}

th.sorted {
  color: var(--accent);
}

th .sort-arrow {
  margin-left: 4px;
  font-size: 10px;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tr:hover td {
  background: var(--bg-secondary);
}

tr:last-child td {
  border-bottom: none;
}

/* Player name column */
td.player-name {
  font-weight: 600;
  color: var(--text-primary);
}

td.school {
  color: var(--text-secondary);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-portal {
  background: var(--blue-glow);
  color: var(--blue);
}

.badge-committed {
  background: var(--green-glow);
  color: var(--green);
}

.badge-withdrawn {
  background: rgba(139, 148, 158, 0.12);
  color: var(--text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

/* Loading spinner */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .tagline { display: none; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .controls { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr; }
  .header .container { flex-wrap: wrap; gap: 8px; }
  .nav { width: 100%; justify-content: flex-end; }
}

/* Feedback */
.fb-prompt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 32px 0;
}
.fb-prompt-text { flex: 1; }
.fb-prompt-text strong { font-size: 15px; }
.fb-prompt-text p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.fb-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  margin: 20px;
}
.fb-modal h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}
.fb-modal label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 14px;
}
.fb-modal select,
.fb-modal textarea,
.fb-modal input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
}
.fb-modal textarea { resize: vertical; min-height: 100px; }
.fb-modal select:focus,
.fb-modal textarea:focus,
.fb-modal input:focus { border-color: var(--accent); outline: none; }
.fb-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
.fb-error { color: #f85149; font-size: 13px; margin-top: 8px; }
