/* /css/fixtures_style.css */

/* =============================== */
/* ROOT THEME / DIVISION GRADIENTS */
/* =============================== */
:root {
  --grad-premier: linear-gradient(90deg, #ff0000, #b30000);
  --grad-first:   linear-gradient(90deg, #1d4ed8, #3b82f6);
  --grad-second:  linear-gradient(90deg, #16a34a, #22c55e);
  --grad-third:   linear-gradient(90deg, #ff6f20, #e65c1b);
  --grad-default: linear-gradient(90deg, #ff6f20, #e65c1b);
}

/* =============================== */
/* BASE LAYOUT                     */
/* =============================== */
body {
  background: linear-gradient(135deg, #1a202c, #2d3748);
  color: #f7fafc;
  font-family: 'Arial', sans-serif;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 10px;
}

/* =============================== */
/* TABLE BASE                      */
/* =============================== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;      /* row gaps for match table */
  border-radius: 1rem;         /* rounding for match table (standings override later) */
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  table-layout: fixed;         /* IMPORTANT: match table wants fixed */
}

.table th, .table td {
  padding: 5px;
  text-align: center;
  transition: background-color 0.3s;
}

.table td {
  white-space: nowrap;
}

.table th {
  background-color: #4a5568;
  color: #f7fafc;
  position: relative;
}

/* Column sizing helpers */
.match-no { width: 40px; }
.home-team { width: 150px; }
.away-team { width: 150px; }
.standings-team { width: 130px; }

.standingstable td:nth-child(2) { min-width: 100px; }

/* Hover */
.match-row:hover { background-color: #4a5568; }

/* =============================== */
/* DROPDOWN / INPUTS               */
/* =============================== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background-color: #2d3748;
  min-width: 160px;
  z-index: 1;
  border-radius: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.dropdown:hover .dropdown-menu { display: block; }

.dropdown-menu a {
  display: block;
  padding: 10px;
  color: #f7fafc;
  text-decoration: none;
  transition: background-color 0.3s;
}

.dropdown-menu a:hover { background-color: #4a5568; }

input[type="text"] {
  background-color: #4a5568;
  color: #f7fafc;
  border: none;
  padding: 10px;
  border-radius: 0.5rem;
  width: 100%;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  outline: none;
  box-shadow: 0 0 5px rgba(255, 111, 32, 0.5);
}

input[type="text"]::placeholder { color: #cbd5e0; }

/* =============================== */
/* IMAGES                          */
/* =============================== */
.team-image {
  max-width: 20%;
  height: auto;
  transition: width 0.3s ease;
}

@media (max-width: 1800px) { .team-image { max-width: 18%; } }
@media (max-width: 1200px) { .team-image { max-width: 17%; } }
@media (max-width: 900px)  { .team-image { max-width: 15%; } }
@media (max-width: 700px)  { .team-image { max-width: 1%;  } }

/* =============================== */
/* RESPONSIVE TABLE TEXT           */
/* =============================== */
@media (max-width: 1200px) {
  .match-no { width: 30px; }
  .home-team, .away-team { width: auto; }
  .table td { white-space: normal; font-size: 14px; }
}
@media (max-width: 900px) { .table td { font-size: 12px; } }
@media (max-width: 700px) { .table td { font-size: 10px; } }

/* =============================== */
/* UNDERLINES (MATCH TABLE)        */
/* =============================== */

/* kill any old per-cell underline */
.match-row td::after { content: none !important; }
.table th::after { content: none !important; }

/* full-width underline under TOP title th[colspan] */
.table th[colspan] { position: relative; }
.table th[colspan]::after {
  content:'';
  position:absolute;
  left:0; right:0;
  bottom:0;
  height:4px;
  background: var(--grad-default);
  pointer-events:none;
}

/* round header row underline */
.round-cell {
  position: relative;
  background: #4a5568;
  color: #f7fafc;
  font-weight: 700;
}
.round-cell::after {
  content:'';
  position:absolute;
  left:0; right:0;
  bottom:0;
  height:4px;
  background: var(--grad-default);
  pointer-events:none;
}

/* one continuous underline per match row */
.match-row { position: relative; }
.match-row::after {
  content:'';
  position:absolute;
  left:0; right:0;
  bottom:0;
  height:1px;
  background: var(--grad-default);
  pointer-events:none;
}

/* =============================== */
/* STANDINGS (NO BREAKING)         */
/* =============================== */

/* standings needs no row gaps + NO fixed layout (fixes colspan/phantom width) */
#standingsTable {
  border-collapse: collapse !important;
  border-spacing: 0 !important;

  /* IMPORTANT: override .table fixed layout */
  table-layout: auto !important;
  width: 100% !important;

  /* avoid the rounded table frame just for standings */
  border-radius: 0 !important;
  overflow: visible !important;
}

/* remove any leftover per-cell underline pseudo elements */
#standingsTable td::after,
#standingsTable th::after { content: none !important; }

/* keep borders you set inline; just keep paint sane */
#standingsTable td,
#standingsTable th {
  position: relative;
  background-clip: padding-box;
}

/* header full-width coloured line touching the header bottom */
#standingsTable thead { position: relative; }
#standingsTable thead::after {
  content:'';
  position:absolute;
  left:0; right:0;
  bottom:0;
  height:4px;
  background: var(--grad-default);
  pointer-events:none;
  z-index: 6;
}

/* one continuous full-width line per standings row */
#standingsTable tbody tr { position: relative; }
#standingsTable tbody tr::after {
  content:'';
  position:absolute;
  left:0; right:0;
  bottom:0;
  height:1px;
  background: var(--grad-default);
  pointer-events:none;
  z-index: 6;
}

/* draw line over cell borders */
#standingsTable tbody td,
#standingsTable thead th { position: relative; z-index: 1; }

/* standings column sizing (SAFE) */
#standingsTable th:nth-child(1),
#standingsTable td:nth-child(1) {
  width: 44px !important;
  white-space: nowrap !important;
  text-align: center !important;
}

#standingsTable th:nth-child(2),
#standingsTable td:nth-child(2) {
  width: auto !important;
  white-space: normal !important;
  text-align: left !important;
  padding-left: 18px !important;
  line-height: 1.15;
}

