/* Custom CSS for StellCoilBench documentation */

/* Override ReadTheDocs theme max-width to allow wider tables */
.rst-content {
    max-width: none !important;
    width: auto !important;
}

/* Remove body max-width constraint and allow expansion */
.wy-nav-content {
    max-width: none !important;
    width: auto !important;
}

body {
    max-width: none !important;
    width: auto !important;
    overflow-x: visible !important;
}

/* Ensure the main container can expand */
.wy-body-for-nav {
    overflow-x: visible !important;
}

/* Ensure document container can expand */
.document {
    max-width: none !important;
    width: auto !important;
}

/* Make tables display fully without horizontal scrolling - expand page width */
.rst-content table.docutils,
.rst-content .list-table {
    display: block;
    width: 100%;
    overflow-x: visible;
    overflow-y: visible;
    margin: 0.1em 0;
}

.rst-content table.docutils,
.rst-content .list-table table {
    width: auto;
    min-width: 100%;
    display: table;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
    table-layout: auto;
    font-size: 0.32em;
    transform: scale(0.98);
}

/* Ensure table cells don't wrap unnecessarily but allow some flexibility */
/* Table data rows (td) - smaller font size for numbers */
.rst-content table.docutils td,
.rst-content .list-table td {
    white-space: nowrap;
    padding: 0px;
    font-size: 0.18em;
    text-align: left;
    vertical-align: middle;
    min-width: auto;
    max-width: none;
    line-height: 0.45;
    letter-spacing: -0.19em;
    font-family: "Courier New", "Consolas", "Monaco", monospace;
    font-stretch: ultra-condensed;
    word-spacing: -0.26em;
    transform: scaleX(0.88);
}

/* Table header rows (th) - keep original size */
.rst-content table.docutils th,
.rst-content .list-table th {
    white-space: nowrap;
    padding: 0px;
    font-size: 0.32em;
    text-align: left;
    vertical-align: middle;
    min-width: auto;
    max-width: none;
    line-height: 0.6;
    letter-spacing: -0.15em;
    font-family: "Courier New", "Consolas", "Monaco", monospace;
    font-stretch: ultra-condensed;
    word-spacing: -0.2em;
    transform: scaleX(0.95);
}

/* Make header cells stand out */
.rst-content table.docutils th,
.rst-content .list-table th {
    background-color: #f0f0f0;
    font-weight: bold;
    border-bottom: 0.5px solid #888;
}

/* Floating point numbers inherit the smaller font size from table cells above */
/* Headers remain larger via the th selector */

/* Better spacing for table rows */
.rst-content table.docutils tbody tr,
.rst-content .list-table tbody tr {
    border-bottom: 0.5px solid #e0e0e0;
    line-height: 0.6;
}

.rst-content table.docutils tbody tr:hover,
.rst-content .list-table tbody tr:hover {
    background-color: #f9f9f9;
}

.rst-content table.docutils tbody tr:nth-child(even),
.rst-content .list-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.rst-content table.docutils tbody tr:nth-child(even):hover,
.rst-content .list-table tbody tr:nth-child(even):hover {
    background-color: #f5f5f5;
}

/* Table headers styling - no sticky positioning needed since we're not scrolling */
.rst-content .list-table thead {
    background-color: #fff;
}

.rst-content .list-table thead th {
    background-color: #f0f0f0;
}

/* For very wide tables, reduce font size further */
@media screen and (min-width: 1400px) {
    .rst-content table.docutils td,
    .rst-content .list-table td {
        font-size: 0.16em;
        padding: 0px;
        line-height: 0.42;
        letter-spacing: -0.20em;
        word-spacing: -0.27em;
        transform: scaleX(0.86);
    }
    .rst-content table.docutils th,
    .rst-content .list-table th {
        font-size: 0.32em;
        padding: 0px;
        line-height: 0.6;
        letter-spacing: -0.15em;
        word-spacing: -0.2em;
        transform: scaleX(0.95);
    }
}

/* On smaller screens, keep table fitting viewport without horizontal scroll */
@media screen and (max-width: 1200px) {
    .rst-content table.docutils,
    .rst-content .list-table {
        display: block;
        overflow-x: visible;
        max-width: 100%;
    }

    .rst-content table.docutils table,
    .rst-content .list-table table {
        max-width: 100%;
    }
}

/* Leaderboard table wrapper: scrollable, top 10 visible initially */
.leaderboard-table-wrapper {
  max-height: 420px;
  overflow: auto;
  margin-bottom: 1em;
}
.leaderboard-table-wrapper .sortable {
  cursor: pointer;
  user-select: none;
}
.leaderboard-table-wrapper .sortable:hover {
  background: #f0f0f0;
}

/* Sortable leaderboard tables (raw HTML in surface_specific) */
table.leaderboard-sortable {
  font-size: 0.85em;
  border-collapse: collapse;
}
table.leaderboard-sortable th.sortable {
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  white-space: nowrap;
}
table.leaderboard-sortable th.sortable:hover {
  background: #f0f0f0;
}
table.leaderboard-sortable td {
  padding: 4px 8px;
  white-space: nowrap;
}

/* Style for leaderboard tables - compact, fit page, no horizontal scroll */
.rst-content section[id*="leaderboard"] table.docutils,
.rst-content section[id*="leaderboard"] .list-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.rst-content section[id*="leaderboard"] table.docutils td,
.rst-content section[id*="leaderboard"] .list-table td {
    font-size: 0.8em;
    padding: 4px 6px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: "Courier New", "Consolas", "Monaco", monospace;
}

.rst-content section[id*="leaderboard"] table.docutils th,
.rst-content section[id*="leaderboard"] .list-table th {
    font-size: 0.85em;
    padding: 4px 6px;
    line-height: 1.2;
    white-space: nowrap;
    font-family: "Courier New", "Consolas", "Monaco", monospace;
}

/* Make leaderboard table captions (titles) normal-sized and readable */
.rst-content .list-table caption,
.rst-content table.docutils caption {
    font-size: 1.8em !important;
    font-weight: bold !important;
    margin-bottom: 0.5em;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    transform: none !important;
    font-family: inherit !important;
    font-stretch: normal !important;
}

.rst-content .list-table caption .caption-text,
.rst-content table.docutils caption .caption-text {
    font-size: 1.8em !important;
    font-weight: bold !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    transform: none !important;
    font-family: inherit !important;
    font-stretch: normal !important;
}

/* Remove scroll indicator since we're not using horizontal scrolling */

/* Engineering Constraints table: compact, professional, fit-content columns */
table.constraints-table {
  table-layout: auto;
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  margin: 0.5em 0 1em 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
table.constraints-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}
table.constraints-table th {
  font-weight: 600;
  color: #495057;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}
table.constraints-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}
table.constraints-table tbody tr:hover {
  background-color: #f8f9fa;
}
table.constraints-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}
table.constraints-table tbody tr:nth-child(even):hover {
  background-color: #f1f3f5;
}
table.constraints-table .math {
  font-size: 1em;
}
