/* ============================================================
   RMS — tables-cards.css
   Split out of combined.css — June 2026.
   Everything related to data tables and card-grid layouts:
   the History page table + .cards-grid/.show-card, the AIMS
   Awards table + its filter controls + result badges, and the
   legacy .awards-table / .table responsive helpers.

   Depends on the CSS variables defined in general.css
   (--color-blue, --color-maroon, --font-montserrat, etc.) —
   load general.css first on any page that includes this file.
   ============================================================ */

/* ------------------------------------------------------------
   Leftover stub from main_ori.css's old "Tables" section —
   likely superseded by the more complete 768px card-collapse
   handling in the AIMS section below. Kept for now since
   deleting it wasn't explicitly asked for; worth confirming
   it's safe to remove once this file is live.
   ------------------------------------------------------------ */
/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */
@media (max-width: 767px) {
  .aims-table {
    display: block;
    width: 100%;
  }
}
/* ------------------------------------------------------------
.aims-table,
.aims2 {
  border-radius: 5px;
  font-size: 12px;
  font-weight: normal;
  border: none;
  border-collapse: collapse;
  width: 70%;
  max-width: 70%;
  white-space: nowrap;
  background-color: #fff;
  margin: 0 auto;
}
   ------------------------------------------------------------ */



/* ------------------------------------------------------------
   Legacy .awards-table responsive helper (from rms-shared.css)
   ------------------------------------------------------------ */
@media (min-width: 480px) {
  .awards-table td:before {
    display: none;
  }

  .awards-table th,
  .awards-table td {
    display: table-cell;
    text-align: left;
    padding: 1em !important;
  }

  .awards-table th:first-child,
  .awards-table td:first-child { padding-left: 0 !important; }

  .awards-table th:last-child,
  .awards-table td:last-child  { padding-right: 0 !important; }

  .awards-table th,
  .awards-table td:before {
    color: var(--color-blue);
  }
}


/* ============================================================
   SECTION — from history.css
   (history table, .no-results empty state, .cards-grid /
   .show-card responsive card layout)

   Fixes applied during this merge:
   - Reconstructed ".history-container { background: #f8f9fa; }"
     — its selector had been deleted, leaving the declaration
     orphaned and corrupting the .history-container th rule
     that followed (browsers were silently dropping the entire
     header-row styling — gradient background, sticky position,
     padding — because of this).
   - Removed a second orphaned "opacity: 1;" fragment that was
     corrupting the @media(max-width:768px) block after it.
     The .controls / .search-box / .view-toggle / .card-view
     rules inside that block were dead code anyway (per this
     file's own changelog comment) and have been dropped; the
     still-relevant .history-container table / th / td mobile
     sizing rules were kept and properly scoped.
   - Fixed sort-desc using the wrong (up) arrow character —
     it was identical to sort-asc's. Now uses a down arrow,
     matching the correct asc/desc pair already in aims2.css.

   RESOLVED: .no-results conflict with aims2.css — standardized
   on the aims2.css version (it includes a font-family the
   history.css version lacked); the duplicate here was removed.
   ============================================================ */
