﻿/* ==========================================================
   MATCHINFO & PERIOD TABLE STYLING
   SC Saragoza / Poseidon Child Theme
   ========================================================== */

/* --- GLOBAL BASE --- */
:root {
  --scs-primary: #e8000;    /* lagfärg */
  --scs-accent: #ba0000;     /* highlight (mål, RL etc.) */
  --scs-light: #ff2d2d;
  --scs-border: #ebebeb;
  --scs-text: #900000;
}

body {
  font-family: "Exo", "Roboto", "Ubuntu Condensed", sans-serif;
}

/* ==========================================================
   MATCH INFO BOX
   ========================================================== */

.match-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 0.8rem;
    margin: 0.8rem 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

/* === Header === */
.match-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-bottom: 1rem;
}
.team {
    flex: 1;
    text-align: center;
}
.team img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}
.team .team-name {
    font-weight: 700;
    font-size: 1.5rem;
    color: #222;
}
.result-box {
    flex: 0 0 150px;
    text-align: center;
}
.result-box .score {
    font-size: 3.5rem;
    font-weight: 800;
    color: #111;
}
.result-box .periods {
    font-size: 1rem;
    color: #666;
}

/* === Info cards === */
.matchinfo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
.match-card {
    flex: 0 0 145px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    padding: 0.6rem;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.match-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.match-card svg {
    width: 30px;
    height: 30px;
    margin-bottom: 0.3rem;
    fill: #e80000;
}
.match-card div {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}
.match-card a {
    text-decoration: none;
    color: #e80000;
    font-weight: 600;
}
.match-card a:hover {
    text-decoration: none;
    color: #e63946;
}

/* === Responsive === */
@media (max-width: 768px) {
    .match-header {
        flex-direction: column;
    }
    .match-card {
        flex: 1 1 45%;
    }
}

.match-period-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 0.95rem;
  table-layout: fixed;
}

.match-period-table thead {
  background: #ebebeb;
}

.match-period-table th, 
.match-period-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  word-wrap: break-word;
}

.match-period-table th:nth-child(1),
.match-period-table td:nth-child(1) {
	width: 15%; /* Händelse */
}

.match-period-table th:nth-child(2),
.match-period-table td:nth-child(2) {
	width: 10%; /* Tid */
}

.match-period-table th:nth-child(3),
.match-period-table td:nth-child(3) {
	width: 30%; /* Målskytt */
}

.match-period-table th:nth-child(4),
.match-period-table td:nth-child(4) {
	width: 30%; /* Assist */
}

.match-period-table th:nth-child(5),
.match-period-table td:nth-child(5) {
	width: 15%; /* Kod */
}

.match-period-table tr:nth-child(even) {
  background-color: #fafafa;
}

.match-period-table tr:hover {
  background-color: #f0f8ff;
}

.match-period-table td a {
  color: #e80000;
  text-decoration: none;
  font-weight: 500;
}

.match-period-table td a:hover {
  text-decoration: bold;
}

/* Responsiv hantering */
@media (max-width: 768px) {
  .match-period-table {
    font-size: 0.85rem;
  }
  .match-period-table th, .match-period-table td {
    padding: 6px;
  }
}

.match-info-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--scs-light);
  border: 1px solid var(--scs-border);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1rem auto 2rem auto;
  max-width: 900px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  text-align: center;
  flex-wrap: wrap;
}

.match-header .team {
  flex: 1 1 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.match-header img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.match-header .score {
  flex: 0 0 auto;
  font-size: 3rem;
  font-weight: 700;
  color: var(--scs-primary);
}

.match-header .periods {
  font-size: 1rem;
  color: #666;
}

.match-cards-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ==========================================================
   MATCH INFO CARDS (livescore / SalibandyTV)
   ========================================================== */

.match-card {
  flex: 1 1 145px;
  min-width: 120px;
  background: white;
  border: 1px solid var(--scs-border);
  border-radius: 12px;
  text-align: center;
  padding: 0.8rem;
  text-decoration: none;
  color: var(--scs-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease-in-out;
}

.match-card:hover {
  background: var(--scs-primary);
  color: white;
  transform: translateY(-2px);
}

.match-card svg {
  display: block;
  margin: 0 auto 0.3rem auto;
  width: 28px;
  height: 28px;
  fill: var(--scs-primary); /* alltid röd */
  transition: transform 0.2s ease;
}

.match-card:hover svg {
  fill: var(--scs-primary); /* håll samma färg även vid hover */
  transform: scale(1.1);
}

/* ==========================================================
   PERIOD TABLES
   ========================================================== */

.period-header {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  text-align: left;
  color: var(--scs-primary);
}

.match-period-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.match-period-table thead {
  background: var(--scs-primary);
  color: #111;
  font-size: 0.95rem;
}

.match-period-table th,
.match-period-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--scs-border);
  vertical-align: middle;
}

.match-period-table tr:last-child td {
  border-bottom: none;
}

