:root {
  --sleeper-bg: #0f0f0f;
  --sleeper-card: #1a1a1a;
  --sleeper-text: #ffffff;
  --sleeper-accent: #00ff9d;
  --sleeper-secondary: #2a2a2a;
}

body {
  background: var(--sleeper-bg);
  color: var(--sleeper-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Logo Header Styles */
.logo-header {
  background: var(--sleeper-bg);
  padding: 8px 0;
  position: relative;
  border-bottom: 1px solid var(--sleeper-accent);
}

.logo-header .container {
  position: relative;
  height: 2rem;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--sleeper-accent);
  letter-spacing: 2px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Homepage logo styling */
.logo-text-home {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--sleeper-accent);
  letter-spacing: 2px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  position: fixed;
  left: 15px;
  top: 8px;
  z-index: 1000;
  text-decoration: none;
  transition: all 0.2s ease;
}

.logo-text-home:hover {
  color: #00e08a;
  transform: scale(1.1);
  text-decoration: none;
}

/* Draft page logo styling */
.logo-text-inline {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--sleeper-accent);
  letter-spacing: 2px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  margin-right: 2rem;
  position: absolute;
  left: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.logo-text-inline:hover {
  color: #00e08a;
  transform: scale(1.1);
  text-decoration: none;
}

.hero-section {
  background: linear-gradient(45deg, var(--sleeper-bg), var(--sleeper-secondary));
  padding: 80px 0;
  margin-bottom: 40px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #888;
  margin-bottom: 2rem;
}

.username-input {
  background: var(--sleeper-card);
  border: 2px solid var(--sleeper-secondary);
  color: var(--sleeper-text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 1.1rem;
  width: 200px;
  margin-right: 10px;
}

.year-select {
  background: var(--sleeper-card);
  border: 2px solid var(--sleeper-secondary);
  color: var(--sleeper-text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 1.1rem;
  width: 120px;
  margin-right: 10px;
  cursor: pointer;
}

.year-select:focus {
  border-color: var(--sleeper-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

.year-select option {
  background: var(--sleeper-card);
  color: var(--sleeper-text);
}

.btn-sleeper {
  background: var(--sleeper-accent);
  color: var(--sleeper-bg);
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.btn-sleeper:hover {
  background: #00e08a;
  transform: translateY(-1px);
}

.league-card {
  background: var(--sleeper-card);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 15px;
  border: 1px solid var(--sleeper-secondary);
  transition: all 0.2s;
}

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

.league-card-drafting {
  background: linear-gradient(135deg, #1a3a5c 0%, var(--sleeper-card) 100%);
  border-color: #4dabf7;
}

.league-card-drafting:hover {
  border-color: #74c0fc;
}

.league-card-in-season {
  background: linear-gradient(135deg, #1a4f2e 0%, var(--sleeper-card) 100%);
  border-color: var(--sleeper-accent);
}

.league-card-in-season:hover {
  border-color: #00ff9d;
}

.league-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.league-info {
  color: #888;
  font-size: 0.8rem;
}

.badge-dynasty {
  background: #ff6b6b;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  margin-left: 6px;
}

.badge-redraft {
  background: #4dabf7;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  margin-left: 6px;
}

/* Status Badges */
.badge-drafting {
  background: #4dabf7;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  margin-left: 6px;
  font-weight: 600;
}

.badge-pre-draft {
  background: #74c0fc;
  color: #1a1a1a;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  margin-left: 6px;
  font-weight: 600;
}

.badge-in-season {
  background: var(--sleeper-accent);
  color: #1a1a1a;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  margin-left: 6px;
  font-weight: 600;
}

.badge-complete {
  background: #666;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  margin-left: 6px;
  font-weight: 600;
}

.draft-button {
  margin-left: 8px;
  font-size: 0.65rem;
  padding: 3px 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.draft-button:first-child {
  margin-left: 8px;
}

.draft-button + .draft-button {
  margin-left: 4px;
}

/* Timeline View Styles */
.year-section {
  margin-bottom: 30px;
}

.year-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: var(--sleeper-accent);
  border-bottom: 2px solid var(--sleeper-secondary);
  padding-bottom: 10px;
}

.leagues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

@media (max-width: 768px) {
  .leagues-grid {
    grid-template-columns: 1fr;
  }
  
  .year-title {
    font-size: 1.5rem;
  }
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--sleeper-accent);
}

#leagues-container {
  display: none;
}

.footer {
  background: var(--sleeper-secondary);
  padding: 40px 0;
  margin-top: auto;
}

/* Admin Actions Styles */
.admin-actions {
  margin-top: 30px;
}

.admin-divider {
  border-color: var(--sleeper-accent);
  margin: 20px 0;
}

.admin-title {
  color: var(--sleeper-accent);
  font-weight: 600;
  margin-bottom: 5px;
}

.admin-subtitle {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.admin-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.btn-admin {
  background: var(--sleeper-accent);
  color: var(--sleeper-bg);
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  position: relative;
}

.btn-admin:hover {
  background: #00e08a;
  transform: translateY(-1px);
}

.btn-admin:active {
  transform: translateY(0);
}

.btn-admin:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
}

.btn-admin .btn-spinner {
  color: var(--sleeper-bg);
}

.refresh-status {
  font-size: 0.9rem;
  min-height: 20px;
}

.refresh-status.success {
  color: var(--sleeper-accent);
}

.refresh-status.error {
  color: #ff6b6b;
}

.footer-title {
  color: var(--sleeper-accent);
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--sleeper-text);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-timeline {
  display: inline-block;
  background: var(--sleeper-accent);
  color: var(--sleeper-bg);
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 20px;
  transition: all 0.2s;
}

.footer-timeline:hover {
  background: #00e08a;
  color: var(--sleeper-bg);
  transform: translateY(-1px);
}

/* Draft Detail Page Styles */
.compact-header {
  background: var(--sleeper-card);
  border-bottom: 1px solid var(--sleeper-accent);
  margin-bottom: 20px;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.compact-header .form-label {
  white-space: nowrap;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.compact-header .d-flex {
  gap: 12px;
  padding-left: 4rem;
}

.compact-header .ms-3 {
  margin-left: 1rem !important;
}

.draft-id-input {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  color: var(--sleeper-text);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  width: 180px;
  margin-right: 8px;
  height: calc(1.5em + 0.5rem + 2px);
}

.draft-id-input:focus {
  border-color: var(--sleeper-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

.btn-draft-load {
  background: var(--sleeper-accent);
  color: var(--sleeper-bg);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-draft-load:hover {
  background: #00e08a;
  transform: translateY(-1px);
}

.draft-info-card {
  padding: 0;
  background: transparent;
  border: none;
  text-align: left;
}

.draft-details {
  font-size: 0.9rem;
}

.draft-details .badge {
  margin-right: 8px;
}

.players-container {
  background: var(--sleeper-card);
  border-radius: 12px;
  padding: 15px;
  border: 1px solid var(--sleeper-secondary);
  height: calc(100vh - 120px);
  overflow-y: auto;
}

.player-card {
  background: var(--sleeper-secondary);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #333;
  transition: all 0.2s;
}

.player-card:hover {
  border-color: var(--sleeper-accent);
  transform: translateX(2px);
}

.draft-pick-row {
  background: var(--sleeper-secondary);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid #333;
}

.pick-number {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--sleeper-accent);
}

.team-name {
  color: #ccc;
  font-size: 0.9rem;
}

.draft-picks-header {
  background: var(--sleeper-secondary);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9rem;
}

.column-header {
  background: var(--sleeper-secondary);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9rem;
}

.position-titles-sticky-wrapper {
  position: sticky;
  top: 80px;
  z-index: 150;
  background: var(--sleeper-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  padding: 8px 0;
}

.position-titles-row {
  background: var(--sleeper-secondary);
  border-radius: 8px;
  padding: 4px 8px;
  margin: 0 4px 8px 4px;
}

.player-search {
  background: var(--sleeper-card);
}

.header-search {
  min-width: 200px;
}

.header-search .form-control {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  color: var(--sleeper-text);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  height: calc(1.5em + 0.5rem + 2px);
}

.header-search .form-control:focus {
  background: var(--sleeper-secondary);
  border-color: var(--sleeper-accent);
  color: var(--sleeper-text);
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

.player-search .form-control {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  color: var(--sleeper-text);
  border-radius: 8px;
}

.player-search .form-control:focus {
  background: var(--sleeper-secondary);
  border-color: var(--sleeper-accent);
  color: var(--sleeper-text);
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

.filters .form-select {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  color: var(--sleeper-text);
  border-radius: 8px;
}

.filters .form-select:focus {
  background: var(--sleeper-secondary);
  border-color: var(--sleeper-accent);
  color: var(--sleeper-text);
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

.filters .form-select option {
  background: var(--sleeper-secondary);
  color: var(--sleeper-text);
}

/* Position-specific styling */
.position-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.clickable-title {
  cursor: pointer;
  transition: color 0.2s ease, transform 0.1s ease;
  user-select: none;
}

.clickable-title:hover {
  color: var(--sleeper-accent);
  transform: scale(1.05);
}

.clickable-title:active {
  transform: scale(0.95);
}
  text-align: center;
  padding: 8px;
}

.position-qb {
  background-color: #FF6B6B;
  color: #fff;
}

.position-rb {
  background-color: #8FE5B5;
  color: #000;
}

.position-wr {
  background-color: #8ED0F9;
  color: #000;
}

.position-te {
  background-color: #FFC87C;
  color: #000;
}

/* Player cards with position colors */
.player-card-compact.player-card-qb {
  background-color: #FF6B6B !important;
  color: #000 !important;
}

.player-card-compact.player-card-rb {
  background-color: #8FE5B5 !important;
  color: #000 !important;
}

.player-card-compact.player-card-wr {
  background-color: #8ED0F9 !important;
  color: #000 !important;
}

.player-card-compact.player-card-te {
  background-color: #FFC87C !important;
  color: #000 !important;
}

.player-card-compact.player-card-k {
  background-color: #ff6b6b !important;
  color: #fff !important;
}

.player-card-compact.player-card-def {
  background-color: #9c88ff !important;
  color: #fff !important;
}

/* Compact player card for narrower columns */
.player-card-compact {
  background: var(--sleeper-secondary);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 6px;
  border: 1px solid #333;
  transition: all 0.2s;
  font-size: 0.85rem;
  position: relative;
}

/* Default background for players without position */
.player-card-compact:not([class*="player-card-"]) {
  background: var(--sleeper-secondary);
}

.player-card-compact:hover {
  transform: translateX(2px);
}

.player-name-compact {
  font-weight: 600;
  float: left;
}

.player-team-compact {
  position: absolute;
  top: 2px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: normal;
  opacity: 0.8;
  color: #666;
}

.player-team-compact {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: normal;
  opacity: 0.8;
  color: #666;
}

.player-rank-compact {
  position: absolute;
  bottom: 2px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: normal;
  color: #888;
}

.player-card-compact::after {
  content: "";
  display: table;
  clear: both;
}

.draft-pick-compact {
  background: var(--sleeper-secondary);
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 4px;
  border: 1px solid #333;
  font-size: 0.8rem;
}

/* Position-based colors for drafted players */
.draft-pick-compact.player-card-qb {
  background-color: #FF6B6B !important;
  color: #000 !important;
}
.draft-pick-compact.player-card-rb {
  background-color: #8FE5B5 !important;
  color: #000 !important;
}
.draft-pick-compact.player-card-wr {
  background-color: #8ED0F9 !important;
  color: #000 !important;
}
.draft-pick-compact.player-card-te {
  background-color: #FFC87C !important;
  color: #000 !important;
}
.draft-pick-compact.player-card-k {
  background-color: #ff6b6b !important;
  color: #fff !important;
}
.draft-pick-compact.player-card-def {
  background-color: #9c88ff !important;
  color: #fff !important;
}

.pick-number-compact {
  font-weight: 700;
  color: var(--sleeper-accent);
  font-size: 0.9rem;
}

/* Custom ranking checkbox styling */
.form-check-label {
  color: var(--sleeper-text);
  font-size: 0.85rem;
}

.form-check-input {
  background-color: var(--sleeper-secondary);
  border: 1px solid #333;
}

.form-check-input:checked {
  background-color: var(--sleeper-accent);
  border-color: var(--sleeper-accent);
}

.form-check-input:focus {
  border-color: var(--sleeper-accent);
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

/* Rankings dropdown styling */
.ranking-select {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  color: var(--sleeper-text);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  width: 85px;
  cursor: pointer;
  height: calc(1.5em + 0.5rem + 2px);
}

.ranking-select:focus {
  border-color: var(--sleeper-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

.ranking-select option {
  background: var(--sleeper-secondary);
  color: var(--sleeper-text);
}

/* Favorite player heart icon */
.favorite-heart {
  color: #ff1744;
  font-weight: bold;
  margin-left: 4px;
  font-size: 0.9rem;
  text-shadow: 0 0 3px rgba(0, 0, 0, 1), 0 1px 1px rgba(0, 0, 0, 1);
}


/* Spinning animation for refresh button */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

#refresh-drafted.refreshing small {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* General refresh button spinning animation */
.refreshing small {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Draft Board Styles */
.draft-board-section {
  background: var(--sleeper-card);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

/* Mobile: Make entire page use full viewport width */
@media (max-width: 768px) {
  /* Force full viewport width on all elements */
  html, body {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: auto;
  }
  
  /* Remove Bootstrap container constraints */
  .container,
  .container-fluid {
    max-width: 100vw !important;
    width: 100vw !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Force header to full width */
  .compact-header {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    left: 0 !important;
    right: 0 !important;
  }
  
  /* Force draft board section to full width */
  .draft-board-section {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 20px 0 !important;
    padding: 15px 10px !important;
    border-radius: 8px;
    box-sizing: border-box !important;
  }
  
  /* Force footer to full width */
  .footer {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 40px 10px !important;
  }
  
  /* Force all rows to full width */
  .row {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  /* Force all columns to full width */
  .col-12,
  .col-md-6 {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
}

.draft-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--sleeper-secondary);
  padding-bottom: 10px;
}

.draft-board-controls {
  margin-right: 10px;
}

.draft-board-title {
  color: var(--sleeper-accent);
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.draft-board-controls button {
  background: transparent;
  border: 1px solid var(--sleeper-accent);
  color: var(--sleeper-accent);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.draft-board-controls button:hover {
  background: var(--sleeper-accent);
  color: var(--sleeper-bg);
}

.toggle-icon {
  font-size: 14px;
  font-weight: bold;
  display: inline-block;
  transition: transform 0.2s ease;
}

.draft-board-container {
  margin-top: 15px;
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
}

.draft-board {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  min-width: 1200px;
  background: var(--sleeper-secondary);
  padding: 2px;
  border-radius: 4px;
}

/* Mobile: Optimize draft board for touch scrolling */
@media (max-width: 768px) {
  .draft-board-container {
    /* No additional margins needed since parent is full width */
    margin-left: 0;
    margin-right: 0;
    padding-left: 5px;
    padding-right: 5px;
    /* Enable smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  
  .draft-board {
    /* Make the grid wider to show more columns */
    min-width: 150vw; /* 50% wider than viewport to show more columns */
    width: 150vw;
    /* Keep original grid structure but allow it to extend */
    gap: 2px;
  }
  
  /* Keep draft slots at reasonable size */
  .draft-slot {
    padding: 8px;
    min-height: 60px;
    font-size: 0.85rem;
    /* Maintain good readability */
  }
}

.draft-slot {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.draft-slot:hover {
  transform: translateX(2px);
}

.draft-slot.drafted {
  border-color: #333;
  background: #1a1a1a !important;
  color: #888 !important;
}

.draft-slot.drafted .draft-slot-player {
  font-weight: 500;
}

.draft-slot.projected {
  border-color: #333;
  opacity: 0.9;
}

.draft-slot-pick {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.6rem;
  color: rgba(0, 0, 0, 0.6);
  font-weight: 500;
}

.draft-slot-player {
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.1;
}

.draft-slot-team {
  position: absolute;
  top: 2px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: normal;
  opacity: 1;
  color: #333;
}

.draft-slot-rank {
  position: absolute;
  bottom: 2px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: normal;
  color: #888;
}

/* Draft slot favorite heart - exact same styling as player cards */
.draft-slot .favorite-heart {
  color: #ff1744;
  font-weight: bold;
  margin-left: 4px;
  font-size: 0.9rem;
  text-shadow: 0 0 3px rgba(0, 0, 0, 1), 0 1px 1px rgba(0, 0, 0, 1);
}

/* Position-specific colors matching player cards */
.draft-slot.position-qb {
  background-color: #FF6B6B !important;
  color: #000 !important;
}

.draft-slot.position-rb {
  background-color: #8FE5B5 !important;
  color: #000 !important;
}

.draft-slot.position-wr {
  background-color: #8ED0F9 !important;
  color: #000 !important;
}

.draft-slot.position-te {
  background-color: #FFC87C !important;
  color: #000 !important;
}

.draft-slot.position-k {
  background-color: #ff6b6b !important;
  color: #fff !important;
}

.draft-slot.position-def {
  background-color: #9c88ff !important;
  color: #fff !important;
}

/* Darker, muted versions of position colors for drafted players */
.draft-slot.drafted.position-qb {
  background-color: #8b3d3d !important; /* Dark muted red */
  color: #ccc !important;
}

.draft-slot.drafted.position-rb {
  background-color: #4a6b4a !important; /* Dark muted green */
  color: #ccc !important;
}

.draft-slot.drafted.position-wr {
  background-color: #4a5f7a !important; /* Dark muted blue */
  color: #ccc !important;
}

.draft-slot.drafted.position-te {
  background-color: #8b6b3d !important; /* Dark muted orange */
  color: #ccc !important;
}

.draft-slot.drafted.position-k {
  background-color: #8b3d3d !important; /* Dark muted red */
  color: #ccc !important;
}

.draft-slot.drafted.position-def {
  background-color: #5a4a7a !important; /* Dark muted purple */
  color: #ccc !important;
}

/* Search highlight styles */
.draft-slot.search-highlight {
  border: 3px solid var(--sleeper-accent) !important;
  box-shadow: 0 0 15px rgba(0, 255, 157, 0.8) !important;
  background-color: rgba(0, 255, 157, 0.1) !important;
  animation: pulse-highlight 2s ease-in-out infinite;
  transform: scale(1.05) !important;
}

@keyframes pulse-highlight {
  0% {
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.8);
    background-color: rgba(0, 255, 157, 0.1);
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 255, 157, 1);
    background-color: rgba(0, 255, 157, 0.2);
  }
  100% {
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.8);
    background-color: rgba(0, 255, 157, 0.1);
  }
}

/* API Documentation Styles */
.api-section {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
  transition: all 0.3s ease;
}

.api-section:hover {
  border-color: var(--sleeper-accent);
  box-shadow: 0 4px 12px rgba(0, 255, 157, 0.1);
}

.api-category {
  color: var(--sleeper-accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--sleeper-accent);
  padding-bottom: 0.5rem;
}

.api-endpoint {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border-left: 3px solid var(--sleeper-accent);
}

.api-endpoint strong {
  color: var(--sleeper-accent);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.25rem;
}

.api-endpoint p {
  color: var(--sleeper-text);
  margin: 0.25rem 0;
  font-size: 0.85rem;
}

.api-endpoint code {
  background: rgba(0, 255, 157, 0.1);
  color: var(--sleeper-accent);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
}

.api-subreddits {
  background: rgba(0, 255, 157, 0.1);
  padding: 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.api-subreddits small {
  color: var(--sleeper-text);
  font-size: 0.75rem;
}

.api-examples {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
}

.example-item {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border-left: 3px solid #007bff;
}

.example-item:last-child {
  margin-bottom: 0;
}

.example-item strong {
  color: #007bff;
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.example-item code {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  display: block;
  word-break: break-all;
}

.api-example-link {
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
}

.api-example-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.api-example-link:hover code {
  background: rgba(0, 123, 255, 0.2);
  color: #0056b3;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.api-footer-note {
  color: var(--sleeper-text);
  font-size: 0.9rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 255, 157, 0.05);
  border-radius: 6px;
}

/* Twitter Card Styles */
.twitter-section {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}

.twitter-section:hover {
  border-color: var(--sleeper-accent);
  box-shadow: 0 4px 12px rgba(0, 255, 157, 0.1);
}

.twitter-category {
  color: var(--sleeper-accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--sleeper-accent);
  padding-bottom: 0.5rem;
  text-decoration: none;
  display: block;
}

.twitter-category:hover {
  color: var(--sleeper-accent);
  text-decoration: none;
}

.twitter-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.twitter-links li {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border-left: 3px solid var(--sleeper-accent);
  transition: all 0.2s ease;
}

.twitter-links li:hover {
  background: rgba(0, 255, 157, 0.1);
  transform: translateX(2px);
}

.twitter-links a {
  color: var(--sleeper-text);
  text-decoration: none;
  font-weight: 500;
}

.twitter-links a:hover {
  color: var(--sleeper-accent);
  text-decoration: none;
}

.twitter-category-timeline {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--sleeper-accent);
  color: var(--sleeper-primary);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}

.twitter-category-timeline:hover {
  background: #00cc99;
  color: var(--sleeper-primary);
  text-decoration: none;
}

/* Collapsible Section Styles */
.section-header {
  cursor: pointer;
  padding: 1rem 0;
  border-bottom: 2px solid var(--sleeper-accent);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.section-header:hover {
  background: rgba(0, 255, 157, 0.05);
  border-radius: 8px;
  padding: 1rem;
  margin: 0 -1rem 1rem -1rem;
}

.section-title {
  margin: 0;
  color: var(--sleeper-accent);
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--sleeper-accent);
  color: #000000;
  border-radius: 50%;
  text-align: center;
  line-height: 1.5rem;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.section-icon:hover {
  background: #00cc99;
  transform: scale(1.1);
}

.collapsible-section {
  transition: all 0.3s ease;
  overflow: hidden;
}

.collapsible-section.collapsed {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
}

.section-divider {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sleeper-accent), transparent);
  margin: 3rem 0;
  opacity: 0.6;
}

/* League Season Mode Styles */
.league-controls {
  background: var(--sleeper-card);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--sleeper-secondary);
}

.roster-container {
  background: var(--sleeper-card);
  border-radius: 8px;
  border: 1px solid var(--sleeper-secondary);
}

.roster-header {
  background: var(--sleeper-secondary);
  padding: 15px 20px;
  border-bottom: 1px solid #333;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.roster-title-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roster-title {
  color: var(--sleeper-accent);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.week-info {
  color: #888;
  font-size: 0.85rem;
  font-weight: 400;
}

/* Lineup Toggle Styling */
.lineup-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--sleeper-accent);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  color: var(--sleeper-text);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Inline Toggle Styling (Icon Only) */
.lineup-toggle-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.toggle-switch-inline {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  cursor: pointer;
}

.toggle-switch-inline input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider-inline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .3s;
  border-radius: 20px;
  border: 1px solid #555;
}

.toggle-slider-inline:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch-inline input:checked + .toggle-slider-inline {
  background-color: var(--sleeper-accent);
  border-color: var(--sleeper-accent);
}

.toggle-switch-inline input:checked + .toggle-slider-inline:before {
  transform: translateX(20px);
}

/* Active state styling for labels */
.lineup-toggle-inline .toggle-option {
  transition: color 0.2s ease, font-weight 0.2s ease;
}

/* Default state: Current is active, Optimal is inactive */
.lineup-toggle-inline .toggle-option:first-child {
  color: var(--sleeper-accent);
  font-weight: 600;
}

.lineup-toggle-inline .toggle-option:last-child {
  color: #888;
  font-weight: 400;
}

/* Active class styling for dynamic updates */
.lineup-toggle-inline .toggle-option.active {
  color: var(--sleeper-accent) !important;
  font-weight: 600 !important;
}

.lineup-toggle-inline .toggle-option.inactive {
  color: #888 !important;
  font-weight: 400 !important;
}

.roster-table-header {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  padding: 15px 20px;
  background: var(--sleeper-secondary);
  border-bottom: 1px solid #333;
  font-weight: 600;
  font-size: 0.9rem;
  color: #ccc;
}

.roster-players {
  padding: 0;
}

.roster-player-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #333;
  transition: background-color 0.2s ease;
  font-size: 0.85rem;
}

.roster-player-row:hover {
  background: rgba(0, 255, 157, 0.05);
}

.roster-player-row:last-child {
  border-bottom: none;
}

.roster-position {
  font-weight: 600;
  color: var(--sleeper-accent);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.position-rank {
  font-size: 0.65rem;
  color: #888;
  font-weight: 400;
  margin-top: 1px;
}

.roster-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-headshot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.65rem;
}

.player-headshot img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.player-details {
  flex: 1;
}

.player-name {
  font-weight: 600;
  color: var(--sleeper-text);
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.player-team-bye {
  font-size: 0.75rem;
  color: #888;
}

/* Smaller font for bye week info */
.player-team-bye {
  font-size: 0.7rem;
}

.loading-roster {
  text-align: center;
  padding: 40px;
  color: #888;
  font-style: italic;
}

/* Roster section styling */
.roster-section {
  margin-bottom: 20px;
}

.roster-section-title {
  background: var(--sleeper-secondary);
  color: var(--sleeper-accent);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 15px;
  border-bottom: 2px solid var(--sleeper-accent);
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.roster-section:last-child {
  margin-bottom: 0;
}

/* Empty slot styling */
.roster-player-row.empty-slot {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.05);
}

.roster-player-row.empty-slot .player-name {
  color: #666;
  font-style: italic;
}

.roster-player-row.empty-slot .player-team-bye {
  color: #555;
  font-size: 0.8rem;
}

/* Bye week styling */
.roster-player-row.bye-week {
  opacity: 0.6;
  background: rgba(128, 128, 128, 0.2);
}

.roster-player-row.bye-week .player-name {
  color: #aaa;
}

.roster-player-row.bye-week .player-team-bye {
  color: #888;
  font-weight: 500;
}

/* Lineup comparison styling */
.roster-player-row.optimal-change {
  background: rgba(0, 255, 157, 0.1);
  border-left: 3px solid var(--sleeper-accent);
}

.change-indicator {
  color: var(--sleeper-accent);
  font-size: 0.9rem;
  margin-left: 5px;
  font-weight: bold;
}

/* Swapped out player styling */
.roster-player-row.swapped-out {
  background: rgba(255, 107, 107, 0.15);
  border-left: 3px solid #ff6b6b;
}

.swap-indicator {
  color: #ff6b6b;
  font-size: 0.9rem;
  margin-left: 5px;
  font-weight: bold;
}

/* League member dropdown styling */
#league-member-select {
  background: var(--sleeper-secondary);
  border: 1px solid #333;
  color: var(--sleeper-text);
  min-width: 200px;
  padding: 4px 12px;
  border-radius: 8px;
  height: 40px;
}

#league-member-select:focus {
  background: var(--sleeper-secondary);
  border-color: var(--sleeper-accent);
  color: var(--sleeper-text);
  box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.2);
}

#league-member-select option {
  background: var(--sleeper-secondary);
  color: var(--sleeper-text);
}

/* Position-specific roster row colors (balanced theme) */
.roster-player-row.position-qb {
  background-color: rgba(255, 107, 107, 0.25) !important;
  border-left: 3px solid #FF6B6B;
}

.roster-player-row.position-rb {
  background-color: rgba(143, 229, 181, 0.25) !important;
  border-left: 3px solid #8FE5B5;
}

.roster-player-row.position-wr {
  background-color: rgba(142, 208, 249, 0.25) !important;
  border-left: 3px solid #8ED0F9;
}

.roster-player-row.position-te {
  background-color: rgba(255, 200, 124, 0.25) !important;
  border-left: 3px solid #FFC87C;
}

.roster-player-row.position-k {
  background-color: rgba(255, 107, 107, 0.25) !important;
  border-left: 3px solid #ff6b6b;
}

.roster-player-row.position-def {
  background-color: rgba(156, 136, 255, 0.25) !important;
  border-left: 3px solid #9c88ff;
}

/* Opponent position colors on the right side */
#opponent-roster-players .roster-player-row.position-qb {
  border-left: none;
  border-right: 3px solid #FF6B6B;
}

#opponent-roster-players .roster-player-row.position-rb {
  border-left: none;
  border-right: 3px solid #8FE5B5;
}

#opponent-roster-players .roster-player-row.position-wr {
  border-left: none;
  border-right: 3px solid #8ED0F9;
}

#opponent-roster-players .roster-player-row.position-te {
  border-left: none;
  border-right: 3px solid #FFC87C;
}

#opponent-roster-players .roster-player-row.position-k {
  border-left: none;
  border-right: 3px solid #ff6b6b;
}

#opponent-roster-players .roster-player-row.position-def {
  border-left: none;
  border-right: 3px solid #9c88ff;
}

/* Shift opponent cards slightly to the right */
#opponent-roster-players .roster-player-row {
  margin-right: 8px;
}

/* Position colors now use subtle backgrounds with colored borders, no text override needed */

/* Starters gap separator */
.starters-gap {
  height: 12px;
  border-bottom: 1px solid rgba(0, 255, 157, 0.3);
  margin: 8px 12px;
}

/* Week Navigation Styles */
.week-navigation {
  display: flex;
  align-items: center;
  background: var(--sleeper-secondary);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid #333;
}

.week-nav-btn {
  background: transparent;
  border: none;
  color: var(--sleeper-text);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.week-nav-btn:hover {
  background: rgba(0, 255, 157, 0.1);
  color: var(--sleeper-accent);
}

.week-nav-btn:disabled {
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

.week-nav-btn:disabled:hover {
  background: transparent;
  color: #666;
}

.nav-arrow {
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1;
}

.current-week {
  color: var(--sleeper-text);
  font-weight: 600;
  padding: 8px 16px;
  min-width: 80px;
  text-align: center;
  font-size: 1rem;
}

/* Compact sub-column layout optimizations */
.roster-container {
  margin-bottom: 20px;
}

/* Reduce gap between user and opponent cards */
.col-6 .roster-container {
  margin-bottom: 10px;
}

.roster-header {
  padding: 12px 15px;
}

.roster-title {
  font-size: 1.1rem;
  line-height: 1.2;
  max-width: none;
}

.roster-player-row {
  grid-template-columns: 30px 1fr;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.roster-position {
  font-size: 0.75rem;
  min-width: 30px;
}

.player-headshot {
  width: 26px;
  height: 26px;
  font-size: 0.6rem;
}

.roster-player-info {
  gap: 6px;
  min-width: 0; /* Allow flex shrinking */
}

.player-details {
  min-width: 0; /* Allow flex shrinking */
}

.player-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-team-bye {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineup-toggle-inline {
  font-size: 0.75rem;
  gap: 6px;
  white-space: nowrap;
  justify-content: center;
}

.toggle-switch-inline {
  width: 32px;
  height: 16px;
}

.toggle-slider-inline:before {
  height: 10px;
  width: 10px;
  left: 2px;
  bottom: 2px;
}

.toggle-switch-inline input:checked + .toggle-slider-inline:before {
  transform: translateX(14px);
}

/* Mobile roster optimizations for compact sub-column display */
@media (max-width: 768px) {
  .league-controls {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .roster-container {
    margin-bottom: 15px;
  }
  
  .roster-header {
    padding: 8px 12px;
  }
  
  .roster-title {
    font-size: 0.9rem;
    line-height: 1.2;
    max-width: none;
  }
  
  .roster-player-row {
    grid-template-columns: 28px 1fr;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  
  .roster-position {
    font-size: 0.7rem;
    min-width: 28px;
  }
  
  .position-rank {
    font-size: 0.6rem;
    margin-top: 0px;
  }
  
  .player-headshot {
    width: 22px;
    height: 22px;
    font-size: 0.55rem;
  }
  
  .roster-player-info {
    gap: 4px;
  }
  
  .player-name {
    font-size: 0.78rem;
  }
  
  .player-team-bye {
    font-size: 0.7rem;
  }
  
  .lineup-toggle-inline {
    font-size: 0.7rem;
    gap: 4px;
  }
  
  .toggle-switch-inline {
    width: 28px;
    height: 14px;
  }
  
  .toggle-slider-inline:before {
    height: 8px;
    width: 8px;
    left: 2px;
    bottom: 2px;
  }
  
  .toggle-switch-inline input:checked + .toggle-slider-inline:before {
    transform: translateX(12px);
  }
  
  /* Further optimize column spacing for mobile sub-columns */
  .col-6 {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
  
  /* Adjust opponent card margin for mobile */
  #opponent-roster-players .roster-player-row {
    margin-right: 4px;
  }
  
  /* Optimize league member select for mobile */
  #league-member-select {
    min-width: 150px;
    font-size: 0.9rem;
    height: 32px; /* Match week navigation height: 3px + 6px + content + 6px + 3px */
    padding: 3px 10px;
  }
  
  /* Ensure View as label is aligned with dropdown */
  .league-controls .form-label {
    font-size: 0.9rem;
    line-height: 32px; /* Match dropdown height for vertical alignment */
    margin-bottom: 0 !important;
  }
  
  /* Mobile starters gap */
  .starters-gap {
    height: 10px;
    margin: 6px 8px;
  }
  
  /* Mobile week navigation */
  .week-navigation {
    padding: 3px;
  }
  
  .week-nav-btn {
    padding: 6px 10px;
    min-width: 36px;
  }
  
  .current-week {
    padding: 6px 12px;
    min-width: 70px;
    font-size: 0.9rem;
  }
  
  .nav-arrow {
    font-size: 1.1rem;
  }
}

/* Responsive adjustments for API docs */
@media (max-width: 768px) {
  .api-section {
    margin-bottom: 2rem;
  }
  
  .twitter-section {
    margin-bottom: 1.5rem;
  }
  
  .example-item code {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
  }
}