/* Outer table container */
.studentGradesTable {
    width: 90%;
    max-width: 1200px; /* Adjust to fit the screen nicely */
    margin: 20px auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Subtle shadow for modern look */
    background-color: #fff;
    padding: 20px;
    overflow-x: auto;
}

/* Table itself */
.studentGradesTable table {
    width: 100%;
    table-layout: auto;
}

th:first-child, td:first-child {
    width: min-content; /* Adjust width based on text size */
    white-space: nowrap; /* Prevent text from wrapping */
}

/* Table headers */
.studentGradesTable tbody th {
    text-align: left;
    column-width: auto;
    padding: 15px 20px;
    background-color: #5d9adbc7; /* Modern blue header background */
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    border-left: 1px solid #ddd;
    letter-spacing: 1px;
}

.studentGradesTable thead th{
    padding: 15px 20px;
    column-width: auto;
    border-left: 1px solid #ddd;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 2px solid #121479;
    background-color: #094a9180;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
}

tbody tr {
    border-bottom: 1px solid #ddd;
}

tbody tr.lastRow {
    border-top: 2px solid red;
}

tbody tr.lastRow th {
    letter-spacing: 1px;
    font-weight: 600;
    font-size: 1.5rem;
    color: red;
    text-align: left;
}


/* First column which contains the .headerGrade div */
tbody th .headerGrade {
    display: flex;
    flex-direction: column; /* Vertically stack the name, description, and interval */
}

/* Individual elements inside .headerGrade */
tbody th .headerGradeName {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

tbody th .headerGradeDescription {
    font-size: 0.9rem;
    text-transform: initial;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

tbody th .headerGradeInterval {
    font-size: 0.8rem;
    text-align: center;
    color: white;
    margin-top: 5px;
    background-color: #0a1d31; /* Slightly darker background for interval */
    padding: 5px 5px;
    text-wrap: nowrap;
    border-radius: 5px;
}

/* Body rows (including points and date) */
.studentGradesTable table td {
    padding: 15px 20px;
    font-size: 1rem;
    color: #333;
    border-left: 1px solid #ddd;
    vertical-align: middle;
}

/* Points column */
.points {
    font-weight: bold;
    font-size: 1.5rem;
    color: #007bff; /* Use the same blue as the header for consistency */
}

.togetherPoints {
    font-weight: bold;
    font-size: 1.5rem;
    color: rgb(248, 31, 31);
}

.colorized {
    color: rgb(22, 211, 22);
}

/* Date column */
.date {
    font-size: 1.5rem;
    color: rgb(22, 211, 22);
}

/* Row hover effect */
tbody tr:hover {
    background-color: #f8f9fa; /* Light background on hover */
}

@media (max-width: 996px) {
    .headerGradeInterval {
        box-sizing: border-box;
    }

}

/* Responsive design for smaller screens */
@media (max-width: 800px) {
    .studentGradesTable thead th {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .studentGradesTable tbody th {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .studentGradesTable tbody .headerGradeName {
        font-size: 0.85rem;
    }

    .studentGradesTable tbody .studentGradesTable tbody .headerGradeDescription, .headerGradeInterval {
        font-size: 0.7rem;
    }

    .points {
        font-size: 0.85rem;
    }

    .togetherPoints {
        font-size: 0.85rem;
    }

    .date {
        font-size: 0.85rem;
    }
}

@media (max-width: 740px) {
    .studentGradesTable thead th {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .studentGradesTable tbody th {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .studentGradesTable tbody tr.lastRow th  {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .studentGradesTable tbody .headerGradeName {
        font-size: 0.7rem;
    }

    .studentGradesTable tbody .headerGradeDescription, .studentGradesTable tbody .headerGradeInterval {
        font-size: 0.6rem;
    }

    .studentGradesTable tbody .headerGradeInterval {
        box-sizing: border-box;
        padding: 3px 3px;
    }

    .points {
        font-size: 0.85rem;
    }

    .togetherPoints {
        font-size: 0.85rem;
    }

    .date {
        font-size: 0.7rem;
    }
}

@media (max-width: 500px) {
    .studentGradesTable thead th {
        font-size: 0.5rem;
    }

    .studentGradesTable {
        margin-top: 3px;
    }

    .studentGradesTable tbody tr.lastRow th  {
        padding: 10px 15px;
        font-size: 0.6rem;
    }
    
    .studentGradesTable tbody th {
        padding: 4px 5px;
    }
    
    .studentGradesTable tbody .headerGradeName {
        font-size: 0.5rem;
    }

    .studentGradesTable tbody .headerGradeDescription, .studentGradesTable tbody .headerGradeInterval {
        font-size: 0.4rem;
    }

    .points {
        font-size: 0.55rem;
    }

    .togetherPoints {
        font-size: 0.55rem;
    }

    .date {
        font-size: 0.55rem;
    }
}

@media (max-width: 430px) {
    th:first-child, td:first-child {
        text-wrap: wrap; /* Prevent text from wrapping */
    }

    body th .headerGrade {
        justify-content: space-around;    
    }

}
