/* player-stats.css (Version 5.4 - Final Flexbox Fix) */

#player-stats-app {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: transparent !important;
  color: #fff;
  max-width: 100%;
  padding: 0;
  margin: 0;
  overflow-x: auto;
}
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  background: transparent;
}
.tab-button {
  border: 1.5px solid #161c2c;
  background: #161c2c;
  color: #fff;
  border-radius: 9999px;
  font-size: 13px;
  padding: 5px 16px;
  cursor: pointer;
  font-weight: 500;
  outline: none;
  margin-right: 2px;
  transition: border-color 0.1s, color 0.1s, background-color 0.1s;
  box-shadow: none;
}
#player-stats-app .tab-button:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 130, 14, 0.5);
}
.tab-button.active {
  color: #fff;
  background: #161c2c;
  border: 2px solid #ff820e;
  box-shadow: none;
}

.season-row, .label-row {
  display: flex;
  align-items: center;
  background: transparent;
  min-height: 38px;
  transition: background 0.12s;
  padding: 0 4px;
}
.label-row {
  font-size: 14px;
  color: #fff;
  font-weight: 700;
  opacity: 0.97;
  margin-bottom: 3px;
}
.season-row.expanded {
  background: rgba(22,28,44,0.10);
}

.season-divider {
    height: 1.5px;
    background-color: rgba(255, 255, 255, 0.12);
    margin: 0 4px;
}

#player-stats-app > .season-divider:last-of-type {
    display: none;
}

.season-cell {
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 15px;
  flex-shrink: 0;
}
.col-toggle { flex-basis: 32px; justify-content: center; cursor: pointer; user-select: none; color: #aaa; font-size: 16px; }
.col-toggle-label { flex-basis: 32px; }
.col-year { flex-basis: 60px; font-weight: 700; }
.col-team { flex-basis: 45px; }

.label-row .col-year, .label-row .col-team { justify-content: center; }
.stat-item-label { text-align: center; }

.stats-block {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0; /* --- DENNE LINJE LØSER PROBLEMET PERMANENT --- */
}
.stat-item {
  width: 55px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.stat-item-label {
  width: 55px;
  font-weight: 700;
  font-size: 14px;
  opacity: 0.98;
  text-align: center;
}

.stat-item-rating, .stat-item-label-rating { width: 65px; }

.rating-box {
  display: inline-block; padding: 2px 8px; border-radius: 9999px; color: #fff;
  font-weight: 700; min-width: 42px; text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.3); background-clip: padding-box;
}

.col-league-info {
  flex-basis: 137px;
  padding-left: 4px;
  min-width: 0;
}
.col-team img, .col-league-info img.league-logo {
  height: 18px; width: 18px; margin-right: 8px; border-radius: 2px;
}
.league-name {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.96;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-details {
  overflow: hidden; max-height: 0px; opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.23s;
}
.season-row.expanded + .dropdown-details { opacity: 1; }

.stats-legend {
  display: none;
  margin-top: 24px;
  padding: 0 4px;
}

.stats-legend ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stats-legend li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: #fff;
}

.stats-legend li:last-child {
  margin-bottom: 0;
}

.stats-legend li strong {
  font-weight: 700;
  width: 50px;
  flex-shrink: 0;
  color: #fff;
}

.stats-legend li span {
  opacity: 0.9;
  padding-left: 10px;
}

@media (max-width: 600px) {
  .stats-legend {
    display: block;
  }

  #player-stats-app { overflow-x: hidden; }
  .tab-button { font-size: 12px; padding: 4px 10px; }
  .season-cell, .stat-item { font-size: 14px; }
  .col-toggle, .col-toggle-label { flex-basis: 28px; }
  .col-year { flex-basis: 55px; }
  .col-team { flex-basis: 35px; }
  .stats-block { gap: 2px; }
  .stat-item, .stat-item-label { width: 42px; }
  .stat-item-label { font-size: 12px; }
  .stat-item-rating, .stat-item-label-rating { width: 52px; }
  .col-league-info { flex-basis: 118px; }
  .rating-box { font-size: 13px; padding: 2px 6px; min-width: 0; }
  .league-name { font-size: 13px; }

  .stats-legend li {
    font-size: 13px;
  }
}
