/* Warrior Poets Fantasy Football - Light & Fun Theme */

:root {
  /* Colors - Light & Vibrant */
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f2f7;
  --bg-card: #ffffff;
  --bg-hover: #e8ebf2;

  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #8888a0;

  --accent-primary: #ff6b6b;
  --accent-secondary: #4ecdc4;
  --accent-gold: #f9a825;
  --accent-blue: #3459ed;
  --accent-purple: #9775fa;
  --accent-pink: #f06595;
  --accent-orange: #ff922b;
  --accent-teal: #20c997;

  --border-color: #e0e4ed;
  --border-light: #d0d5e0;

  /* Positive/Negative */
  --positive: #2ecc71;
  --negative: #e74c3c;

  /* Inactive member styling */
  --inactive-text: #a0a0b0;

  /* Spacing */
  --sidebar-width: 240px;
  --header-height: 60px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
}

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

html {
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.sidebar-logo:hover {
  opacity: 0.8;
  color: var(--text-primary);
}

.sidebar-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-logo span {
  color: var(--accent-blue);
  line-height: 1.2;
  font-weight: 700;
}

.sidebar-nav {
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  padding: 8px 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-teal);
}

.nav-section-toggle {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}

.nav-section-toggle:hover {
  color: var(--accent-blue);
}

.nav-toggle-icon {
  transition: transform 0.2s ease;
}

.nav-toggle-icon.rotated {
  transform: rotate(180deg);
}

.nav-section-content {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}

.nav-section-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.nav-year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 12px;
}

.nav-year-link {
  padding: 6px 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-year-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-year-link.active {
  background-color: rgba(52, 89, 237, 0.15);
  color: var(--accent-blue);
  font-weight: 500;
}

.nav-member-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 8px 12px;
}

.nav-member-link {
  padding: 6px 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-member-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-member-link.active {
  background-color: rgba(52, 89, 237, 0.15);
  color: var(--accent-blue);
  font-weight: 500;
}

.nav-member-link.inactive {
  opacity: 0.6;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: rgba(52, 89, 237, 0.1);
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  font-weight: 500;
}

.nav-link-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-submenu.expanded {
  max-height: 500px;
}

.nav-submenu .nav-link {
  padding-left: 52px;
  font-size: 0.85rem;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: calc(100vw - var(--sidebar-width));
}

.page-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 24px 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--accent-blue);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.page-content {
  padding: 24px 32px;
  overflow-x: hidden;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--accent-teal);
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: middle;
}

.card-body {
  padding: 20px;
  overflow-x: auto;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Stats Cards */
.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Career Stats Grid - compact 6-column layout */
.career-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.career-stats .stat-card {
  padding: 12px;
  text-align: center;
}

.career-stats .stat-label {
  font-size: 0.65rem;
  margin-bottom: 4px;
}

.career-stats .stat-value {
  font-size: 1.25rem;
}

@media (max-width: 900px) {
  .career-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 500px) {
  .career-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-change {
  font-size: 0.85rem;
  margin-top: 4px;
}

.stat-change.positive {
  color: var(--positive);
}

.stat-change.negative {
  color: var(--negative);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: linear-gradient(135deg, rgba(52, 89, 237, 0.08) 0%, rgba(32, 201, 151, 0.08) 100%);
}

th {
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

th:hover {
  background-color: var(--bg-hover);
}

th.sortable::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 8px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--text-muted);
  opacity: 0.5;
}

th.sort-asc::after {
  border-top: none;
  border-bottom: 4px solid var(--accent-primary);
  opacity: 1;
}

th.sort-desc::after {
  border-top: 4px solid var(--accent-primary);
  opacity: 1;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  text-align: center;
}

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

/* Numeric values in tables */
td.numeric {
  font-family: var(--font-mono);
  text-align: center;
}

td.positive {
  color: var(--positive);
}

td.negative {
  color: var(--negative);
}

/* Rank column */
td.rank {
  text-align: center;
  width: 50px;
}


/* Member name styling */
.member-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.member-name.inactive {
  color: var(--inactive-text);
}

.member-name.inactive::after {
  content: '*';
  color: var(--text-muted);
  font-size: 0.8em;
}

.member-name.champion {
  color: var(--accent-gold);
}

/* Trophy icon */
.trophy {
  display: inline-flex;
  align-items: center;
  color: var(--accent-gold);
}

.trophy-count {
  font-size: 0.8rem;
  margin-left: 2px;
  font-weight: 700;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-gold {
  background-color: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
}

.badge-silver {
  background-color: rgba(192, 192, 192, 0.2);
  color: #c0c0c0;
}

.badge-bronze {
  background-color: rgba(205, 127, 50, 0.2);
  color: #cd7f32;
}

/* Year selector */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.year-btn {
  padding: 10px 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.year-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.year-btn.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Member cards grid */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.member-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.member-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.member-card.inactive {
  opacity: 0.7;
}

.member-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.member-card-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.member-card-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Charts container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Hall of Fame */
.hof-champion {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(249, 168, 37, 0.08) 0%, rgba(255, 107, 107, 0.05) 100%);
  border-radius: 12px;
  margin-bottom: 12px;
  border-left: 4px solid var(--accent-gold);
}

.hof-rank {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 50px;
  text-align: center;
}

.hof-info {
  flex: 1;
}

.hof-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hof-years {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hof-trophies {
  display: flex;
  gap: 4px;
}

/* Week columns for weekly data */
.week-cell {
  text-align: center;
  min-width: 50px;
}

.week-header {
  font-size: 0.7rem;
}

/* Footer */
.footer {
  padding: 20px 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    width: 280px;
  }

  .main-content {
    margin-left: 0;
    max-width: 100vw;
  }

  .page-header {
    padding: 16px 20px 16px 75px;
  }

  .page-content {
    padding: 16px 20px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .mobile-menu-btn {
    display: block;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 8px 12px;
  }

  .stat-card {
    padding: 12px 16px;
  }

  .stat-label {
    font-size: 0.7rem;
    margin-bottom: 4px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-detail {
    font-size: 0.8rem;
    margin-top: 2px;
  }
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cumulative-sidebets-card {
    display: none;
  }
}

/* Overlay for mobile menu */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
