/* =====================================================
   VSMAP FRONTEND STYLES
   Scope: Public shortcode output only
   ===================================================== */
/* =====================================================
   0. ROOT VARIABLES
   ===================================================== */
:root {
  --vs-font-base: 'Inter', 'Segoe UI', Arial, sans-serif;
  --vs-color-text: #1a1a1a;
  --vs-color-muted: #6b7280;
  --vs-color-border: #ddd;
  --vs-color-border-light: #eee;
  --vs-color-bg: #fff;
  --vs-color-bg-soft: #f9fafb;
  --vs-color-head-bg: #f3f4f6;
  --vs-color-primary: #2563eb;
  --vs-color-primary-dark: #1e40af;
  --vs-color-accent: #ea861d;
  --vs-radius-sm: 3px;
  --vs-radius-md: 6px;
  --vs-radius-lg: 12px;
}

/* =====================================================
   1. GLOBAL BASE (PLUGIN SCOPE)
   ===================================================== */
.vstable-front,
.vstable-front * {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.vstable-front abbr,
.vstable-front abbr[title] {
  text-decoration: none;
  border: 0;
}
/* -----------------------------------------------------
   Neutralise theme link styles inside VSMAP only
   ----------------------------------------------------- */
.vstable-front .vsmap-team-link,
.vstable-front .vsmap-team-link:link,
.vstable-front .vsmap-team-link:visited,
.vstable-front .vsmap-team-link:hover,
.vstable-front .vsmap-team-link:active {
  color: inherit !important;
  text-decoration: none !important;
}

/* Ensure inner elements never inherit theme link colour */
.vstable-front .vsmap-team-link * {
  color: inherit !important;
}
/* Keep meta info subdued even when row is clickable */
.vstable-front a .vsmp-meta-item {
  color: var(--vs-color-muted) !important;
}
/* =====================================================
   2. MATCH TABLE (DESKTOP)
   ===================================================== */
.vstable-front {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--vs-font-base);
  font-size: 15px;
  line-height: 1.6;
  background: var(--vs-color-bg);
  border-radius: var(--vs-radius-lg);
  overflow: hidden;
  margin-bottom: 30px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

.vstable-front th,
.vstable-front td {
  padding: 14px 12px;
  vertical-align: middle;
}

.vstable-front th {
  font-size: 13px;
  font-weight: 600;
  background: var(--vs-color-head-bg);
  color: #2a2a2a;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 2px solid var(--vs-color-border);
  white-space: nowrap;
  text-align: center;
}

.vstable-front thead th:nth-child(1),
.vstable-front thead th:nth-child(2) {
  text-align: center;
}

.vstable-front td {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  background: var(--vs-color-bg);
  border-bottom: 1px solid var(--vs-color-border-light);
}

/* =====================================================
   3. LINKS (NEUTRAL BASE)
   ===================================================== */
.vstable-front a,
.vsmap-team-link {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.vstable-front a *:not(.vsmap-live-badge):not(.vsmap-today-label) {
  color: inherit;
}

/* =====================================================
   4. TIME, LIVE BADGE & COUNTDOWN
   ===================================================== */
.vstable-front td.vsmap-time-cell {
  text-align: center;
}

.vsmap-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1.4;
}

.vsmap-live-badge {
  display: inline-block;
  padding: 2px 6px;
  font: 700 11px/1 Arial, sans-serif;
  background: linear-gradient(135deg,#ff7a18,#ff3d00);
  color: #fff;
  border-radius: var(--vs-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: vsmap-today-pulse 2.2s ease-out infinite;
}

.vsmap-countdown {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--vs-color-muted);
}

/* =====================================================
   5. HEADING
   ===================================================== */
.vsmap-heading {
  margin: 30px 0 6px;
  padding: 18px 20px;
  text-align: center;
  font: 700 20px/1.2 var(--vs-font-base);
  color: #222;
  background: var(--vs-color-bg-soft);
  border-radius: var(--vs-radius-lg);
  box-shadow: 0 3px 10px rgba(0,0,0,.05);
}

/* =====================================================
   6. FILTER UI
   ===================================================== */
.vsmap-dynamic-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.vsmap-filter-select {
  min-width: 130px;
  padding: 6px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: var(--vs-radius-md);
  background: #fff;
}

.vsmap-filter-select:focus {
  outline: none;
  border-color: var(--vs-color-primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,.3);
}

.vsmap-filter-button {
  padding: 6px 10px;
  font-size: 13px;
  color: #fff;
  background: var(--vs-color-primary);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.vsmap-filter-button:hover {
  background: var(--vs-color-primary-dark);
}

/* =====================================================
   7. TEAMS & SCORE (DESKTOP — SINGLE SOURCE)
   ===================================================== */
.vsmp-teams-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  position: relative;
}

.vsmp-team {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
}

.vsmp-left { justify-content: flex-end; text-align: right; }
.vsmp-right { justify-content: flex-start; text-align: left; }

.vsmp-logo {
  max-width: 35px;
  max-height: 25px;
  object-fit: contain;
  border-radius: var(--vs-radius-sm);
  border: 1px solid var(--vs-color-border);
  flex-shrink: 0;
}

.vsmp-name {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score */
.vsmp-score-block {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  min-width: 70px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.vsmp-score-main {
  font-size: 15px;
  font-weight: 700;
}

.vsmp-score-extra {
  font-size: 12px;
  font-weight: 600;
  color: var(--vs-color-muted);
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
}
.vsmap-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  fill: currentColor;
}

.vsmap-icon-stadium {
  color: #555;
}

.vsmap-icon-whistle {
  color: #777;
}

/* =====================================================
   8. TEAMS HEADER (MATCH ROW ALIGNMENT)
   ===================================================== */
.vstable-front th.vsmap-teams-head {
  position: relative;
  text-align: center;
}

.vstable-front .vsmap-th-team {
  display: inline-block;
  max-width: 45%;
  font-size: 13px;
  font-weight: 600;
}

.vstable-front .vsmap-th-left {
  float: left;
  text-align: right;
}

.vstable-front .vsmap-th-right {
  float: right;
  text-align: left;
}

.vstable-front .vsmap-th-score {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
}

/* =====================================================
   9. DATE, DAY & TODAY
   ===================================================== */
.vsmap-date-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vsmap-date-stack {
  font-weight: 700;
  line-height: 1.4;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  align-items: center;   /* ⬅ critical */
  text-align: center;    /* ⬅ critical */
}

.vsmap-day-line {
  font-size: 14px;
  color: var(--vs-color-primary);
}

.vsmap-today-label {
  margin-top: 3px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  border-radius: var(--vs-radius-sm);
  text-transform: uppercase;
  animation: vsmap-today-pulse 2.2s ease-out infinite;
  background: linear-gradient(135deg,#ff7a18,#ff3d00);

}

/* =====================================================
   10. META INFO
   ===================================================== */
.vsmp-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.vsmp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--vs-color-muted);
  white-space: nowrap;
}

.vsmp-meta-item.venue-item { justify-content: flex-start; }
.vsmp-meta-item.matchno-item { justify-content: center; }
.vsmp-meta-item.stage-item { justify-content: flex-end; }

/* =====================================================
   11. ROW STATES & WRAPPER
   ===================================================== */
.vsmap-row-group td {
  transition: background-color .2s ease;
}

.vsmap-row-group.vsmap-hover td {
  background: #e0f0ff;
}

.vsmap-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =====================================================
   12. ERRORS
   ===================================================== */
.vsmap-error {
  color: #dc2626;
  font-weight: 600;
}
@keyframes vsmap-today-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(255, 61, 0, 0.6),
      0 4px 10px rgba(0, 0, 0, 0.25);
  }
  70% {
    box-shadow:
      0 0 0 10px rgba(255, 61, 0, 0),
      0 4px 10px rgba(0, 0, 0, 0.25);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(255, 61, 0, 0),
      0 4px 10px rgba(0, 0, 0, 0.25);
  }
}
/* =====================================================
   MOBILE VIEW — FINAL, CONSOLIDATED (AUTHORITATIVE)
   ===================================================== */
