/* ============================================================
   STANDINGS.CSS — Live League Tables (Men's SLB, EuroCup, Women's SLB)
   ============================================================ */

/* ── Top Summary Cards (Lions Position Snapshot) ──────────── */
.standings-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.summary-pos-card {
  background: linear-gradient(145deg, rgba(22, 22, 22, 0.95), rgba(12, 12, 12, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.summary-pos-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--red);
}

.summary-pos-card:hover,
.summary-pos-card.active-card {
  transform: translateY(-4px);
  border-color: var(--red);
  box-shadow: 0 12px 30px rgba(204, 0, 0, 0.18);
}

.summary-pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.summary-comp-tag {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  background: rgba(204, 0, 0, 0.12);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(204, 0, 0, 0.3);
}

.summary-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: #2ecc71;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-live-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.summary-pos-main {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.summary-rank {
  font-family: var(--font-display);
  font-size: 3.2rem;
  line-height: 1;
  color: var(--white);
  letter-spacing: 0.02em;
}

.summary-rank sup {
  font-size: 1.2rem;
  color: var(--red);
  margin-left: 2px;
}

.summary-team-info h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.2rem 0;
}

.summary-team-info p {
  font-size: 0.85rem;
  color: var(--gray-light);
  margin: 0;
}

.summary-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: var(--gray-light);
}

.summary-stats-row strong {
  color: var(--white);
  font-weight: 700;
}

/* ── Controls Bar (Tabs + Refresh + Season) ───────────────── */
.standings-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.standings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.standings-tab {
  background: var(--dark-card);
  border: 1px solid var(--border);
  color: var(--gray-light);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.standings-tab:hover {
  border-color: rgba(204, 0, 0, 0.5);
  color: var(--white);
}

.standings-tab.active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(204, 0, 0, 0.35);
}

.standings-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sync-status {
  font-size: 0.8rem;
  color: var(--gray-light);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.refresh-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  border-color: var(--red);
  background: rgba(204, 0, 0, 0.12);
}

.refresh-btn.spinning .refresh-icon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Table Card Container ─────────────────────────────────── */
.table-section-block {
  margin-bottom: 3rem;
}

.table-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.35rem 1.75rem;
  background: linear-gradient(90deg, rgba(204, 0, 0, 0.16), rgba(20, 20, 20, 0.95));
  border-bottom: 1px solid var(--border);
}

.table-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.table-comp-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.table-card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  margin: 0;
}

.table-card-subtitle {
  font-size: 0.84rem;
  color: var(--gray-light);
  margin: 0.15rem 0 0 0;
}

.table-header-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.season-pill {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ── Responsive Standings Table ───────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 720px;
}

.standings-table thead th {
  background: rgba(0, 0, 0, 0.45);
  color: var(--gray-light);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.standings-table thead th:hover {
  color: var(--white);
}

.standings-table thead th.num-col,
.standings-table tbody td.num-col {
  text-align: center;
}

.standings-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.standings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

/* Cutoff line for playoff / qualification zone */
.standings-table tbody tr.playoff-cutoff {
  border-bottom: 2px dashed rgba(204, 0, 0, 0.55);
}

/* Highlighted London Lions row */
.standings-table tbody tr.lions-row {
  background: linear-gradient(90deg, rgba(204, 0, 0, 0.24), rgba(204, 0, 0, 0.08));
  border-left: 4px solid var(--red);
}

.standings-table tbody tr.lions-row:hover {
  background: linear-gradient(90deg, rgba(204, 0, 0, 0.32), rgba(204, 0, 0, 0.14));
}

.standings-table tbody td {
  padding: 0.95rem 1rem;
  font-size: 0.92rem;
  color: var(--off-white);
  vertical-align: middle;
}

/* Position Cell */
.pos-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.pos-cell.pos-top1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 800;
}

.pos-cell.pos-playoff {
  border: 1px solid rgba(46, 204, 113, 0.45);
  color: #2ecc71;
}

.lions-row .pos-cell {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* Team Cell */
.team-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.team-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.team-name-text {
  color: var(--white);
  font-weight: 600;
}

.lions-row .team-name-text {
  font-weight: 800;
  color: #fff;
}

.team-badge-pill {
  font-size: 0.68rem;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(204, 0, 0, 0.25);
  color: #ff6b6b;
  border: 1px solid rgba(204, 0, 0, 0.4);
}

.team-badge-pill.gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Form Badges */
.form-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.form-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
}

.form-pill.win {
  background: rgba(46, 204, 113, 0.18);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

.form-pill.loss {
  background: rgba(231, 76, 60, 0.18);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.35);
}

/* Points Diff */
.diff-pos {
  color: #2ecc71;
  font-weight: 600;
}

.diff-neg {
  color: #e74c3c;
  font-weight: 600;
}

/* ── Table Footer (Legend + Official Link) ────────────────── */
.table-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--gray-light);
}

.table-legend {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-dot.gold {
  background: #f59e0b;
}

.legend-dot.green {
  background: rgba(46, 204, 113, 0.7);
}

.legend-dot.red {
  background: var(--red);
}

/* ── Responsive Adjustments ───────────────────────────────── */
@media (max-width: 992px) {
  .standings-summary-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .summary-pos-card {
    padding: 1.15rem 1.25rem;
  }
  .summary-rank {
    font-size: 2.5rem;
  }
  .summary-stats-row {
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
  }
  .standings-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .standings-actions {
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
  }
  .standings-table {
    min-width: 580px;
  }
  .standings-table thead th,
  .standings-table tbody td {
    padding: 0.7rem 0.55rem;
    font-size: 0.84rem;
  }
  .team-badge-pill {
    display: none;
  }
  .table-card-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .table-card-header {
    padding: 1rem 1.1rem;
  }
  .table-card-title {
    font-size: 1.15rem;
  }
  .table-card-subtitle {
    font-size: 0.78rem;
  }
  .table-card-footer {
    padding: 0.9rem 1.1rem;
  }
  .standings-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .standings-tab {
    text-align: center;
    padding: 0.65rem 0.5rem;
    font-size: 0.78rem;
  }
}
