/* navigation */
.navigation {
  display: flex;
  gap: var(--space);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space);
}

.navigation a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
}

.navigation a:hover {
  color: #fff;
}
/* Main page and all */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --radius: 8px;
  --space: 1rem;
  --maxw: 640px;
}

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

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg);
}

/* Background photo */
body::before {
  content: "";
  position: fixed;
  inset: -20px;
  z-index: -1; /* sit behind everything */
  background-image:
    linear-gradient(rgba(26, 0, 0, 0.6), rgba(24, 6, 6, 0.6)),
    url("assets/football-stadium.jpg");
  background-size: cover;
  background-position: center;
  filter: blur(2px);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--space) * 2) var(--space);
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

#title-banner {
  color: #fff;
  text-align: center;
  padding: calc(var(--space) * 3) var(--space);
}

#title-banner h1 {
  color: #fff;
}

#title-banner h2 {
  font-size: 1.25rem;
  font-weight: 400;
  margin-top: 0.25rem;
  color: rgba(255, 255, 255, 0.85);
}

section {
  margin-bottom: calc(var(--space) * 2);
}

/* content sits on cards so it stays readable over the background photo */
#playerSearch,
#comparisonSection,
#aboutContent,
#explainImpactScore {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.5);
  margin-bottom: 0.75rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: var(--space);
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: -0.5rem;
}

input[type="text"],
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  align-self: flex-start;
}

button:hover {
  opacity: 0.9rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#statusMessage {
  color: var(--muted);
  font-size: 0.9rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space) 0;
}

.div-track {
  background-color: var(--border);
  height: 14px;
  border-radius: 999px;
  margin: 0.5rem 0 1rem;
  overflow: hidden;
  width: 100%;
}

.div-fill {
  height: 100%;
  transition: width 0.4s;
}

footer {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.85);
}

footer a {
  color: #fff;
}
/* Results */
#resultsContainer p,
#comparisonResultsContainer p {
  margin-bottom: 0.35rem;
}

#resultsContainer,
#comparisonResultsContainer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space);
  animation: fadeInUp 0.35s ease;
}

#resultsContainer h2,
#comparisonResultsContainer h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

#resultsContainer strong,
#comparisonResultsContainer strong {
  font-size: 1.05rem;
}

.breakdown-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.player-header {
  display: flex;
  align-items: center;
  gap: var(--space);
  margin-bottom: var(--space);
}

.player-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.player-header h2 {
  margin-bottom: 0.25rem;
}

.player-header p {
  margin-bottom: 0.15rem;
}

/* side-by-side results when comparing players */

.results-grid {
  display: flex;
  gap: var(--space);
  flex-wrap: wrap;
}
.results-grid > section {
  flex: 1 1 260px;
}

.search-grid {
  display: flex;
  gap: var(--space);
  flex-wrap: wrap;
  align-items: flex-start;
}
.search-grid > section {
  flex: 1 1 260px;
}

main.comparing {
  max-width: 1100px;
}

/* edge cases */

.picker-label {
  color: var(--muted);
  font-size: 0.9 rem;
  margin-bottom: 0.5rem;
}

.picker-item {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
}

.picker-item:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.picker-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.picker-item small {
  color: var(--muted);
  margin-left: auto;
}

/* API limit counter */
#limitCounter {
  position: fixed;
  top: var(--space);
  right: var(--space);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  z-index: 10;
}

/* UX stuff */
button {
  transition: opacity 0.15s ease;
}

.picker-item {
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

main {
  transition: max-width 0.3 ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
