/* Past Meets Page Styles - extends base.css */
:root {
  --shell-width: min(1200px, 94vw);
}

body {
  padding: 40px 0 120px;
}

.shell {
  width: var(--shell-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.top-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 6px 6px;
  gap: 12px;
  min-height: 56px;
}

.top-bar--brand-right {
  grid-template-columns: 1fr auto;
}

.top-bar__slot {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar__slot--left {
  justify-content: flex-start;
}

.top-bar__slot--right {
  justify-content: flex-end;
}

.top-bar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: center;
  justify-self: center;
}

.top-bar--brand-right .top-bar__brand {
  justify-self: end;
  text-align: right;
  align-items: flex-end;
}

/* .back-link and .logo are in base.css */

.mini-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-one);
}

.hero {
  padding: 40px;
  border-radius: var(--panel-radius);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 3.3rem);
}

.hero p {
  margin: 16px 0 0;
  color: var(--subtle);
  max-width: 640px;
  line-height: 1.6;
}

/* .panel is in base.css - backdrop-filter removed for scroll performance */

.search-panel {
  padding: 24px 32px;
}

.filters h3 {
  font-size: 1rem;
  font-weight: 600;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--accent-one);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.filter-group select option {
  background: #1e293b;
  color: var(--text);
}

.results-panel {
  padding: 24px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.results-count {
  font-size: 0.9rem;
  color: var(--subtle);
}

.table-wrapper {
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
}

.meets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.meets-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtle);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.meets-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.meets-table tbody tr {
  transition: background-color 0.15s;
}

.meets-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

.meets-table .col-fed {
  width: 100px;
}

.meets-table .col-date {
  width: 120px;
  white-space: nowrap;
}

.meets-table .col-location {
  width: 180px;
}

.meets-table .col-competition {
  min-width: 250px;
}

.meets-table .col-lifters {
  width: 80px;
  text-align: center;
}

.meets-table td.col-lifters {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent-one);
}

.meets-table .fed-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-one);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.empty-state {
  text-align: center;
  padding: 48px 24px !important;
  color: var(--subtle);
  font-style: italic;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pagination-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-one);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--subtle);
  min-width: 100px;
  text-align: center;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Clickable rows */
.meets-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.meets-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.1);
}

.meets-table tbody tr:active {
  transform: scale(0.995);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: rgba(15, 23, 42, 0.99);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  width: 100%;
  max-width: 1200px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateZ(0);
  will-change: transform;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 16px;
}

.modal-title-group {
  flex: 1;
  min-width: 0;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.modal-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--subtle);
}

.lifter-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-one);
  font-size: 0.8rem;
  font-weight: 600;
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--subtle);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-loading {
  padding: 60px 28px;
  text-align: center;
  color: var(--subtle);
  font-size: 1rem;
}

.modal-table-wrapper {
  overflow: auto;
  flex: 1;
  padding: 0 4px 20px;
  -webkit-overflow-scrolling: touch;
}

/* Sort controls */
.modal-sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.sort-label {
  font-size: 0.8rem;
  color: var(--subtle);
  margin-right: 4px;
}

.sort-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--subtle);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.sort-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.sort-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-one);
  color: var(--accent-one);
}

/* Lifters table */
.lifters-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.lifters-table tbody {
  display: table-row-group;
}

.lifters-table thead {
  display: table-header-group;
}

.lifters-table tr {
  display: table-row;
}

/* content-visibility for smooth scrolling - browser skips rendering off-screen rows */
.lifters-table tbody tr.virtual-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 44px;
}

.lifters-table th,
.lifters-table td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lifters-table th {
  position: sticky;
  top: 0;
  background: #0f172a;
  font-weight: 500;
  color: var(--subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 2;
}

/* Ensure sticky headers have opaque background to hide scrolling content */
.lifters-table th.col-total,
.lifters-table th.col-glp {
  background: #0f172a;
}

.lifters-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
}

.lifters-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

.lifters-table .col-rank {
  width: 50px;
  text-align: center;
  font-weight: 600;
  color: var(--accent-one);
}

.lifters-table .col-lifter {
  min-width: 160px;
}

.lifters-table .col-lifter a {
  color: var(--accent-one);
  text-decoration: none;
  transition: color 0.15s ease;
}

.lifters-table .col-lifter a:hover {
  color: var(--text);
  text-decoration: underline;
}

.lifters-table .col-sex,
.lifters-table .col-equip {
  width: 50px;
  text-align: center;
}

.lifters-table .col-division {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lifters-table .col-class,
.lifters-table .col-weight {
  width: 70px;
  text-align: right;
}

.lifters-table .col-squat,
.lifters-table .col-bench,
.lifters-table .col-deadlift,
.lifters-table .col-total,
.lifters-table .col-glp {
  width: 70px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Lift colors - unified blue for all three lifts */
.lifters-table .col-squat,
.lifters-table .col-bench,
.lifters-table .col-deadlift {
  color: #3b82f6; /* Blue for all lifts */
  font-weight: 500;
}

.lifters-table .col-total {
  font-weight: 700;
  color: #a78bfa; /* Purple for total */
  background: rgba(167, 139, 250, 0.08);
}

.lifters-table .col-glp {
  color: #fbbf24; /* Gold/amber for IPF GL */
  font-weight: 600;
  background: rgba(251, 191, 36, 0.08);
}

/* Division group header */
.lifters-table .division-header {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0.05) 100%);
  border-left: 3px solid var(--accent-one);
}

.lifters-table .division-header td {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-one);
  letter-spacing: 0.02em;
}

.lifters-table .division-header:not(:first-child) td {
  padding-top: 20px;
}

/* DQ/DD styling */
.lifters-table tr.dq {
  opacity: 0.5;
}

.lifters-table tr.dq .col-rank {
  color: #ef4444;
}

@media (max-width: 768px) {
  .hero {
    padding: 28px 24px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .panel {
    padding: 20px 16px;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .meets-table {
    font-size: 0.8rem;
    table-layout: fixed;
    width: 100%;
    border-spacing: 0;
  }

  .meets-table th,
  .meets-table td {
    padding: 8px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .meets-table .col-fed {
    width: 85px;
  }

  .meets-table .col-date {
    width: 90px;
    white-space: nowrap;
    padding-left: 4px;
  }

  .meets-table .col-location,
  .meets-table .col-lifters {
    display: none;
  }

  .meets-table .col-competition {
    min-width: auto;
    width: auto;
    white-space: normal;
    word-break: break-word;
  }

  .table-wrapper {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 12px;
  }

  .pagination-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .modal {
    max-height: 95vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .lifters-table {
    font-size: 0.75rem;
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }

  .lifters-table th,
  .lifters-table td {
    padding: 6px 4px;
    white-space: nowrap;
  }

  .lifters-table .col-division {
    display: none;
  }

  /* Keep IPF GL visible on mobile */
  .lifters-table .col-glp {
    font-size: 0.7rem;
  }

  .lifters-table .col-name {
    white-space: nowrap;
  }

  .lifters-table .col-squat,
  .lifters-table .col-bench,
  .lifters-table .col-deadlift {
  }

  .lifters-table .col-total {
  }
}
