/**
 * Fil: /assets/css/statistik.css
 * Syfte: Publik statistiksida för gruppspelsmatcher.
 */

/* Sida */
.statistik-page {
  max-width: 980px;
  margin: 0 auto;
}

.statistik-page-title {
  margin-bottom: 1rem;
}

.statistik-page-title h1 {
  margin-bottom: .15rem;
}

/* Kort */
.statistik-card {
  background: #fff;
  border: 1px solid var(--ft-border-color);
  border-radius: .85rem;
  box-shadow: 0 .125rem .35rem rgba(0,0,0,.06);
  overflow: hidden;
}

.statistik-card-header {
  padding: .9rem 1rem .65rem;
  border-bottom: 1px solid var(--ft-border-color-soft);
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

.statistik-card-body {
  padding: 1rem;
}

.statistik-card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1.15;
}

/* Välj match */
.statistik-select-card {
  max-width: 760px;
  margin: 0 auto;
}

.statistik-select-label {
  font-weight: 800;
  margin-bottom: .4rem;
}

.statistik-select-actions {
  margin-top: .9rem;
  display: flex;
  justify-content: center;
}

/* Matchkort */
.statistik-match-card {
  text-align: center;
}

.statistik-match-time {
  font-weight: 850;
  color: #495064;
  margin-bottom: .45rem;
  font-size: 1rem;
}

.statistik-match-title {
  font-weight: 900;
  color: #1f2633;
  font-size: 1.25rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
  margin-bottom: .45rem;
}

.statistik-match-flags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: .45rem;
}

.statistik-match-result {
  text-align: center;
  font-weight: 900;
  font-size: 1.1rem;
  color: #1f2633;
  white-space: nowrap;
  margin-bottom: .35rem;
}

.statistik-match-venue {
  text-align: center;
  color: var(--ft-muted);
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/*
 * Flaggor.
 * Samma sprite-system som /user/tip_matches.php.
 */
.statistik-flag {
  display: inline-block;
  width: auto;
  height: auto;
  line-height: 1;
  flex: 0 0 auto;
}

.statistik-flag-sprite {
  transform: scale(.58);
  transform-origin: center center;
  margin: 0;
}

.statistik-flag-placeholder {
  display: inline-block;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: #e9ecef;
  border: 1px solid var(--ft-border-color-soft);
}

/* Statistiklayout */
.statistik-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.statistik-section {
  margin-top: 1rem;
}

.statistik-section-title {
  font-size: 1.1rem;
  font-weight: 850;
  margin-bottom: .55rem;
}

.statistik-section-subtitle {
  color: var(--ft-muted);
  font-size: .92rem;
  margin-bottom: .75rem;
}

/* Staplar */
.statistik-bar-list {
  display: grid;
  gap: .55rem;
}

.statistik-bar-row {
  display: grid;
  grid-template-columns: 4.7rem minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.statistik-bar-row:hover .statistik-bar-track,
.statistik-bar-row:focus .statistik-bar-track {
  outline: 2px solid rgba(13,110,253,.35);
  outline-offset: 2px;
}

.statistik-bar-count {
  text-align: right;
  font-weight: 850;
  color: #1f2633;
  white-space: nowrap;
}

.statistik-bar-track {
  position: relative;
  min-height: 2.35rem;
  border-radius: .35rem;
  background: #d8edf0;
  border: 1px solid var(--ft-border-color);
  overflow: hidden;
}

.statistik-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: #52c66d;
  border-right: 1px solid rgba(0,0,0,.16);
}

.statistik-bar-label {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: .25rem .45rem;
  font-weight: 900;
  color: #111;
  text-align: center;
  white-space: nowrap;
}

/* Detaljlista */
.statistik-detail-card {
  margin-top: 1rem;
}

.statistik-detail-title {
  font-size: 1.1rem;
  font-weight: 850;
  margin-bottom: .25rem;
}

.statistik-detail-meta {
  color: var(--ft-muted);
  font-size: .92rem;
  margin-bottom: .8rem;
}

.statistik-name-list {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.statistik-name-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .7rem;
  border: 1px solid var(--ft-border-color);
  border-radius: .55rem;
  background: #fff;
}

.statistik-name-main {
  font-weight: 800;
  line-height: 1.15;
}

.statistik-name-points {
  color: var(--ft-muted);
  font-size: .9rem;
  font-weight: 750;
  white-space: nowrap;
}

/* Navigering */
.statistik-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.statistik-empty {
  padding: 1rem;
  color: var(--ft-muted);
  background: #f8f9fa;
  border-radius: .6rem;
  text-align: center;
}

/* Mobil */
@media (max-width: 576px) {
  .statistik-page-title h1 {
    font-size: 1.45rem;
  }

  .statistik-card-header {
    padding: .85rem .85rem .6rem;
  }

  .statistik-card-body {
    padding: .85rem;
  }

  .statistik-match-title {
    font-size: 1.08rem;
  }

  .statistik-match-flags {
    gap: 1rem;
  }

  .statistik-flag-sprite {
    transform: scale(.55);
  }

  .statistik-flag-placeholder {
    width: 2.15rem;
    height: 2.15rem;
  }

  .statistik-bar-row {
    grid-template-columns: 4.2rem minmax(0, 1fr);
    gap: .5rem;
  }

  .statistik-bar-track,
  .statistik-bar-label {
    min-height: 2.2rem;
  }

  .statistik-name-item {
    align-items: flex-start;
    flex-direction: column;
    gap: .15rem;
  }
}