/* =========================
   GLOBAL RESET + BASE
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  background: #0b1220; /* deep football field night */
  color: #e5e7eb;
  display: flex;
}

/* =========================
   TOP BAR HEADER
========================= */

.topbar {
  position: fixed;
  top: 0;
  left: 220px;
  right: 0;
  height: 60px;
  background: #0f172a;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 2px solid #1f2937;
  z-index: 10;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #22c55e; /* football green accent */
}

/* =========================
   SIDEBAR NAV
========================= */

.sidebar {
  width: 220px;
  height: 100vh;
  background: #0f172a;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  border-right: 2px solid #1f2937;
}

.sidebar h2 {
  color: #22c55e;
  margin-bottom: 20px;
  font-size: 18px;
}

.sidebar a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  transition: 0.2s;
  font-weight: 500;
}

.sidebar a:hover {
  background: #1f2937;
  color: #ffffff;
  transform: translateX(4px);
}

/* =========================
   MAIN CONTENT AREA
========================= */

.main {
  margin-left: 220px;
  padding: 80px 30px 30px; /* top padding for topbar */
  width: 100%;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 60px 30px;
  margin-bottom: 30px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(15,23,42,0.95));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

.hero-copy {
  max-width: 700px;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  animation: slideUp 1s ease-out 0.2s forwards;
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  color: #a7f3d0;
  letter-spacing: 0.2em;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.25rem, 4vw, 4rem);
  line-height: 1.05;
  margin-bottom: 18px;
  color: #f8fafc;
}

.hero p {
  margin: 0 auto 24px;
  max-width: 620px;
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.7;
}

.hero-button {
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  background: #22c55e;
  color: #0b1220;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hero-button:hover,
.hero-link:hover {
  transform: translateY(-1px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.hero-link,
.hero-button {
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #22c55e;
  color: #0b1220;
  text-decoration: none;
  border: 1px solid transparent;
}

.hero-link:hover {
  background: #16a34a;
}

.hero-button:hover {
  background: #16a34a;
}

.search-panel {
  margin-bottom: 35px;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page headings */
.main h2 {
  margin-bottom: 15px;
  color: #f8fafc;
}

/* =========================
   INPUTS + BUTTONS
========================= */

input {
  padding: 10px;
  border-radius: 8px;
  border: none;
  outline: none;
  margin: 5px;
  background: #1f2937;
  color: white;
  width: 220px;
}

button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #22c55e; /* football green */
  color: #0b1220;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  background: #16a34a;
  transform: scale(1.05);
}

/* =========================
   CARD SYSTEM (PLAYERS)
========================= */

.player-card {
  background: #111827;
  padding: 18px;
  border-radius: 12px;
  width: 260px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  transition: 0.2s;
}

.player-card:hover {
  transform: translateY(-5px);
}

.player-card h3 {
  color: #22c55e;
  margin-bottom: 10px;
}

.player-card p {
  margin: 6px 0;
  color: #d1d5db;
}

/* =========================
   LAYOUTS
========================= */

.content {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-direction: column;
}

/* Compare layout */
.compare-container {
  display: flex;
  gap: 30px;
  margin-top: 20px;
}

.compare-middle {
  width: 160px;
  text-align: center;
  padding-top: 70px;
  color: #94a3b8;
}

/* Compare inputs */
.compare-inputs {
  margin-bottom: 20px;
}

.compare-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.compare-actions button {
  flex: 1 1 140px;
}

/* =========================
   HIGHLIGHTING (WINNING STATS)
========================= */

.better-stat {
  color: #22c55e;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 8px;
  padding: 2px 8px;
  display: inline-block;
}

/* =========================
   FAVORITES / TEAM LISTS
========================= */

.content p {
  color: #cbd5e1;
}

.content.favorites-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
}

.team-columns {
  display: flex;
  gap: 24px;
  width: 100%;
  margin-top: 20px;
}

.team-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.team-column h3 {
  margin: 0;
  color: #22c55e;
}

.team-column .player-card {
  width: 100%;
}

.team-total,
.team-total-summary {
  background: rgba(34, 197, 94, 0.08);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 10px;
  color: #cbd5e1;
}

.team-total-summary {
  margin-top: 24px;
  text-align: center;
}

.scoring-explanation {
  background: rgba(59, 130, 246, 0.08);
  padding: 16px 20px;
  border-radius: 0;
  margin: 0 0 24px 0;
  border-bottom: 2px solid #3b82f6;
  color: #cbd5e1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scoring-explanation h4 {
  margin: 0;
  color: #60a5fa;
  font-size: 0.95rem;
}

.scoring-explanation p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

@media (max-width: 1200px) {
  .content.favorites-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

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

  .content.favorites-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .content.favorites-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 600px) {
  .content.favorites-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   RESPONSIVE (basic)
========================= */

@media (max-width: 900px) {
  .content,
  .compare-container {
    flex-direction: column;
  }

  .sidebar {
    position: absolute;
    height: auto;
    width: 100%;
  }

  .main {
    margin-left: 0;
    padding-top: 140px;
  }

  .topbar {
    left: 0;
  }
}

@media (max-width: 500px) {
  body {
    min-height: 100vh;
  }

  .hero {
    padding: 32px 18px;
    margin-bottom: 24px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-button,
  .hero-link,
  input,
  button {
    width: 100%;
    max-width: 100%;
  }

  .hero-actions {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    height: auto;
    width: 100%;
    border-right: none;
    border-bottom: 2px solid #1f2937;
  }

  .sidebar a {
    margin-bottom: 8px;
  }

  .main {
    padding: 160px 16px 20px;
  }

  .content {
    gap: 20px;
  }

  .player-card {
    width: 100%;
  }

  input {
    width: 100%;
    margin: 8px 0;
  }

  button {
    width: 100%;
    margin-top: 8px;
  }
}

.spinner {
  width: 55px;
  height: 55px;

  border: 6px solid #1f2937;     /* dark ring */
  border-top: 6px solid #22c55e; /* football green */

  border-radius: 50%;
  animation: spin 1s linear infinite;

  /* center it on screen */
  position: fixed;
  top: 70%;
  left: 55%;
  transform: translate(-50%, -50%);

  z-index: 9999;
}

/* animation */
@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* hide/show control */
.hidden {
  display: none;
}
