/* 
 * Fil: /assets/css/public.css
 * Syfte:
 * - Legacy/publik CSS
 * - Startsida, navbar och publika startsidesblock
 *
 * Obs:
 * Gemensam grund-CSS ligger numera i:
 * - /assets/css/base.css
 * - /assets/css/components.css
 * - /assets/css/tables.css
 * - /assets/css/layout-public.css
 * - /assets/css/tip-forms.css
 * - /assets/css/score-tables.css
 */

:root {
  --nav-link: rgba(255,255,255,.78);
  --nav-link-disabled: rgba(255,255,255,.42);
}

/* Layout för startsidans block */
.home-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

@media (max-width: 992px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.muted-note {
  color: var(--ft-muted);
}

/* ===== Navbar look (public) ===== */

/* Alla menylänkar: som "Forum"-känsla, inte övergrå */
.navbar-public .nav-link {
  color: rgba(255,255,255,.85);
}

.navbar-public .nav-link:hover {
  color: rgba(255,255,255,1);
}

/* Forum + Onlinetips: vit som brand */
.navbar-public .nav-link.nav-link--primary {
  color: rgba(255,255,255,1);
}

/* Låsta länkar: grå men inte "för döda" */
.navbar-public .nav-link.is-locked {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

/* Sticky ska ligga över content */
.navbar-public.sticky-top {
  z-index: 1030;
}

/* ===== Startsida: Nedräkning (gamla stilen: 4 kolumner) ===== */

.countdown-old {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  justify-items: center;
  align-items: end;
  padding-top: .25rem;
}

.cd-num {
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.cd-label {
  margin-top: .25rem;
  font-size: .9rem;
  letter-spacing: .06em;
  font-weight: 600;
  opacity: .75;
  text-align: center;
}

@media (max-width: 576px) {
  .countdown-old {
    gap: .9rem;
  }

  .cd-label {
    font-size: .8rem;
  }
}

/* ===== Startsida: Nästa match / nästa matcher ===== */

.next-matches-card .card-body {
  padding: 1.35rem;
}

.next-matches-title {
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 850;
}

.next-matches-meta {
  display: grid;
  gap: .35rem;
  justify-items: center;
  margin-bottom: 1rem;
  color: var(--ft-muted);
  font-weight: 700;
}

.next-matches-time {
  font-size: 1rem;
}

.next-matches-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: #e9ecef;
  color: #495057;
  font-size: .85rem;
  font-weight: 800;
}

.next-matches-list {
  display: grid;
  gap: .85rem;
}

.next-match-item {
  padding: .9rem;
  border-radius: var(--ft-radius-lg);
  background: #f8f9fa;
  border: 1px solid var(--ft-border-color-soft);
}

.next-match-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .45rem .75rem;
  margin-bottom: .85rem;
  color: var(--ft-muted);
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
}

.next-match-stage {
  color: #1f2633;
  font-weight: 850;
}

.next-match-venue {
  color: var(--ft-muted);
}

.next-match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr);
  align-items: end;
  gap: .5rem;
}

.next-match-team {
  display: grid;
  grid-template-rows: 46px auto;
  justify-items: center;
  align-items: end;
  min-width: 0;
  text-align: center;
}

.next-match-team .flag {
  transform: scale(.62);
  transform-origin: center;
  margin: 0;
}

.next-match-team-name {
  max-width: 100%;
  color: #1f2633;
  font-size: 1.12rem;
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.next-match-vs {
  align-self: end;
  padding-bottom: .1rem;
  color: var(--ft-muted);
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1.15;
}

.next-match-divider {
  margin: 1.2rem 0 1rem;
}

.next-match-countdown {
  padding-top: 0;
}

@media (max-width: 576px) {
  .next-matches-card .card-body {
    padding: 1.15rem;
  }

  .next-matches-title {
    font-size: 1.75rem;
  }

  .next-match-item {
    padding: .85rem;
  }

  .next-match-info {
    margin-bottom: .75rem;
  }

  .next-match-teams {
    grid-template-columns: minmax(0, 1fr) 1.5rem minmax(0, 1fr);
    gap: .35rem;
  }

  .next-match-team {
    grid-template-rows: 42px auto;
  }

  .next-match-team .flag {
    transform: scale(.58);
  }

  .next-match-team-name {
    font-size: 1.08rem;
  }

  .next-match-vs {
    font-size: 1.1rem;
  }
}

/* ===== Startsida: Besöksstatistik ===== */

.visitor-stats-card .card-body {
  padding: 1.35rem;
}

.visitor-stats-title {
  margin-bottom: 1rem;
  font-weight: 800;
}

.visitor-stats-list {
  display: grid;
  gap: .45rem;
}

.visitor-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem .65rem;
  border-radius: .55rem;
  background: #f8f9fa;
}

.visitor-stats-label {
  color: #495057;
  font-weight: 650;
}

.visitor-stats-value {
  min-width: 3.5rem;
  text-align: right;
  font-size: 1.05rem;
  font-weight: 850;
  color: #1f2633;
}

.visitor-stats-total {
  margin-top: .2rem;
  background: #e9ecef;
}

.visitor-stats-total .visitor-stats-label,
.visitor-stats-total .visitor-stats-value {
  font-weight: 850;
}

.visitor-stats-record {
  margin-top: .9rem;
  padding: .7rem .75rem;
  border-radius: .55rem;
  background: #fff3cd;
  border: 1px solid #ffe69c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.visitor-stats-record span {
  font-weight: 750;
  color: #664d03;
}