.match-period-table tbody tr:hover {
  background: #fff4f4; /* mycket ljus rödaktig bakgrund */
}

.match-period-table td a {
  color: var(--scs-primary);
  text-decoration: none;
  font-weight: 600;
}

.match-period-table td a:hover {
  color: var(--scs-accent);
  text-decoration: none;
}

/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */

@media (max-width: 768px) {
  .match-header img {
    width: 60px;
    height: 60px;
  }

  .match-header .score {
    font-size: 2.2rem;
  }

  .match-card {
    flex: 1 1 120px;
  }

  .match-period-table th,
  .match-period-table td {
    font-size: 0.9rem;
    padding: 0.4rem 0.5rem;
  }
}

@media (max-width: 500px) {
  .match-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .match-cards-row {
    flex-direction: column;
    width: 100%;
  }

  .match-card {
    width: 100%;
  }

  .match-period-table {
    font-size: 0.85rem;
  }
}

/* ==========================================================
   PLAYER LINEUPS
   ========================================================== */

.lineups-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.team-lineup {
  flex: 1 1 45%;
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  text-align: center;
}

.team-lineup h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: var(--scs-text);
}

.team-lineup img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.players-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.player-card {
  flex: 0 0 140px;
  background: #fafafa;
  border: 1px solid var(--scs-border);
  border-radius: 12px;
  padding: 0.8rem;
  text-align: center;
  transition: all 0.25s ease;
}

.player-card:hover {
  background: #fff5f5;
  transform: translateY(-2px);
}

.player-number {
  background: var(--scs-primary);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  line-height: 32px;
  margin: 0 auto 0.4rem auto;
}

.player-card a {
  color: var(--scs-primary);
  text-decoration: none;
  font-weight: 600;
}

.player-card a:hover {
  text-decoration: underline;
}

.player-stats {
  font-size: 0.85rem;
  color: #444;
}

.lineups-section {
  background: #fff;
  border-radius: 20px;
  padding: 1rem 1.5rem 2rem;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  margin-top: 2rem;
}

.lineups-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--scs-primary);
  margin-bottom: 1.5rem;
}

.lineups-teams {
  display: flex;
  justify-content: space-around;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.team-lineup {
  flex: 1 1 45%;
  background: #fafafa;
  border: 1px solid var(--scs-border);
  border-radius: 14px;
  padding: 1rem;
}

.team-header {
  text-align: center;
  margin-bottom: 0.8rem;
}

.team-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.team-logo.fallback {
  stroke: #bbb;
  fill: none;
}

.player-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
}

.player-number {
  width: 30px;
  font-weight: 700;
  color: var(--scs-primary);
}

.player-name a {
  color: #222;
  text-decoration: none;
  font-weight: 600;
}

.player-name a:hover {
  text-decoration: underline;
  color: var(--scs-accent);
}

.player-stats {
  font-size: 0.85rem;
  color: #666;
}

@media (max-width: 768px) {
  .lineups-teams {
    flex-direction: column;
  }
  .team-lineup {
    flex: 1 1 100%;
  }
}
/* ==========================================================
   LINEUPS SECTION
   ========================================================== */

.lineups-wrapper {
  margin-top: 2rem;
}

.lineups-teams {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.team-logo {
  text-align: center;
}

.team-logo img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.vs-divider span {
  font-size: 1.5rem;
  font-weight: bold;
  color: #555;
}

.lineups-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.lineup-team {
  flex: 1 1 400px;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.player-card {
  background: #fff;
  border: 1px solid var(--scs-border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.player-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.player-number {
  font-weight: 700;
  color: var(--scs-primary);
  margin-bottom: 0.2rem;
}

.player-name a {
  color: #111;
  font-weight: 600;
  text-decoration: none;
}

.player-name a:hover {
  color: var(--scs-accent);
  text-decoration: underline;
}

.player-stats {
  font-size: 0.9rem;
  color: #555;
}

.no-players {
  text-align: center;
  color: #999;
  font-style: italic;
  margin-top: 0.5rem;
}

/* ==========================================================
   LINEUPS (Laguppställningar)
   ========================================================== */

.lineups-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.team-card {
  flex: 1 1 400px;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  border: 1px solid var(--scs-border);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.team-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.team-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--scs-primary);
  margin-bottom: 1rem;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  justify-content: center;
}

.player-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 0.6rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  text-align: center;
  transition: all 0.2s ease;
}

.player-card:hover {
  background: #fff3f3;
  transform: translateY(-3px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.player-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--scs-primary);
}

.player-name a {
  text-decoration: none;
  font-weight: 600;
  color: #333;
}

.player-name a:hover {
  color: var(--scs-accent);
  text-decoration: underline;
}

.player-stats {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.2rem;
}

/* === Responsivitet === */
@media (max-width: 768px) {
  .lineups-container {
    flex-direction: column;
    gap: 1.5rem;
  }

  .player-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .team-card {
    padding: 1rem;
  }

  .team-logo {
    width: 80px;
    height: 80px;
  }
}