@media (max-width: 768px) {

  /* ---------------------------------------------
     TABLE → CARD CONVERSION
     --------------------------------------------- */
  .vstable-front,
  .vstable-front thead,
  .vstable-front tbody {
    display: block;
    width: 100%;
    border: 0;
  }

  .vstable-front thead { display: none; }

  .vstable-front tr {
    display: block;
    width: 100%;
    margin-bottom: 14px;
  }

  .vstable-front td {
    display: block;
    width: 100%;
    padding: 2px 0;
    border: none;
    text-align: left;
  }

  /* ---------------------------------------------
     CARD BASE
     --------------------------------------------- */
  .vstable-front tr.vsmap-row-group {
    position: relative;
    padding: 6px 16px 10px;
    background: var(--vs-color-bg);
    border: 1px solid var(--vs-color-border-light);
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background-clip: padding-box;
    overflow: visible;
  }

  /* ---------------------------------------------
     DATE HEADER / RIBBON
     --------------------------------------------- */
  .vsmap-date-cell-wrapper {
    position: relative;
    background: transparent;
    height: 55px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
  }

.vsmap-date-cell-wrapper::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 68%;
  transform: translate(-50%, -50%);
  width: calc(100% + 70px);
  max-width: 420px;
  height: 100px;
  background: url("../images/ribbon-4.png") center / cover no-repeat;
  pointer-events: none;
  z-index: 1;
}
  .vsmap-date-stack {
    position: absolute;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1;
    white-space: nowrap;
    z-index: 2;
  }

  .vsmap-date-line {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  }

  .vsmap-day-line {
    font-size: 12px;
    font-weight: 500;
    color: #f1f5f9;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  }

  /* TODAY badge — live-sized */
  .vsmap-today-label {
    margin: 38px auto 11px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg,#ff7a18,#ff3d00);
    border-radius: 999px;
    z-index: 3;
    animation: vsmap-today-pulse 2.2s ease-out infinite;
  }

  /* ---------------------------------------------
     TIME + COUNTDOWN
     --------------------------------------------- */
  .vstable-front tr.vsmap-row-group .vsmap-time-cell {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
  }

  .vsmap-countdown {
    justify-self: end;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.85;
  }

  /* ---------------------------------------------
     TEAMS & SCORE
     --------------------------------------------- */
  .vsmp-teams-wrapper { margin: 4px 0 6px; }

  .vsmp-logo {
    max-width: 28px;
    max-height: 18px;
  }

  .vsmp-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
  }

  .vsmp-score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    margin-bottom: 6px;
  }

  .vsmp-score-main {
    font-size: 17px;
    font-weight: 700;
  }

  .vsmp-score-extra {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.75;
    margin-top: 2px;
    margin-bottom: 4px;
    white-space: nowrap;
  }

  /* ---------------------------------------------
     META ROW
     --------------------------------------------- */
  .vsmp-meta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    line-height: 1.3;
  }

  .vsmp-meta-item {
    font-size: 12px;
    color: var(--vs-color-muted);
    white-space: nowrap;
  }

  .vsmp-meta-item.matchno-item {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
  }

  /* ---------------------------------------------
     SAME-DAY GROUPING
     --------------------------------------------- */
  .vstable-front tr.vsmap-row-first,
  .vstable-front tr.vsmap-row-only {
    margin-top: 20px;
  }

  .vstable-front tr.vsmap-row-middle,
  .vstable-front tr.vsmap-row-last {
    margin-top: 0;
  }
}
@media (max-width: 768px) {

  /* Let card background show through all rows */
  .vstable-front tr.vsmap-row-group > td {
    background: transparent !important;
  }

}
/* ==================================================
   Premium Standings Card (Upgraded & Cleaned)
   ================================================== */

