/* Gauntlet Page Styles - Simplified and Modular */

/* Extended Color Variables for Gauntlet (only adding what's missing from styles.css) */
:root {
  --green-500: #4caf50;
  --red-500: #f44336;
  --default-lines-color: #666;
}

/* Rules Section Styles */
.rules-section {
  max-width: 850px;
  margin: 0px auto;
  padding: 0 0 20px 0;
}

.rules-container {
  background: var(--color-beige);
  border: 2px solid var(--default-lines-color);
  border-radius: 8px;
  overflow: hidden;
}

.rules-toggle {
  width: 100%;
  padding: 8px 20px;
  background: var(--background-alt);
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-black);
  transition: background-color 0.3s ease;
}

.rules-toggle:hover {
  background: #e8e8d0;
}

.toggle-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.rules-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

.rules-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.rules-content.expanded {
  max-height: 2500px;
  padding: 20px;
}

.rules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .rules-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.rules-card {
  background: var(--color-white);
  border: 1px solid var(--default-lines-color);
  border-radius: 6px;
  padding: 16px;
}

.rules-card h3 {
  margin: 0 0 12px 0;
  color: var(--color-black);
  font-size: 16px;
  border-bottom: 2px solid var(--green-500);
  padding-bottom: 8px;
}

.rules-card h4 {
  margin: 12px 0 8px 0;
  color: var(--color-black);
  font-size: 14px;
}

.rules-subsection {
  margin-bottom: 16px;
}

.rules-subsection:last-child {
  margin-bottom: 0;
}

.rules-card ul {
  margin: 8px 0;
  padding-left: 20px;
}

.rules-card li {
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.4;
}

.rules-card p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.4;
}

.rules-card code {
  background: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 13px;
}

.rules-card strong {
  color: var(--color-black);
}

/* Contribution Values Styling */
.contribution-value {
  font-style: italic;
  color: #888;
  font-size: 0.7em;
}

/* Layout */
.competition-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.competition-header {
  display: flex;
  align-items: stretch;
}

.competition-info {
  flex-grow: 1;
  margin-right: 20px;
}

/* Competition Logo Link */
.competition-logo-link {
  text-decoration: none;
}

.competition-logo {
  height: auto;
  max-height: 100%;
  width: auto;
  margin-right: 18px;
  border-radius: 8px;
  object-fit: contain;
  cursor: pointer;
}

.container {
  padding-top: 0px;
  margin: 0 auto;
}

/* Countdown Styles */
.countdown-container {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.countdown-item {
  font-family: monospace;
}

.countdown-label {
  font-weight: bold;
}

.countdown-label--next {
  color: var(--green-500);
}

.countdown-label--current {
  color: var(--red-500);
}

/* Challenges Grid */
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.challenge-item {
  padding: 10px 18px;
  border-radius: 0;
  background: #fff9c4;
  color: #888;
  opacity: 0.7;
}

.challenge-item--past {
  background: #b0bec5;
}

.challenge-item--active {
  background: #a5d6a7;
  color: #222;
  font-weight: bold;
  box-shadow: 0 2px 8px #a5d6a7aa;
  opacity: 1;
}

.challenge-name {
  font-size: 1.1em;
}

.challenge-id {
  font-size: 0.95em;
  color: #7e57c2;
}

/* Challenge Status Elements */
.challenge-status {
  font-weight: normal;
  font-size: 0.9em;
}

.challenge-status--active {
  color: var(--green-500);
}

.challenge-status--locked {
  color: var(--red-500);
}

/* Tab System */
.tab-container {
  display: flex;
  border-bottom: 2px solid #ccc;
  margin-bottom: 24px;
  width: 850px;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: var(--color-beige);
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
}

.tab-btn--active,
.tab-btn.active {
  border-bottom: 3px solid var(--color-black);
}

.tab-content {
  display: none;
}

.tab-content--active,
.tab-content.active {
  display: block;
}

/* Leaderboards */
.leaderboard-section {
  margin-bottom: 32px;
}
.leaderboard-section th {
  margin-bottom: 32px;
}

.leaderboard-table {
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 16px;
  background: var(--color-beige);
}

.leaderboard-table th,
.leaderboard-table td {
  border: 1px solid #666;
  padding: 8px;
  text-align: left;
}

.leaderboard-table th {
  font-weight: bold;
}

/* Table Cell Types */
.cell-rank {
  font-weight: bold;
  text-align: center;
  width: 40px;
}

.cell-player {
  font-family: monospace;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-score {
  text-align: right;
  font-weight: bold;
  width: 80px;
}

.cell-score--small {
  width: 70px;
  font-size: 0.9em;
}

.cell-score--total {
  width: 90px;
  color: var(--green-500);
}

.cell-date {
  font-size: 0.9em;
  color: #666;
  width: 100px;
}

.cell-challenge {
  font-size: 0.85em;
  color: #666;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Highlighted Ticks Column */
.highlight-metric {
  background-color: #c8e6c9 !important;
  border-left: 2px solid #4caf50 !important;
  border-right: 2px solid #4caf50 !important;
  font-weight: 900 !important;
}

th.highlight-metric {
  background-color: #c8e6c9 !important;
}

/* Status Messages */
.status-message {
  text-align: center;
  font-style: italic;
}

.status-message--loading {
  color: #666;
}

.status-message--error {
  color: var(--red-500);
}

/* Notes and Metadata */
.leaderboard-note {
  color: #888;
  font-size: 0.9em;
}

.last-update {
  color: #888;
  font-style: italic;
  font-size: 0.95em;
}

/* Legacy class names for compatibility */
.gauntlet-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}

.gauntlet-title {
  font-size: 2em;
  margin: 24px auto;
  color: #333;
}


#gauntlet-leaderboard th {
  margin-bottom: 32px;
  min-width: 100px;
}


/* Legacy table styles */

table th,
table td {
  border: 1px solid var(--default-lines-color);
  padding: 8px;
}

table {
  width: 100%;
  max-width: 1200px;
  border-collapse: collapse;
  border: 1px solid var(--default-lines-color);
  margin: 12px 0;
  font-size: 16px;
  background: var(--color-beige);
}

th,
td {
  border: 1px solid var(--default-lines-color);
  padding: 8px;
  text-align: left;
}

th {
  font-weight: bold;
}

.rank {
  font-weight: bold;
  text-align: center;
  width: 40px;
}

.player {
  font-family: monospace;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  text-align: right;
  font-weight: bold;
  width: 90px;
}

.date {
  font-size: 0.9em;
  color: #666;
  width: 65px;
}

.loading {
  text-align: center;
  color: #666;
  font-style: italic;
}

.error {
  text-align: center;
  color: var(--red-500);
  font-style: italic;
}

.score-column {
  text-align: right;
  font-weight: bold;
  width: 70px;
  font-size: 0.9em;
}

.total-score {
  text-align: right;
  font-weight: bold;
  width: 90px;
  color: var(--green-500);
}

.best-challenge {
  font-size: 0.85em;
  color: #666;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Legacy tab styles */
.tab-btn {
  flex: 1;
  padding: 12px;
  background: var(--color-beige);
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
}

.tab-btn.active,
.tab-btn--active {
  border-bottom: 3px solid var(--color-black);
}

.tab-content {
  display: none;
}

.tab-content.active,
.tab-content--active {
  display: block;
}

/* Challenge Selector */
.challenge-selector-container {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  padding-bottom: 12px;
  width: fit-content;
}

.challenge-selector-label {
  font-weight: bold;
  color: #333;
  white-space: nowrap;
}

.challenge-selector {
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--color-beige);
  font-size: 16px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  min-width: 300px;
}

.challenge-selector:focus {
  outline: none;
  border-color: var(--color-purple);
  box-shadow: 0 0 5px rgba(126, 87, 194, 0.3);
}

.challenge-selector option {
  font-weight: normal;
}

/* Week Summary Styles */
.week-summary-section {
  margin-bottom: 32px;
}

.week-summary-container {
  max-width: 850px;
  margin: 0 auto;
}

.summary-row {
  margin-bottom: 40px;
}

.summary-row h3 {
  text-align: center;
  margin-top: 0px;
  margin-bottom: 20px;
  font-size: 1.5em;
  color: var(--color-black);
  font-weight: bold;
}

.champions-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.champion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-beige);
  padding: 20px;
  border-radius: 12px;
  border: 2px solid var(--default-lines-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  min-width: 150px;
}

