/* Import Google Fonts for a clean look */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 500px;
}

h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #555;
}

#student-id {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
}

#student-id:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.student-name {
    margin-top: 15px;
    font-size: 1.3em;
    color: #007bff;
    font-weight: 500;
    text-align: center;
    min-height: 25px;
}

.view-btn {
    background-color: #4a90e2;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.view-btn:hover {
    background-color: #357bd9;
    transform: translateY(-2px);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 800px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
}

.close-btn-modal {
    margin-top: 20px;
    background-color: #dc3545;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.close-btn-modal:hover {
    background-color: #c82333;
}

/* Table Styling (General) */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 5px;
    text-align: left;
}

/* Custom styles for the AVR Result Format */

/* Hide elements removed in script.js (Header/Footer) */
.result-header, .overall-total, .failed-header, .passed-header, .divider {
    display: none; 
}


/* Styles for the compact, 3-column combined subjects table */
.avr-style-table {
    border: 1px solid black; /* Outer border */
    width: 100%;
}

.avr-style-table th,
.avr-style-table td {
    border: 1px solid black; /* All internal borders */
    padding: 5px;
    text-align: center;
    font-size: 0.9em;
}

.avr-style-table thead th {
    background-color: #e9e9e9;
    color: #333;
    font-weight: bold;
}

/* Specific column widths/alignment */
.avr-style-table .no-col {
    width: 5%;
    font-weight: bold;
}

.avr-style-table .subj-col {
    width: 25%;
    text-align: left;
    font-weight: 500;
}

/* Status coloring applied here */
.avr-style-table .status-col {
    width: 8%;
    font-weight: bold;
}

.status-passed {
    color: #28a745; /* Green */
}

.status-failed {
    color: #dc3545; /* Red */
}

/* New styles for the total row */
.avr-style-table tfoot {
    font-weight: bold;
    background-color: #f0f0f0;
    border-top: 2px solid #333;
}

.avr-style-table tfoot td {
    /* Ensure footer cells have the same border style as the rest of the table */
    border: 1px solid black; 
    padding: 8px 5px;
}

.avr-style-table tfoot .total-label {
    text-align: right;
    font-size: 0.9em;
    /* Colspan="2" on the first instance, so we target it */
}

.avr-style-table tfoot tr > td:nth-child(2) { 
    text-align: right; 
}

.avr-style-table tfoot .total-count {
    text-align: right;
    font-size: 1.1em;
    color: #007bff; /* Blue to highlight the count */
}

