body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    padding: 20px;
    color: #333;
}

h1 {
    text-align: center;
    color: #2c3e50;
}

form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

input[type="text"],
input[type="number"] {
    padding: 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 8px 16px;
    font-size: 1rem;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #2980b9;
}

.grade-table {
    width: 100%;
    border-collapse: separate; /* Enables border-radius */
    border-spacing: 0;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.grade-table th,
.grade-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
    background-color: white;
}

.grade-table thead th:first-child {
    border-top-left-radius: 8px;
}

.grade-table thead th:last-child {
    border-top-right-radius: 8px;
}

.grade-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.grade-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.grade-table th {
    background-color: #34495e;
    color: white;
    cursor: pointer;
}

.grade-table tr:hover {
    background-color: #f1f1f1;
}

/* Row coloring based on performance */
.grade-a {
    background-color: #e8f8f5;
}
.grade-b {
    background-color: #eaf2f8;
}
.grade-c {
    background-color: #fef9e7;
}
.grade-d {
    background-color: #fcf3cf;
}
.grade-f {
    background-color: #fdecea;
}

.summary {
    margin-top: 30px;
    background-color: #fff;
    border-left: 5px solid #3498db;
    padding: 15px 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
}

#debugToggle {
    display: block;
    margin: 30px auto 10px;
    background-color: #e74c3c;
}

#debugSection {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

#debugSection.active {
    max-height: 800px; /* enough for long arrays */
    padding: 15px;
}

.debug-box {
    background-color: #f0f0f0;
    border-left: 4px solid #e74c3c;
    padding: 10px;
    max-width: 90%;
    margin: 0 auto 30px;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
    font-family: Consolas, monospace;
    overflow-x: auto;
}

/* Optional: colored letter grade classes (use instead of inline style) */
.letter-a { color: #2ecc71; font-weight: bold; }
.letter-b { color: #3498db; font-weight: bold; }
.letter-c { color: #f1c40f; font-weight: bold; }
.letter-d { color: #e67e22; font-weight: bold; }
.letter-f { color: #e74c3c; font-weight: bold; }