/* ==========================================================
   Kian Class Assessment
   Version 2.0
========================================================== */

*{
    box-sizing:border-box;
}

.kca-wrapper{

    width:100%;
    background:#fff;
    border:1px solid #ddd;
    border-radius:8px;
    padding:25px;
    margin:20px auto;

}

/* ---------- Header ---------- */

.kca-header h2{

    margin:0 0 25px;
    font-size:26px;
    color:#333;

}

.kca-form{

    display:flex;
    flex-wrap:wrap;
    gap:20px;
    align-items:flex-end;

}

.kca-field{

    display:flex;
    flex-direction:column;

}

.kca-field label{

    margin-bottom:8px;
    font-weight:bold;
    color:#555;

}

.kca-field input,
.kca-field select{

    width:220px;
    padding:10px;
    border:1px solid #ccc;
    border-radius:5px;
    font-size:14px;
    background:#fff;

}

/* ---------- Buttons ---------- */

#generate_table,
#publish_assessment{

    padding:11px 24px;
    border:none;
    border-radius:5px;
    cursor:pointer;
    font-size:15px;
    transition:.25s;

}

#generate_table{

    background:#2196F3;
    color:#fff;

}

#generate_table:hover{

    background:#1976D2;

}

#publish_assessment{

    background:#4CAF50;
    color:#fff;
    margin-top:25px;

}

#publish_assessment:hover{

    background:#388E3C;

}

/* ---------- Table ---------- */

#assessment_table{

    margin-top:30px;

}

.kca-table-wrapper{

    width:100%;
    overflow:auto;
    max-height:75vh;
    border:1px solid #ddd;
    border-radius:5px;

}

.kca-table{

    border-collapse:collapse;
    width:max-content;
    min-width:100%;
    background:#fff;

}

.kca-table th,
.kca-table td{

    border:1px solid #d9d9d9;

    width:75px;
    min-width:75px;
    max-width:75px;

    height:42px;
    padding:0;
    text-align:center;

}

/* ---------- Header Row ---------- */

.sticky-header{

    position:sticky;
    top:0;
    background:#ffeb3b;
    font-weight:bold;
    z-index:20;

}

.kca-student-header{

    cursor:text;
    outline:none;
    font-weight:normal;

}

.kca-legend-row th{

    position:sticky;
    top:0;
    background:#fff;
    z-index:22;
    font-weight:bold;
    font-size:13px;
    white-space:nowrap;
    padding:0 8px;

}

.kca-legend-row .sticky-column{

    top:0;

}

/* دومین ردیف هدر (شماره زبان‌آموزی) درست زیر ردیف راهنما فریز می‌شود */
.kca-header-row2 th{

    position:sticky;
    top:42px;
    z-index:21;
    background:#bbdefb;

}

.kca-student-header:focus{

    background:#e3f2fd;

}

/* ---------- Section Rows ---------- */

.kca-section-row th{

    background:#ffeb3b;
    color:#000;
    font-weight:bold;
    text-align:center;
    white-space:normal;
    padding:8px;

}

.kca-section-row .sticky-column{

    text-align:center;
    padding-right:0;

}

/* فاصله‌ی بیشتر بین ردیف‌های معیارهای ارزیابی */
.kca-table tbody tr:not(.kca-total-row) th,
.kca-table tbody tr:not(.kca-total-row) td{

    height:58px;

}

/* ---------- First Column ---------- */

.sticky-column{

    position:sticky;
    right:0;
    background:#fafafa;
    min-width:220px !important;
    width:220px !important;
    text-align:right;
    padding-right:12px;
    z-index:15;

}

/* ---------- Editable Cells ---------- */

.kca-cell{

    cursor:text;
    outline:none;
    user-select:text;

    white-space:nowrap;
    overflow:hidden;

}

.kca-cell:focus{

    background:#fff8c4;

}

/* ---------- Footer ---------- */

.kca-footer{

    margin-top:25px;

}

/* ---------- Responsive ---------- */

@media(max-width:768px){

    .kca-form{

        flex-direction:column;
        align-items:stretch;

    }

    .kca-field input,
    .kca-field select{

        width:100%;

    }

    #generate_table,
    #publish_assessment{

        width:100%;

    }

}

.kca-total-row{

    background:#4CAF50;
    color:#fff;
    font-weight:bold;

}

.kca-total{

    background:#4CAF50;
    color:#fff;
    font-weight:bold;

}

.kca-total-row .sticky-column{

    background:#4CAF50;
    color:#fff;

}

/* ---------- Readonly (published) table ---------- */

.kca-cell-readonly{

    cursor:default;
    background:#fff;

}

.kca-table-readonly .kca-cell:focus{

    background:#fff;

}