/* Base layout and shared components.
 *
 * Colours come from CSS custom properties emitted by base.html, which are
 * generated from config/styles.py COLORS — so this file never hardcodes a
 * hex value and cannot drift from the Reflex app while both are live.
 */

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

body {
  margin: 0;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Navbar ---------------------------------------------------------- */

.lc-navbar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 24px;
  background: var(--navbar-gradient);
  border-bottom: 1px solid var(--border-light);
}

.lc-navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}
.lc-navbar-brand:hover { text-decoration: none; }

.lc-navbar-links { display: flex; gap: 16px; }
.lc-navbar-links a { color: var(--text-secondary); }
.lc-navbar-links a.is-active { color: var(--accent-gold); }

/* Pushes the auth cluster to the right edge */
.lc-navbar-auth {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.lc-navbar-auth a { color: var(--text-secondary); }
.lc-navbar-user { color: var(--accent-gold) !important; }

.lc-navbar-cta {
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--accent-blue);
  color: var(--text-primary) !important;
}
.lc-navbar-cta:hover { text-decoration: none; opacity: 0.9; }

/* A form styled to sit inline among nav links */
.lc-inline-form { margin: 0; }
.lc-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
}
.lc-link-button:hover { text-decoration: underline; }

/* --- Layout ---------------------------------------------------------- */

.lc-main {
  min-height: calc(100vh - 60px);
  padding: 24px;
}

.lc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 24px;
}

/* --- Forms ----------------------------------------------------------- */

.lc-auth-page {
  display: flex;
  justify-content: center;
  padding-top: 48px;
}

.lc-auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 380px;
}

.lc-auth-form h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.lc-auth-form label {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.lc-auth-form input[type="text"],
.lc-auth-form input[type="password"],
.lc-auth-form input[type="email"] {
  padding: 10px 12px;
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  background: var(--bg-inset);
  color: var(--text-primary);
  font: inherit;
}
.lc-auth-form input:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

.lc-button-primary {
  margin-top: 16px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent-blue);
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.lc-button-primary:hover { opacity: 0.9; }

.lc-auth-links {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Messages -------------------------------------------------------- */

.lc-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  font-size: 0.9rem;
}

.lc-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.lc-optional {
  color: var(--text-muted);
  font-weight: 400;
}

/* Announced but not drawn. Lives here rather than in sidebar.css because
   pages outside the sidebar layout label their controls with it too — the
   admin page's hidden field labels were plainly visible until it moved. */
.lc-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Shared tables -------------------------------------------------------
 *
 * The `sr-` prefix is historical: these started on the season report, and the
 * franchise and player profile pages now use the same markup. They live here
 * rather than in fantasy.css because those NFL pages do not load it — the
 * franchise history table scrolled the whole page sideways until they moved.
 *
 * Opt-in by class, so no page picks them up by accident.
 */

.sr-subheading {
  margin: 20px 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.sr-hint { margin: 0 0 12px; font-size: 0.82rem; color: var(--text-secondary); }

.sr-scroll { overflow-x: auto; }
.sr-table-scroll { max-height: 400px; overflow-y: auto; }

.sr-team-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sr-close {
  padding: 5px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.sr-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

.sr-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.sr-table th button {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  text-align: inherit;
  cursor: pointer;
}

/* The arrow marks which column is sorted, and which way. */
.sr-table th[aria-sort="ascending"] button::after { content: " ▲"; }
.sr-table th[aria-sort="descending"] button::after { content: " ▼"; }
.sr-table th[aria-sort="none"] button::after {
  content: " ▲";
  opacity: 0;
}
.sr-table th:hover button::after { opacity: 0.4; }
.sr-table th[aria-sort]:not([aria-sort="none"]) button { color: var(--text-primary); }
.sr-table th[aria-sort]:not([aria-sort="none"]):hover button::after { opacity: 1; }

.sr-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

/* First column is the label; everything after it is a measurement. */
.sr-table th:not(:first-child) button, .sr-table td:not(:first-child) {
  text-align: right;
}