.vsmap-standings-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-radius: 16px;
    padding: 20px 22px 18px;
    margin-top: 28px;
    border: 1px solid #e5e7eb;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.03);

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Subtle lift on hover (desktop only) */
@media (hover: hover) {
    .vsmap-standings-card:hover {
        transform: translateY(-2px);
        box-shadow:
            0 10px 22px rgba(0, 0, 0, 0.06),
            0 3px 8px rgba(0, 0, 0, 0.05);
    }
}

/* ==================================================
   Heading
   ================================================== */

.vsmap-points-heading {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.2px;
    position: relative;
    padding-bottom: 8px;
}

.vsmap-points-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

/* ==================================================
   Table Base
   ================================================== */

.vsmap-table-responsive {
    overflow-x: auto;
    margin-bottom: 6px;
}

.vsmap-points-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.vsmap-points-table th,
.vsmap-points-table td {
    vertical-align: middle;
}

/* Header */

.vsmap-points-table thead th {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    letter-spacing: 0.4px;
}

/* Body */

.vsmap-points-table tbody td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #f1f3f5;
}

.vsmap-points-table tbody tr {
    transition: background 0.2s ease;
}

.vsmap-points-table tbody tr:hover {
    background: #f8fafc;
}

/* ==================================================
   Team Column
   ================================================== */