.visitor-stats-record strong {
  text-align: right;
  color: #664d03;
}

.visitor-stats-record small {
  font-weight: 650;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .visitor-stats-card .card-body {
    padding: 1.15rem;
  }

  .visitor-stats-row {
    padding: .55rem .7rem;
  }

  .visitor-stats-value {
    min-width: 3rem;
  }

  .visitor-stats-record {
    align-items: flex-start;
  }
}

/* ===== Startsida: Nyheter ===== */

.news-card .card-body {
  padding: 1.35rem;
}

.news-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}

.news-card-title {
  margin-bottom: 0;
  font-weight: 800;
}

.news-page-indicator {
  color: var(--ft-muted);
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  padding-top: .15rem;
}

.news-list {
  display: grid;
  gap: 1rem;
}

.news-item {
  padding: .85rem .9rem;
  border-radius: .7rem;
  background: #f8f9fa;
  border: 1px solid var(--ft-border-color-soft);
}

.news-item-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.2;
  color: #1f2633;
}

.news-item-date {
  margin-top: .25rem;
  color: var(--ft-muted);
  font-size: .86rem;
  font-weight: 650;
}

.news-item-body {
  margin-top: .65rem;
  color: #1f2633;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* ===== Nyhetsnavigering ===== */

.news-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1rem;
}

.news-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  padding: .55rem .8rem;
  border-radius: .65rem;
  background: #f1f3f5;
  border: 1px solid var(--ft-border-color-soft);
  color: #1f2633;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.15;
}

.news-nav-button:hover,
.news-nav-button:focus {
  background: #e9ecef;
  color: #1f2633;
  text-decoration: none;
}

.news-nav-button-primary {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

.news-nav-button-primary:hover,
.news-nav-button-primary:focus {
  background: #0b5ed7;
  border-color: #0a58ca;
  color: #fff;
}

@media (max-width: 576px) {
  .news-card .card-body {
    padding: 1.15rem;
  }

  .news-card-heading {
    flex-direction: column;
    gap: .25rem;
  }

  .news-item {
    padding: .8rem .85rem;
  }

  .news-nav {
    display: grid;
  }

  .news-nav-button {
    width: 100%;
  }
}

/* =========================================================
   Publik topplista
   Ursprung: /public/topplista.php
   ========================================================= */

.public-toplist-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.public-toplist-card {
  border: 1px solid var(--ft-border-color);
  border-radius: var(--ft-radius-lg);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.05);
}

.public-toplist-row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--ft-border-color-soft);
}

.public-toplist-row:last-child {
  border-bottom: 0;
}

.public-toplist-rank {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(13,110,253,.10);
  color: var(--bs-primary);
  font-weight: 800;
  font-size: .95rem;
}

.public-toplist-name {
  font-weight: 750;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: anywhere;
}

.public-toplist-points {
  font-weight: 900;
  white-space: nowrap;
  text-align: right;
  font-size: 1.05rem;
}

.public-toplist-top3 .public-toplist-rank {
  background: rgba(255,193,7,.22);
  color: #8a6400;
}

/* Färgförklaring */

.public-toplist-legend-card {
  border: 1px solid var(--ft-border-color);
  border-radius: var(--ft-radius-lg);
  background: #fff;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.05);
}

.public-toplist-legend-title {
  font-weight: 800;
  margin-bottom: .75rem;
}

.public-toplist-legend-list {
  display: grid;
  gap: .65rem;
}

.public-toplist-legend-item {
  line-height: 1.35;
}

.public-toplist-legend-swatch {
  display: inline-block;
  min-width: 5.3rem;
  text-align: center;
  padding: .08rem .38rem;
  border-radius: .18rem;
  font-weight: 800;
  color: #111;
  border: 1px solid var(--ft-border-color);
}

.public-toplist-legend-points {
  font-weight: 700;
}

.public-toplist-legend-desc {
  margin-top: .12rem;
  color: #495057;
}

.public-toplist-legend-muted {
  color: var(--ft-muted);
}

/*
 * Samma poängfärger som Topp 5/Rätta tipset/Rätta polarna.
 */

.legend-points-1 {
  background: #ffff1A;
  color: #111;
}

.legend-points-2 {
  background: #B8D6FE;
  color: #111;
}

.legend-points-3 {
  background: #FFA500;
  color: #111;
}

.legend-points-4 {
  background: #80FF80;
  color: #111;
}

.legend-points-5 {
  background: #ff3333;
  color: #111;
}

.legend-points-6 {
  background: #F390FC;
  color: #111;
}

.legend-points-7 {
  background: #0066ff;
  color: #111;
}

.legend-points-8 {
  background: #4CAF50;
  color: #071f07;
}

.legend-points-9 {
  background: #548235;
  color: #fff;
}

.legend-points-10 {
  background: #AA71e8;
  color: #111;
}

.legend-points-other {
  background: #e9ecef;
  color: #111;
}

@media (max-width: 576px) {
  .public-toplist-row {
    grid-template-columns: 2.45rem minmax(0, 1fr) auto;
    gap: .55rem;
    padding: .7rem .75rem;
  }

  .public-toplist-rank {
    width: 1.95rem;
    height: 1.95rem;
    font-size: .9rem;
  }

  .public-toplist-name {
    font-size: .98rem;
  }

  .public-toplist-points {
    font-size: 1rem;
  }

  .public-toplist-legend-card {
    padding: .85rem;
  }

  .public-toplist-legend-swatch {
    min-width: 4.8rem;
  }
}