/* --- Global Styles & Variables --- */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --text-color: #555;
    --danger-color: #e74c3c;
    --font-family: 'Poppins', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-family); line-height: 1.6; background-color: var(--light-color); color: var(--text-color); }

/* --- Header & Navigation --- */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 5%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.nav-links { list-style: none; display: flex; }
.nav-links li { padding: 0 1rem; }
.nav-links a { text-decoration: none; color: var(--dark-color); font-weight: 600; transition: color 0.3s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--primary-color); }

/* --- Page Header --- */
.page-header { background: var(--primary-color); color: #fff; padding: 3rem 5%; text-align: center; }
.page-header h1 { font-size: 2.8rem; margin-bottom: 0.5rem; }
.page-header p { font-size: 1.1rem; opacity: 0.9; }

/* --- Calculator Container --- */
.calculator-container {
    max-width: 800px;
    margin: 2rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
}
.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-section h2 {
    text-align: center;
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

.input-group { display: flex; gap: 1rem; }

input[type="number"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1rem;
}

/* --- Tables --- */
#subject-table, #grading-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
#subject-table th, #subject-table td, #grading-table th, #grading-table td {
    padding: 0.8rem;
    text-align: left;
}
#subject-table th { background-color: #f9f9f9; }
#subject-table td { border-bottom: 1px solid #eee; }

/* --- Buttons --- */
.utility-btn, .remove-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.utility-btn { background: none; border: 2px solid var(--secondary-color); color: var(--secondary-color); }
.utility-btn:hover { background-color: var(--secondary-color); color: #fff; }

.remove-btn { background-color: var(--danger-color); color: #fff; border: none; }
.remove-btn:hover { background-color: #c0392b; }

.cta-button {
    display: block;
    width: 100%;
    color: #fff;
    padding: 1rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}
.cta-button.primary { background: var(--primary-color); }
.cta-button.primary:hover { background: #3a7bc8; }
.cta-button.secondary { background: var(--secondary-color); margin-top: 1.5rem; }
.cta-button.secondary:hover { background: #45d1b5; }

/* --- Result Boxes --- */
.result-box-style {
    background: #f0f7ff;
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 5px;
    text-align: center;
}
.result-box-style h3 { margin-bottom: 1rem; color: var(--dark-color); }
.result-box-style p { font-size: 1.5rem; font-weight: 600; margin: 0.5rem 0; }

/* --- Grading Table --- */
#grading-table th, #grading-table td { border: 1px solid #ddd; text-align: center; }
#grading-table th { background-color: var(--dark-color); color: #fff; }
#grading-table tbody tr:nth-child(even) { background-color: #f9f9f9; }


/* --- Footer --- */
footer { background: var(--dark-color); color: #fff; text-align: center; padding: 2rem 5%; margin-top: 2rem; }
