:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4cc9f0;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    color: var(--dark-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

#toggleTableBtn {
    margin-block: 10px;
}

.btn-over {
    position: relative;
    z-index: 2;
}

.col-zam {
    width: 40px; /* Фиксированная ширина для столбцов с чекбоксами */
    min-width: 40px;
    max-width: 40px;
}

/* Для столбцов с предметами */
#scoreTable col[data-col] {
    width: 5%; /* Фиксированная ширина для столбцов с предметами */
    min-width: 5%;
    max-width: 5%;
}

#scoreTable .col-fio {
    min-width: 350px;
}

#scoreTable .col-number {
    width: 5%;
    min-width: 5%;
}

#scoreTable .active {
    background-color: rgb(4, 170, 109) !important;
}

/*
#toggleTableBtn {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

#toggleTableBtn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}
*/

/* Стили для скрытия столбцов */
#scoreTable .hidden-col {
    visibility: collapse;
    width: 0;
    min-width: 0;
    padding: 0;
    border: none;
}

#scoreTable thead {
    background-color: rgb(245, 247, 254);
    position: sticky;
    top: 0;
}

#scoreTable thead tr:first-child th:first-child {
    border-top-left-radius: var(--border-radius);
}
#scoreTable thead tr:first-child th:last-child {
    border-top-right-radius: var(--border-radius);
}

#scoreTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--border-radius);
}
#scoreTable tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--border-radius);
}

/* Стили для заголовков замов (повернуты на 90 градусов) */
.zam-header {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%) rotate(-90deg);
    transform-origin: left center;
    white-space: nowrap;
    display: inline-block;
    font-weight: 500;
    font-size: 12px;
    height: 100px;
    width: 20px;
    text-align: left;
    margin-left: 10px;
}

#scoreTable-container {
    /*overflow-x: auto;*/
    max-width: 100%;
    margin-bottom: 40px;
    margin-top: -96px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background-color: white;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 600px;
}

#scoreTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    table-layout: fixed;
    left: 0;
    right: 0;
}

#scoreTable th {
    color: var(--dark-color);
    position: relative;
    height: 120px;
    padding: 0 15px;
    min-width: 40px;
    text-align: center;
    vertical-align: bottom;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    /*background-color: rgba(67, 97, 238, 0.05);*/
    border-bottom: 2px solid var(--primary-color);
    transition: var(--transition);
}

#scoreTable th:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

#scoreTable th.sort-asc::after {
    content: '↑';
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 14px;
    color: var(--primary-color);
}

#scoreTable th.sort-desc::after {
    content: '↓';
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 14px;
    color: var(--primary-color);
}

.fio-top {
    position: absolute;
    top: 0;
    right: 10px;
    width: 100%;
    text-align: right;
    font-size: 12px;
    font-weight: bold;
    color: var(--success-color);
}

/* Коэффициенты предметов */
.subject-coef {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--success-color);
}

/* Заголовки № и ФИО */
#scoreTable th:first-child,
#scoreTable th:nth-child(2),
#scoreTable th:last-child {
    height: 60px;
    /*    vertical-align: middle;
        color: white;
        background-color: var(--primary-color);*/
}

#scoreTable th:first-child {
    /*min-width: 60px;*/
    text-align: center;
    border-top-left-radius: var(--border-radius);
}

#scoreTable th:nth-child(2) {
    min-width: 220px;
    text-align: left;
}

#scoreTable th[data-col]:last-child span{
    transform: rotate(0deg);
    position: static;
}

/* Повернутые заголовки для предметов */
#scoreTable th[data-col] span {
    position: absolute;
    left: 20%;
    bottom: 0;
    transform: translateX(-0%) rotate(-45deg);
    transform-origin: left center;
    white-space: nowrap;
    display: inline-block;
    font-weight: 600;
    text-align: left;
    width: auto;
    font-size: 14px;
    padding-left: 0;
    color: var(--dark-color);
    width: 80px; /* Соответствует ширине столбцов с предметами */
    min-width: 80px;
}

/* Повернутые заголовки для замов */
#scoreTable th[data-zam] span {
    position: absolute;
    bottom: -5px;
    transform: translateX(-0%) rotate(-90deg);
    transform-origin: left center;
    white-space: nowrap;
    display: inline-block;
    font-weight: 600;
    text-align: left;
    width: auto;
    font-size: 13px;
    padding-left: 0;
    color: var(--dark-color);
    width: 40px; /* Соответствует ширине столбцов с чекбоксами */
    min-width: 40px;
}

#scoreTable td {
    padding: 12px 15px;
    text-align: center;

    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

#scoreTable tr:nth-child(even) {
    background-color: rgba(67, 97, 238, 0.03);
}

#scoreTable tr:hover td {
    background-color: rgba(67, 97, 238, 0.08);
}

#scoreTable td:nth-child(2) {
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
    background-color: rgba(67, 97, 238, 0.05);
}

#scoreTable .total {
    background-color: rgba(72, 149, 239, 0.1) !important;
}

#scoreTable .positive {
    font-weight: 600;
    color: var(--secondary-color);
}

#scoreTable .row-number {
    font-weight: 600;
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.hidden {
    display: none;
}

/* Стили для чекбоксов */
.check-cell {
    padding: 5px !important;
    /* width: 30px; */
    width: 5% !important; /* Фиксированная ширина */
    min-width: 40px !important;
    max-width: 40px !important;

}

.check-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0 auto;
}

/* Адаптивность */
@media (max-width: 768px) {
    #scoreTable th[data-col] span {
        font-size: 12px;
        bottom: 20px;
    }

    #scoreTable th,
    #scoreTable td {
        padding: 8px 10px;
    }
}