.vsmap-team-cell {
    text-align: left;
    font-weight: 500;
}

.vsmap-team-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vsmap-team-name {
    line-height: 1.2;
}

/* ==================================================
   Flag Styling
   ================================================== */

.vsmap-flag {
    width: 20px;
    height: 13px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    border-radius: 2px;
}

/* ==================================================
   Points Emphasis
   ================================================== */

.vsmap-col-points {
    font-weight: 700;
    font-size: 14px;
}

/* ==================================================
   Row Status Indicators (Unified System)
   ================================================== */

.vsmap-group-qualified td:first-child,
.vsmap-group-possible td:first-child,
.vsmap-group-eliminated td:first-child,
.vsmap-third-qualified td:first-child,
.vsmap-third-eliminated td:first-child {
    position: relative;
    padding-left: 16px;
}

.vsmap-group-qualified td:first-child::before,
.vsmap-group-possible td:first-child::before,
.vsmap-group-eliminated td:first-child::before,
.vsmap-third-qualified td:first-child::before,
.vsmap-third-eliminated td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 3px;
    border-radius: 3px;
}

/* Colors */

.vsmap-group-qualified td:first-child::before,
.vsmap-third-qualified td:first-child::before {
    background: #16a34a;
}

.vsmap-group-possible td:first-child::before {
    background: #f59e0b;
}

.vsmap-group-eliminated td:first-child::before,
.vsmap-third-eliminated td:first-child::before {
    background: #dc2626;
}

/* ==================================================
   Divider (Third Ranking Cutline)
   ================================================== */

.vsmap-third-divider td {
    padding: 0;
    height: 6px;
    border-bottom: none;
    background: linear-gradient(
        90deg,
        #16a34a 0%,
        #22c55e 45%,
        #dc2626 55%,
        #ef4444 100%
    );
    border-radius: 4px;
}

/* ==================================================
   Legends (Group + Third)
   ================================================== */

.vsmap-group-legend,
.vsmap-third-legend {
    margin-top: 8px;
    display: flex;
    gap: 18px;
    font-size: 13px;
    font-weight: 500;
    flex-wrap: wrap;
}

.vsmap-group-legend-item,
.vsmap-third-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vsmap-legend-bar {
    width: 3px;
    height: 14px;
    border-radius: 3px;
}

.vsmap-group-qualified-bar,
.vsmap-third-qualified-bar {
    background: #16a34a;
}

.vsmap-group-possible-bar {
    background: #f59e0b;
}

.vsmap-group-eliminated-bar,
.vsmap-third-eliminated-bar {
    background: #dc2626;
}

/* ==================================================
   No Matches Message
   ================================================== */

.vsmap-no-matches {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

/* ==================================================
   Responsive
   ================================================== */

@media (max-width: 768px) {

    .vsmap-hide-mobile {
        display: none;
    }

    .vsmap-points-table {
        font-size: 12px;
    }

    .vsmap-points-table th,
    .vsmap-points-table td {
        padding: 8px 6px;
    }

    .vsmap-points-heading {
        font-size: 18px;
    }

    .vsmap-standings-card {
        padding: 16px 14px 12px;
        margin-top: 20px;
    }

    .vsmap-col-team {
        min-width: 130px;
    }
}