.champion-card:hover {
  transform: translateY(-2px);
}

.champion-image {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin-bottom: 10px;
}

.champion-name {
  font-weight: bold;
  text-align: center;
  margin-bottom: 5px;
  font-size: 1.1em;
  color: var(--color-black);
}

.champion-score {
  font-size: 0.9em;
  color: #666;
  text-align: center;
}

.pioneers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  justify-items: center;
}

.pioneer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-beige);
  padding: 20px;
  border-radius: 12px;
  border: 2px solid var(--default-lines-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  min-width: 150px;
}

.pioneer-card:hover {
  transform: translateY(-2px);
}

.pioneer-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 8px;
}

.pioneer-metric {
  font-weight: bold;
  color: var(--color-purple);
  margin-bottom: 5px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pioneer-name {
  font-weight: bold;
  text-align: center;
  margin-bottom: 5px;
  font-size: 1em;
  color: var(--color-black);
}

.pioneer-score {
  font-size: 0.8em;
  color: #666;
  text-align: center;
}

.no-data, .error {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

/* Gauntlet Champions Styles - similar to week summary but for overall rankings */
.gauntlet-champions-section {
  margin-bottom: 32px;
}

.gauntlet-champions-container {
  max-width: 850px;
  margin: 0 auto;
}

.gauntlet-champions-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .gauntlet-champions-grid {
    gap: 15px;
  }
  
  .gauntlet-champions-grid .champion-card {
    min-width: 120px;
  }
  
  .gauntlet-champions-grid .champion-image {
    width: 120px;
    height: 120px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .challenges-grid {
    grid-template-columns: 1fr;
  }

  .competition-header {
    flex-direction: column;
    align-items: center;
  }

  .competition-info {
    margin-right: 0;
    margin-top: 15px;
  }

  .countdown-container {
    justify-content: center;
  }

  .tab-container {
    flex-wrap: wrap;
    width: 100%;
  }

  .table-content-overall {
    width: 100%;
  }
  .tab-btn {
    flex: none;
    min-width: 120px;
  }

  /* Week Summary Mobile Styles */

  .pioneers-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
  }

  .champion-card, .pioneer-card {
    min-width: 130px;
    padding: 15px;
  }

  .champion-image {
    width: 60px;
    height: 60px;
  }

  .pioneer-image {
    width: 50px;
    height: 50px;
  }
}

/* Progress chart */
.progress-chart-container {
  max-width: 800px;
  margin: 20px auto;
}
#progressControls {
  text-align: center;
  margin-bottom: 10px;
}
