/* Shared mobile-friendly prediction results (Mains + Advance) */

.predictor-results-hint {
  display: none;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
  padding: 0.35rem 0.5rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
}

.predictor-results-wrap {
  max-height: min(72vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background: #fff;
}

.predictor-results-wrap.has-hint {
  border-radius: 0 0 0.375rem 0.375rem;
  border-top: none;
}

.predictor-results-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.25;
}

.predictor-results-table thead .table-header-row th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f3f4f6;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #e5e7eb;
  padding: 0.375rem 0.5rem;
  vertical-align: bottom;
}

.predictor-results-table thead .table-filter-row th {
  position: sticky;
  top: 2rem;
  z-index: 4;
  background: #f9fafb;
  padding: 0.2rem;
  border: 1px solid #e5e7eb;
  vertical-align: middle;
}

.predictor-results-table thead .table-filter-input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.2rem 0.3rem;
  font-size: 0.6875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.2rem;
}

.predictor-results-table tbody td {
  border: 1px solid #e5e7eb;
  padding: 0.35rem 0.45rem;
  vertical-align: top;
  word-break: break-word;
}

.predictor-results-table .col-sr {
  width: 2.25rem;
  min-width: 2.25rem;
  text-align: center;
  white-space: nowrap;
}

.predictor-results-table .col-round {
  width: 2.5rem;
  min-width: 2.5rem;
  text-align: center;
  white-space: nowrap;
}

.predictor-results-table .col-num {
  width: 3.25rem;
  min-width: 3.25rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.predictor-results-table .col-score {
  width: 2.75rem;
  min-width: 2.75rem;
  text-align: center;
  white-space: nowrap;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.predictor-results-table .col-institute {
  min-width: 8.5rem;
  max-width: 11rem;
}

.predictor-results-table .col-program {
  min-width: 7.5rem;
  max-width: 10rem;
}

.predictor-results-table .th-short {
  display: none;
}

@media (max-width: 639px) {
  .predictor-results-hint {
    display: block;
  }

  .predictor-results-table {
    font-size: 0.625rem;
    line-height: 1.15;
  }

  .predictor-results-table thead .table-header-row th {
    padding: 0.2rem 0.3rem;
    top: 0;
  }

  .predictor-results-table thead .table-filter-row th {
    top: 1.35rem;
    padding: 0.15rem;
  }

  .predictor-results-table thead .table-filter-input {
    font-size: 0.625rem;
    padding: 0.15rem 0.2rem;
  }

  .predictor-results-table tbody td {
    padding: 0.2rem 0.3rem;
  }

  .predictor-results-table .th-long {
    display: none;
  }

  .predictor-results-table .th-short {
    display: inline;
  }

  .predictor-results-table .col-sr {
    width: 1.5rem;
    min-width: 1.5rem;
  }

  .predictor-results-table .col-round {
    width: 1.65rem;
    min-width: 1.65rem;
  }

  .predictor-results-table .col-num {
    width: 2.35rem;
    min-width: 2.35rem;
    font-size: 0.6rem;
  }

  .predictor-results-table .col-score {
    width: 2rem;
    min-width: 2rem;
  }

  .predictor-results-table .col-institute {
    min-width: 5.25rem;
    max-width: 6.5rem;
  }

  .predictor-results-table .col-program {
    min-width: 4.75rem;
    max-width: 6rem;
  }

  /* Sticky # and Institute while scrolling horizontally */
  .predictor-results-table thead .table-header-row th:nth-child(1),
  .predictor-results-table thead .table-filter-row th:nth-child(1),
  .predictor-results-table tbody td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
  }

  .predictor-results-table thead .table-header-row th:nth-child(1) {
    z-index: 5;
    background: #f3f4f6;
  }

  .predictor-results-table thead .table-filter-row th:nth-child(1) {
    z-index: 5;
    background: #f9fafb;
  }

  .predictor-results-table thead .table-header-row th:nth-child(2),
  .predictor-results-table thead .table-filter-row th:nth-child(2),
  .predictor-results-table tbody td:nth-child(2) {
    position: sticky;
    left: 1.5rem;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
  }

  .predictor-results-table thead .table-header-row th:nth-child(2) {
    z-index: 5;
    background: #f3f4f6;
  }

  .predictor-results-table thead .table-filter-row th:nth-child(2) {
    z-index: 5;
    background: #f9fafb;
  }

  .predictor-results-table tbody tr.hover-scroll-row:hover td:nth-child(1),
  .predictor-results-table tbody tr.hover-scroll-row:hover td:nth-child(2) {
    background: #e0f2fe;
  }
}

@media (min-width: 640px) {
  .predictor-results-table {
    width: 100%;
    table-layout: fixed;
  }

  .predictor-results-table .col-institute {
    width: 28%;
  }

  .predictor-results-table .col-program {
    width: 26%;
  }
}

/* Button labels: long on desktop, short on mobile */
.btn-label-short {
  display: none;
}

.btn-label-long {
  display: inline;
}

/* Compact predictor page controls on mobile (Mains + Advance) */
@media (max-width: 639px) {
  .predictor-page-title {
    font-size: 1.125rem !important;
    margin-bottom: 0.5rem !important;
  }

  .predictor-top-nav {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    gap: 0.25rem !important;
  }

  .predictor-top-nav a {
    padding: 0.2rem 0.35rem !important;
    font-size: 0.625rem !important;
    border-radius: 0.25rem;
  }

  .predictor-actions {
    gap: 0.35rem !important;
    margin-top: 0.125rem !important;
  }

  .predictor-btn,
  .predictor-btn-row .predictor-btn,
  .predictor-btn-row button[type="submit"] {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 0.45rem 0.5rem !important;
    line-height: 1.25 !important;
    border-radius: 0.375rem !important;
    min-height: 2rem;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
  }

  .predictor-btn .btn-label-short,
  .predictor-btn .btn-label-long {
    color: inherit;
  }

  .predictor-btn-row {
    gap: 0.35rem !important;
    max-width: 100% !important;
  }

  .predictor-btn-pdf {
    font-size: 0.6875rem !important;
    padding: 0.4rem 0.5rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .predictor-btn .btn-label-long,
  .predictor-btn-pdf .btn-label-long {
    display: none !important;
  }

  .predictor-btn .btn-label-short,
  .predictor-btn-pdf .btn-label-short {
    display: inline !important;
  }

  .predictor-filter-panel {
    padding: 0.4rem 0.5rem !important;
  }

  .predictor-rank-type {
    padding: 0.25rem 0.375rem !important;
    gap: 0.25rem 0.75rem !important;
  }

  .predictor-rank-type label {
    font-size: 0.75rem !important;
  }

  .predictor-advance-form input[type="number"],
  .predictor-advance-form select {
    font-size: 0.875rem !important;
    padding: 0.35rem 0.5rem !important;
    min-height: 2rem;
  }
}

