/* Avenue 1 — Professional Theme */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fafaf9;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f4;
  --bg-input: #ffffff;
  --text: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;
  --accent: #1e3a5f;
  --accent-hover: #2b5180;
  --accent-light: #e8eef4;
  --border: #e7e5e4;
  --border-subtle: #f5f5f4;
  --green: #166534;
  --green-light: #15803d;
  --red: #dc2626;
  --yellow: #ca8a04;
  --radius-card: 0.625rem;
  --radius-badge: 0.375rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lift: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
}

/* Brand stripe */
body::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #3b6b9a 50%, var(--accent) 100%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grain texture */
#app::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Smooth view transitions ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Top Bar (legacy page) */
.topbar {
  position: sticky;
  top: 3px;
  z-index: 50;
  background: rgba(250,250,249,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

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

.topbar-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Page Content */
.page {
  padding-top: 2rem;
  padding-bottom: 2rem;
  min-height: calc(100vh - 60px);
}

/* Filters (legacy) */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.search-box {
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-badge);
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30,58,95,0.1);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-group select {
  padding: 0.6rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-badge);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

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

/* Toggle */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.toggle-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

/* Table (legacy) */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

#coaches-table {
  width: 100%;
  border-collapse: collapse;
}

#coaches-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
}

#coaches-table thead th:hover {
  color: var(--text-secondary);
}

#coaches-table thead th.number {
  text-align: right;
}

#coaches-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

#coaches-table tbody tr:hover {
  background: var(--bg-hover);
}

#coaches-table tbody tr:last-child {
  border-bottom: none;
}

#coaches-table td {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  vertical-align: middle;
}

#coaches-table td.number {
  text-align: right;
}

/* Sort Indicators */
th[data-sort] {
  position: relative;
}

th.sort-asc::after {
  content: ' \2191';
  font-size: 0.65rem;
}

th.sort-desc::after {
  content: ' \2193';
  font-size: 0.65rem;
}

/* Coach Name */
.coach-name {
  font-weight: 500;
  color: var(--text);
}

.coach-name.clickable {
  cursor: pointer;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

.coach-name.clickable:hover {
  color: var(--accent-hover);
}

/* School Name */
.school-name {
  color: var(--text-secondary);
}

/* Conference Badges */
.conf-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.conf-SEC { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.conf-Big10 { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.conf-Big12 { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.conf-ACC { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.conf-MWC { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.conf-Other { background: #f5f5f4; color: #57534e; border: 1px solid #e7e5e4; }

/* Position Badge */
.position-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-badge);
  background: #f5f5f4;
  color: var(--text-muted);
  white-space: nowrap;
}

.position-badge.head-coach {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Money */
.money {
  color: var(--green);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.undisclosed {
  color: var(--text-muted);
}

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Modal (legacy) */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal[aria-hidden="false"],
.modal[style*="display: block"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.close {
  position: absolute;
  right: 1rem;
  top: 0.75rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
  line-height: 1;
}

.close:hover {
  color: var(--text);
}

.modal-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.modal-photo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-badge);
  object-fit: cover;
  border: 1px solid var(--border);
}

.modal-title-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.modal-title-section h3 {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.modal-wiki-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
}

.modal-wiki-link:hover {
  text-decoration: underline;
}

.modal-bio {
  margin-bottom: 0.9rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.modal-lineage {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.modal-loading {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
}

/* Footer */
footer {
  margin-top: 2rem;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

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

footer p {
  margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-wrap: wrap;
  }

  #coaches-table {
    font-size: 0.8rem;
  }

  #coaches-table td,
  #coaches-table th {
    padding: 0.5rem 0.6rem;
  }
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 3px;
}