#standingsTable th:nth-child(n+3),
#standingsTable td:nth-child(n+3) {
  width: 52px !important;
  white-space: nowrap !important;
  text-align: center !important;
}

/* =============================== */
/* DIVISION COLOR OVERRIDES        */
/* =============================== */

/* match tables */
.division-premier th[colspan]::after,
.division-premier .round-cell::after,
.division-premier .match-row::after { background: var(--grad-premier); }

.division-first th[colspan]::after,
.division-first .round-cell::after,
.division-first .match-row::after { background: var(--grad-first); }

.division-second th[colspan]::after,
.division-second .round-cell::after,
.division-second .match-row::after { background: var(--grad-second); }

.division-third th[colspan]::after,
.division-third .round-cell::after,
.division-third .match-row::after { background: var(--grad-third); }

/* standings tables (IMPORTANT: class is on the table element) */
#standingsTable.division-premier thead::after,
#standingsTable.division-premier tbody tr::after { background: var(--grad-premier) !important; }

#standingsTable.division-first thead::after,
#standingsTable.division-first tbody tr::after { background: var(--grad-first) !important; }

#standingsTable.division-second thead::after,
#standingsTable.division-second tbody tr::after { background: var(--grad-second) !important; }

#standingsTable.division-third thead::after,
#standingsTable.division-third tbody tr::after { background: var(--grad-third) !important; }

/* =============================== */
/* MISC                            */
/* =============================== */
#matchTable, #standingsTable { width: 100% !important; margin: 0 auto; }
#matchTable td, #matchTable th { box-sizing: border-box; }

/* Only affect match rows: 1st col = Home, 3rd col = Away */
.match-row td:nth-child(1){
  text-align: right !important;
  padding-right: 22px !important;
}

.match-row td:nth-child(3){
  text-align: left !important;
  padding-left: 22px !important;
}

  /* Only affect the fixtures match table header row inside TBODY */
  #matchTable tr.labels-row td.home-team{
    text-align: right !important;
    padding-right: 22px !important;
  }
  #matchTable tr.labels-row td.away-team{
    text-align: left !important;
    padding-left: 22px !important;
  }

  /* Keep Score + Match centered */
  #matchTable tr.labels-row td:nth-child(2),
  #matchTable tr.labels-row td:nth-child(4){
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }






