/* Import Google Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Roboto+Condensed:wght@400;500;700&display=swap');

/* Global styling */
html {
    line-height: revert;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 24px;
    padding-top: 48px;
    padding-bottom: 48px;
    display: flex;
    gap: 48px;
    align-items: center;
    min-height: 100dvh;
    box-sizing: border-box;
    flex-direction: column;
}

body.nexus {
    background-color: #f5f5f5;
}

.red {
    color: #A31916;
}

.info {
    padding: 12px 16px;
    background-color: #fff3cd;
    border-radius: 8px;
    color: #856404;
    display: none;
    line-height: 1.5;
}

[container] {
    box-sizing: border-box;
    max-width: 800px;
}

[container]:has(> table) {
    overflow: auto;
}

textarea[readonly] {
    opacity: 25%;
}

.greyContainer {
    padding: 12px 16px 16px 16px;
    background-color: #eee;
    border: 1px solid #ddd;
}

.btn-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
    grid-column-gap: 8px;
    grid-row-gap: 8px;
}

.btn-wrapper b {
    color: #A31916;
}

[container],
form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

[dropdown] {
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-direction: row;
    background-color: #eee;
    padding: 12px 16px !important;
    border: 1px solid #ddd;

}

#tutorialContainer {
    width: 100%;
    display: flex;
    gap: 12px;
    flex-direction: column;

}

h2 {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
    padding: 0;
    color: #333;
    font-size: revert;
    font-weight: revert;
}



h1>span,
h2>span {
    color: #A31916;
}

.title h1 {
    font-size: 28px;
}

.title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.biggest {
    background-color: #fff389;
    font-weight: bold;
}

.stretch {
    width: 100%;
    align-items: stretch !important;
}

.input-wrapper {
    display: flex;
    gap: 16px;
    width: 100%;
}

#selectedExerciseTitle {
    font-size: 16px;
}

a {
    color: #A31916;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.small-button {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 14px;
}

.green {
    background-color: #4CAF50;
    color: white;
}

.grey {
    background-color: #808080;
}

.sortable {
    cursor: pointer;
}

.sortable:hover {
    background-color: #ddd;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(6px);
    z-index: 9998;
}

.overlay svg {
    padding: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
}

.exercise-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.exercise-link {
    border: 1px solid #ddd;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    display: none;
}

/* Hide rows after the 18th */
#performancesTableContainer tbody tr.performance-row:nth-child(n+19) {
    display: none;
}

/* Hidden checkbox */
#show-more-toggle {
    display: none;
}

/* Show all rows when checked */
#show-more-toggle:checked~table tbody tr.performance-row {
    display: table-row !important;
}

/* Style the toggle */
.show-more-label {
    color: #A31916;
    cursor: pointer;
    display: block;
    margin-top: 12px;
    text-align: center;
}

.show-more-label:hover {
    filter: saturate(150%) !important;
}

.performance-row.selected-row td:not([rowspan]) {
    background-color: #ffcccc !important;
}

.performance-row {
    cursor: pointer;
}

/* Toggle text */
#show-more-toggle:not(:checked)~.show-more-label .show-less {
    display: none;
}

#show-more-toggle:checked~.show-more-label .show-more {
    display: none;
}

/* Auto-hide if more than 18 rows */
#performancesTableContainer:has(tbody tr.performance-row:nth-child(19)) .show-more-label {
    display: block;
}

#performancesTableContainer .show-more-label {
    display: none;
}

/* Styled table */

table {
    font-family: 'Roboto Condensed', monospace;
    font-size: 15px;
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

th,
td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #ddd;
    white-space: nowrap;
}

td.wrap {
    white-space: normal;
    max-width: 60ch;
    min-width: 30ch;
}


table[list] th,
table[list] td {
    max-width: 100%;
}

th {
    background-color: #ececec;
}

[twocol] {
    display: flex;
    width: 100%;
    gap: 16px;
    align-items: stretch;
}

[start] {
    align-items: flex-start;
}

[twocol] table {
    flex: 1;
}

table[programma] td:first-child {
    text-align: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* Safari fix */
@supports (-webkit-touch-callout: none) {
    table[programma] td:first-child {
        writing-mode: vertical-lr;
        transform: none;
    }
}

#programContainer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Input and button styling */

input,
select,
.select2-search__field,
textarea {
    background-color: white;
    width: 100%;
    padding: 12px 16px !important;
    margin: 0;
    border: 1px solid #ccc !important;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #A31916;
}

button {
    background-color: #A31916;
    color: white;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

button:hover {
    filter: saturate(150%) !important;
}

/* Notes asterisk styling */

.note-indicator {
    color: red;
    font-weight: bold;
    margin-left: 2px;
}

.checkbox-wrapper {
    padding: 8px;
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.checkbox-wrapper label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Custom styling for Select2 */

.select2-selection {
    border-radius: 0 !important;
    background-image: linear-gradient(to bottom, #fff 50%, #fff 100%) !important;
    border: 1px solid #ccc !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-selection__arrow {
    display: none !important;
}

.select2-dropdown {
    border: 2px solid #333 !important;
    border-radius: 0 !important;
}

.select2-results__option--highlighted {
    background-color: #999999 !important;
}

.select2-search__field {
    height: 36px;
}

.select2-search {
    padding: 8px !important;
}

.select2-results__option {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.select2-selection__rendered {
    padding-left: 12px !important;
}

.select2-selection__clear {
    display: none;
}