/* ============================================================
   history.css — cleaned June 2026
   - Bare th/td/tr/table selectors scoped to .history-container
   - .container renamed concern removed (Bootstrap conflict)
   - Dead card-view, stats, tooltip, view-toggle blocks removed
   - Universal * reset removed (main.css handles it)
   - UTF-8 sort arrows fixed to CSS unicode escapes
   - aims-controls-wrap gap-fix moved to aims2.css
   ============================================================ */







        .history-container {
            background: #f8f9fa;
        }

        .history-container th {
            background: linear-gradient(135deg, #3498db, #2980b9);
            color: white;
            padding: 15px 12px;
            text-align: left;
            font-weight: 600;
            position: sticky;
            top: 0;
            z-index: 10;
            white-space: nowrap;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            cursor: pointer;
            user-select: none;
            transition: background 0.3s ease;
        }

        .history-container th:hover {
            background: linear-gradient(135deg, #2980b9, #1f618d);
        }

        .history-container th.sortable::after {
            content: ' \2195';
            opacity: 0.5;
            margin-left: 5px;
        }

        .history-container th.sort-asc::after {
            content: ' \2191';
            opacity: 1;
        }

        .history-container th.sort-desc::after {
            content: ' \2193';
            opacity: 1;
        }

        .history-container td {
            padding: 12px;
            border-bottom: 1px solid #e8f4f8;
            vertical-align: top;
            line-height: 1.4;
            transition: all 0.3s ease;
        }

        .history-container tr:nth-child(even) {
            background-color: #f8fbff;
        }

        .history-container tr:hover {
            background-color: #e3f2fd !important;
        transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .history-container tr.hidden {
            display: none;
        }

        .year {
            font-weight: bold;
            color: #2c3e50;
            font-size: 1.1rem;
        }

        .show-title {
            font-weight: 600;
            color: #8e44ad;
            font-style: italic;
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .show-title:hover {
            color: #9b59b6;
            text-decoration: underline;
        }

        .no-record {
            color: #95a5a6;
            font-style: italic;
            opacity: 0.7;
        }


        /* RESOLVED: .no-results now uses only the aims2.css version below
           (kept its font-family) — this file's own version removed. */

        @media (max-width: 768px) {
            .history-container table {
                font-size: 0.8rem;
            }

            .history-container th,
            .history-container td {
                padding: 8px 6px;
            }
        }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
    max-width: 1340px;
    margin: 0 auto;
}

.show-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.show-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.show-card-year {
    font-weight: 700;
    color: #777;
}

.show-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: right;
}

.show-card-role {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid #f2f2f2;
    font-size: 0.85rem;
}
.show-card-role:last-child { border-bottom: none; }

.show-card-role label {
    font-weight: 600;
    color: #888;
    flex-shrink: 0;
}

.show-card-role span { text-align: right; }
/* ============================================================
   SECTION — from aims2.css
   (AIMS Awards page: controls, table, badges, legacy
   .awards-table / .table responsive helpers)

   RESOLVED: .no-results conflict with history.css — this is
   the version kept (it has a font-family the other lacked);
   history.css's duplicate was removed in that section above.
   ============================================================ */
/* ------------------------------------------------------------
   3. AWARDS BODY WRAPPER
   ------------------------------------------------------------ */
.awards-body {
  padding: 0 2em;
  font-family: var(--font-montserrat);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-align: center;
  color: #444;
}


/* ------------------------------------------------------------
   4. FILTER CONTROLS
   ------------------------------------------------------------ */
.aims-controls-wrap {
  max-width: 1000px;
  margin: 0 auto 20px;
}

.aims-controls,
.aims-count,
.aims-scroll {
  width: 85%;
  max-width: 85%;
  margin-left: auto;
  margin-right: auto;
}

.aims-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.aims-controls input,
.aims-controls select {
  background: #1a1618;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: #F4EFE7;
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  padding: 9px 13px;
  outline: none;
  transition: border-color .2s;
}

.aims-controls input {
  flex: 1 1 200px;
  min-width: 140px;
  max-width: 340px;
}

.aims-controls input::placeholder { color: #6b6360; }
.aims-controls select              { cursor: pointer; }

.aims-controls input:focus,
.aims-controls select:focus        { border-color: #E9A23B; }

.aims-clear {
  background: transparent;
  border: 1px solid rgba(255,255,255,.22);
  color: #9C9089;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  white-space: nowrap;
}

.aims-clear:hover { border-color: #E5342A; color: #E5342A; }

.aims-count {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: #6b6360;
  margin-bottom: 10px;
}

.aims-count span { color: #E9A23B; font-weight: 600; }

@media (max-width: 768px) {
  .aims-controls input,
  .aims-controls select {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }
}

/* ------------------------------------------------------------
   5. TABLE SCROLL CONTAINER
   ------------------------------------------------------------ */
.aims-scroll {
  overflow-x: auto;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  max-height: 72vh;
}

.aims-scroll::-webkit-scrollbar       { width: 7px; height: 7px; }
.aims-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }
.aims-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }


/* ------------------------------------------------------------
   6. TABLE — DESKTOP
   ------------------------------------------------------------ */
.aims-table {
  table-layout: fixed;
  border-collapse: collapse;
  border: none;
  border-radius: 5px;
  width: 85%;
  max-width: 85%;
  margin: 0 auto;
  font-size: 14px;
  font-weight: normal;
  font-family: 'Roboto', sans-serif;
  white-space: nowrap;
  background-color: transparent;
}

/* Column widths */
.aims-table th:nth-child(1) { width: 70px;  }  /* Year     */
.aims-table th:nth-child(2) { width: 18%;   }  /* Nominee  */
.aims-table th:nth-child(3) { width: 14%;   }  /* Role     */
.aims-table th:nth-child(4) { width: 18%;   }  /* Show     */
.aims-table th:nth-child(5) { width: 24%;   }  /* Category */
.aims-table th:nth-child(6) { width: 100px; }  /* Result   */

/* Header row */
.aims-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #800000;
  color: #fff;
  padding: 13px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background .2s;
}

.aims-table thead th:hover                              { background: #9c1c22; }
.aims-table thead th.sort-asc::after                    { content: " \2191"; opacity: .9; }
.aims-table thead th.sort-desc::after                   { content: " \2193"; opacity: .9; }
.aims-table thead th:not(.sort-asc):not(.sort-desc)::after { content: " \2195"; opacity: .3; }

/* Data cells */
.aims-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  vertical-align: middle;
  color: #d8cfc4;
  text-align: center;
}

.aims-table tr:nth-child(even) td:not(.col-yr) { background: transparent; }
.aims-table tr:hover td           { background: rgba(254,78,0,.07); }

/* Column colour overrides */
.aims-table .col-yr   { color: #E9A23B; font-weight: 600; white-space: nowrap; }
.aims-table .col-nom  { color: #000;    font-weight: 500; }
.aims-table .col-role { color: #000; font-style: italic; }
.aims-table .col-show { color: #000; }
.aims-table .col-cat  { color: #000; }

/* No-results row */
.no-results {
  text-align: center;
  padding: 48px 20px;
  color: #6b6360;
  font-style: italic;
  font-family: 'Roboto', sans-serif;
}


/* ------------------------------------------------------------
   7. RESULT BADGES
   ------------------------------------------------------------ */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.badge-win {
  background: #D4AF37;
  color: #000;
  border: 1px solid #B8960C;
  box-shadow: 0 0 8px rgba(212,175,55,.6);
  animation: goldglow 2s ease-in-out infinite;
}

.badge-win::before { content: "\2605 "; font-size: 11px; }

@keyframes goldglow {
  0%, 100% { box-shadow: 0 0 6px rgba(212,175,55,.5); }
  50%       { box-shadow: 0 0 18px rgba(212,175,55,.95), 0 0 32px rgba(212,175,55,.3); }
}

.badge-2nd   { background: #C0C0C0; color: #000; border: 1px solid rgba(192,192,192,.6); }
.badge-place { background: #CD7F32; color: #000; border: 1px solid rgba(205,127,50,.6);  }
.badge-nom   { color: #888;         border: 1px solid rgba(255,255,255,.2);               }


/* ------------------------------------------------------------
   8. LEGACY .awards-table (kept for backwards compatibility)
   ------------------------------------------------------------ */
.awards-table {
  border-radius: .4em;
  overflow: hidden;
  margin: 0 auto;
  min-width: 300px;
}

.awards-table tr             { border-color: #fff; }
.awards-table th             { display: none; }
.awards-table td             { display: block; }
.awards-table td:first-child { padding-top: .2em; }
.awards-table td:last-child  { padding-bottom: .2em; }

.awards-table td::before {
  content: attr(data-th) ": ";
  font-weight: bold;
  width: 6.5em;
  display: inline-block;
}

.awards-table th,
.awards-table td { margin: .2em 1em; }

.awards-table tr:nth-child(odd) { background-color: var(--color-stripe); }

/* Legacy .table class */
.table                { width: 100%; border-collapse: collapse; }
.table td, .table th  { padding: 12px 15px; border: 1px solid #ddd; text-align: center; font-size: 16px; }
.table th             { background-color: darkblue; color: #fff; }


/* ------------------------------------------------------------
   9. RESPONSIVE — 600px (controls only)
   ------------------------------------------------------------ */
@media (max-width: 600px) {
  .aims-controls                        { padding: 12px; }
  .aims-controls input,
  .aims-controls select                 { font-size: 14px; }
}


/* ------------------------------------------------------------
   10. RESPONSIVE — 768px (card layout)
   ------------------------------------------------------------ */
@media (max-width: 768px) {

  /* awards-body: switch off centre-align so badge inherits left */
  .awards-body { text-align: left; }

  /* Controls: stack full width */
  .aims-controls-wrap,
  .aims-controls,
  .aims-count,
  .aims-scroll {
    width: 100% !important;
    max-width: 100% !important;
  }

  .aims-controls { flex-direction: column; }

  /* Scroll container: no horizontal scroll needed */
  .aims-scroll {
    border: none;
    max-height: none;
    overflow: hidden;
  }

  /* Table: collapse to block so rows become cards */
  .aims-table,
  .aims-table tbody,
  .aims-table tr,
  .aims-table td { display: block; width: 100%; }

  .aims-table thead { display: none; }

  /* Remove fixed column widths */
  .aims-table th:nth-child(n) { width: auto; }

  /* Card shell */
  .aims-table tr {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 4px 0;
  }

  /* Year: card header band */
  .aims-table td.col-yr {
    background: #800000;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 5px 8px;
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid rgba(255,255,255,.15);
  }

  .aims-table td.col-yr::before { display: none; }

  /* All cells: flex row, amber label + value */
  .aims-table td {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: 14px;
    white-space: normal;
    text-align: left !important;
    justify-content: flex-start;
  }

  .aims-table td:last-child { border-bottom: none; }

  /* Amber column label from data-label attribute */
  .aims-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #E9A23B;
    flex: 0 0 90px;
    min-width: 90px;
  }

  /* Result cell label */
  .aims-table td:last-child::before {
    content: "Result";
    flex: 0 0 90px;
    min-width: 90px;
    margin-right: 0;
  }

  /* Badge: never stretch, never float, never centre */
  .aims-table td:last-child {
    justify-content: flex-start;
    text-align: left !important;
  }

  .aims-table td:last-child .badge {
    flex: 0 0 auto;
    margin-left: 0;
    text-align: left;
  }

  /* Legacy .table responsive */
  .table thead                          { display: none; }
  .table, .table tbody,
  .table tr, .table td                  { display: block; width: 100%; }
  .table tr                             { margin-bottom: 15px; }
  .table td {
    text-align: right;
    padding-left: 50%;
    position: relative;
  }
  .table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 50%;
    padding-left: 15px;
    font-size: 15px;
    font-weight: bold;
    text-align: left;
  }
}