h1,h2,h3,h4,h5,h6 {
    text-align: left;
}
h1 {
    font-size: 2em;
    margin-top: .5rem;
}
.frozen { font-style: italic; }

.teamstatus { text-align: center; }
.teamstatus img { vertical-align: middle; }

.highlight { background-color: yellow !important; }

.highlight.roweven, .highlight.even { background-color: yellow !important; }
.highlight.rowodd, .highlight.odd { background-color: #ffffaa !important; }

.size {
    text-align: right;
    font-family: monospace;
}

.md5 { font-family: monospace; }

.testcases td {
    vertical-align: middle;
    padding: 3px 5px;
}
.testcases_prev { font-size: xx-small; }
tr.summary td { border-top: 1px solid black; }

.testrank {
    text-align: center;
}

.testsample {
    text-align: center;
    max-width: 200px;
}

.testdesc {
    max-width: 400px;
}

/* set cell padding to 0 and <a> tag to 3 to make all of cell
   clickable in the jury scoreboard and for all team cells */
.scoreboard_jury td, .scoreboard_jury th { padding: 0; }

/* show pending submissions using a blue corner */
.score_pending.score_correct             { background: linear-gradient(45deg, #60e760 85%, #6666ff 85%); }
.score_pending.score_correct.score_first { background: linear-gradient(45deg, #1daa1d 85%, #6666ff 85%); }
.score_pending.score_incorrect           { background: linear-gradient(45deg, #e87272 85%, #6666ff 85%); }

#submission_layout { width: 100%; }

#djlogo {
    position: absolute; right: 1ex;
    width: 93px; height: 196px;
}

.dj-dashboard {
    max-width: 1000px;
    margin: 0 auto;
}

.dj-tile {
    transition: background-color 0.15s, box-shadow 0.15s;
    color: inherit;
    border: 1px solid #dee2e6;
    background-color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
}
.dj-tile:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    color: inherit;
}
.dj-tile i.fa-2x {
    width: 100%;
}

a.collapse { color: black; text-decoration: none; }

.judgetime { font-size: smaller; font-style: italic; }

.config_input { width: 9em; }

/* configchecker */
.O { background-color: #ccfbcc; }
.W { background-color: #f0e68c; }
.E { background-color: #fa9972; }

/* diff colors for source contents and filenames */
.diff-add        { color: green; }
.diff-del        { color: red; }
.diff-changed    { color: darkorange; }
.diff-endline    { font-weight: bold; }
.file-diff-table { width: auto; }
.file-diff-table tr th { padding-right: 10px; }

.col1 { float: left;  width: 30%; }
.col2 { float: right; width: 70%; }
.nomorecol { clear: left; }

.thleft { text-align: left; }
.tdcenter { text-align: center; }
.tdcenter img {  vertical-align: text-top; }
.tdright { text-align: right; }
.teamstat { text-align: right; }

div.submissions-filter > p {
    position: relative;
}

div.submissions-filter > p > span {
    position: absolute;
    top: 3px;
}

div.submissions-filter ul.token-input-list {
    display: inline-block;
    position: relative;
    left: 100px;
}

.tc_box_small {
    text-align: center;
    font-size: 65%;
    width: 1.0em;
    display: inline-block;
    padding: 1px;
    margin: 1px;
    color: black;
}
.tc_list_small {
    max-width:500px;
}

.data-table  td.testcase-results {
    white-space: normal;
    min-width: 400px;
    width: 100%;
}

.has_tooltip {
    text-decoration: dotted underline;
}

div.submission-summary > span {
    margin-right: 10px;
}

/* fixes for bootstrap-toggle and bootstrap4 */
.toggle-off {
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
.toggle.off {
    border-color: rgba(0, 0, 0, .25);
}
.toggle-handle {
    background-color: white;
    border: thin rgba(0, 0, 0, .25) solid;
}
.listtoggles {
    width: 6em;
}
.btn-xs,
.btn-group-xs > .btn {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.table td.thick-border {
    border-top: 1px solid #bbbec1;
}

.importexport h2 {
    margin-top: 1rem;
}
.importexport div.tile {
    background-color: aliceblue;
    padding: 1rem;
    margin: .5rem;
    height: 95%;
}
.importexport div.tile h3 {
    font-size: 22px;
}

/* Contest form styles */
.contest-form-section-header td {
    background-color: #e9ecef !important;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    padding: 0.5rem 0.3rem !important;
    border-bottom: 2px solid #dee2e6;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.contest-form-section-header td i {
    color: #6c757d;
    width: 1.25em;
    text-align: center;
}
.contest-fields-table th {
    vertical-align: top;
    padding-top: 0.6rem;
    white-space: nowrap;
    width: 1%;
}
.contest-fields-table td {
    padding-right: 0 !important;
}
.contest-fields-table td .form-control,
.contest-fields-table td .form-select {
    width: 100%;
}
.contest-fields-table td .input-group .form-control {
    width: auto;
}
.contest-fields-table td .form-text {
    font-size: 0.8rem;
    margin-top: 0.15rem;
}
/* Keep Bootstrap's .form-check padding for native checkboxes. Bootstrap pairs
 * that padding with a negative margin on .form-check-input; removing only the
 * padding moves non-toggle checkboxes out of their table cell. bootstrap-toggle
 * wraps toggle checkboxes in a visible .toggle element, so align only that
 * generated control with the table-cell edge.
 */
.contest-fields-table td .form-check > .toggle[data-toggle="toggle"] { margin-left: -1.5em; }
.contest-form .page-header-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.contest-form .page-header-bar h1 {
    margin: 0;
    font-size: 1.5rem;
}

.clr-field {
    display: block !important;
}

.clr-picker .clr-alpha {
    display: none;
}

.inline-verify-form p {
    margin-bottom: 0;
}

.table-3-striped tbody tr:nth-of-type(6n+1),
.table-3-striped tbody tr:nth-of-type(6n+2),
.table-3-striped tbody tr:nth-of-type(6n+3) {
    background-color: rgba(0,0,0,.05);
}

.button-row {
    margin-bottom: 1rem;
}

table.submissions-table {
    width: auto;
}
.submissions-table tbody td {
    vertical-align: middle;
}

/* Sticky header for submissions table */
.submissions-table thead.thead-light {
    position: sticky;
    top: var(--navbar-height);
    z-index: 10;
}
.submissions-table thead.thead-light th {
    background-color: #e9ecef;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

.devmode {
    background-color: #295d8a !important;
}

.devmode-icon {
    color: white;
}

.table-full-clickable-cell {
    border-collapse: separate; /* Because we need to set display:table for <a> we need to override this */
    border-spacing: 0 0;
}

.table-full-clickable-cell tbody td:not(.testcase-results) {
    padding: 0;
}

.table-full-clickable-cell tbody tr td:not(.testcase-results) a:not(.btn-sm),
.table-full-clickable-cell tbody tr td:not(.testcase-results) a:hover:not(.btn-sm) {
    display: table;
}

.table-full-clickable-cell tbody td:not(.testcase-results) a {
    width: 100%;
    height: 100%;
    padding: 1px .25rem;
    display: block; /* This is needed to make cells with .showlink fully clickable */
}

.table-full-clickable-cell tbody td:not(.testcase-results) a.btn-sm {
    padding: 0.25rem 0.5rem 0.25rem 0.5rem;
}

/* Below is to re-align the `claim` button on the submission list overview */
table.table-full-clickable-cell thead.thead-light tr th.table-button-head-right {
    padding-left: 0;
}

table.table-full-clickable-cell thead.thead-light tr th.table-button-head-left {
    padding-right: 0.5rem;
}

table.table-full-clickable-cell tr .table-button-head-right-right{
    padding-left: 0.5rem;
}

.execid {
    font-family: monospace;
}

.timebutton {
    min-width: 9em;
}

.diff-title {
    display: none;
}

/* Scoring hierarchy styles */
.scoring-group {
    border-left: 2px solid #dee2e6;
    padding-left: 0.75rem;
}
.scoring-group-indent {
    margin-left: 0.75rem;
}
.scoring-group-root {
    margin-left: 0;
}
.scoring-group-header {
    font-size: 1rem;
}
.scoring-group-root > .scoring-group-header {
    font-size: 1.1rem;
}
.scoring-agg-pill {
    font-size: 0.7rem;
}
.scoring-agg-sum { background-color: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.scoring-agg-avg { background-color: #e7f3ff; color: #004085; border: 1px solid #b8daff; }
.scoring-agg-min { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.scoring-agg-max { background-color: #f3e5f5; color: #4a148c; border: 1px solid #d1c4e9; }

.scoring-accept-badge {
    background-color: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
    font-size: 0.7rem;
}

.scoring-accept-pill {
    font-size: 0.7rem;
}
.scoring-info {
    font-size: 0.85rem;
}
.scoring-equation {
    font-weight: normal;
}
.scoring-testcase-list {
    font-size: 0.8rem;
}
.scoring-testcase-icon {
    font-size: 0.7rem;
}
.scoring-testcase-name {
    font-family: monospace;
}
.scoring-testcase-result {
    text-align: left;
    background: none;
}
.scoring-testcase-score {
    font-weight: bold;
}

/* Timeline styles */
#judgehost-timeline {
    height: 400px;
    width: 100%;
}

#judgehost-timeline svg {
    font-family: sans-serif;
    font-size: 10px;
}

.timeline-axis path,
.timeline-axis line {
    fill: none;
    stroke: #000;
    shape-rendering: crispEdges;
}

.timeline-rect:hover {
    opacity: 0.8;
    cursor: pointer;
}

.timeline-tooltip {
    position: absolute;
    padding: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 4px;
    pointer-events: none;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Score changes heatmap styles */
#score-heatmap {
    width: 100%;
    min-height: 420px;
    position: relative;
}

.heatmap-tooltip {
    position: absolute;
    visibility: hidden;
    background: #212529;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
}

#score-changes-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

#score-changes-table thead th.sortable:hover {
    background-color: #e9ecef;
}

#score-changes-table thead th.sorted-asc::after {
    content: ' \25B2';
    font-size: 0.7em;
}

#score-changes-table thead th.sorted-desc::after {
    content: ' \25BC';
    font-size: 0.7em;
}

#score-changes-table .score-value {
    font-family: monospace;
}

#delta-threshold {
    width: 200px;
    display: inline-block;
    vertical-align: middle;
}

/* Grouped table expand/collapse styles */
.data-table .group-toggle-column,
.data-table .group-toggle-cell {
    width: 2rem;
    min-width: 2rem;
    max-width: 2rem;
    padding: 0;
    text-align: center;
}

/* Right-align the ID column in rejudgings table */
#rejudgings-table td:nth-child(2),
#rejudgings-table th:nth-child(2) {
    text-align: right;
}

.group-toggle {
    cursor: pointer;
    display: inline-block;
    user-select: none;
}

.group-toggle:hover {
    color: var(--bs-primary);
}

.group-chevron {
    font-size: 0.75rem;
    width: 1em;
    display: inline-block;
    text-align: center;
}

.data-table .table-row-child td,
.data-table .table-row-child a {
    color: var(--bs-secondary);
}

.data-table .table-row-child .group-toggle-cell {
    border-left: 3px solid var(--bs-primary);
}
