/* ===========================================
    Grade Calculator - Tool Specific Styles
    =========================================== */

/* Box Styling */
.gc-box {
    max-width: 750px;
    margin: 0 auto;
    padding: 0; 
}

/* Form Container */
.gc-form {
    padding: 20px; 
    border: 1px solid #FFCDD2; /* Light Red/Pink Border */
    border-radius: 8px;
    background-color: #FFF8F9; /* Very Light Pink/White Background */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.gc-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #F44336; /* Red */
    border-bottom: 2px solid #FFCDD2;
    padding-bottom: 5px; 
    margin-top: 5px; 
    margin-bottom: 20px; 
}

/* --- 1. Assignment Inputs --- */

/* Assignment Row Grid */
.gc-assignment-grid {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 15px; /* Name | Grade/Score | Max Score | Weight | Delete */
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.gc-assignment-grid label {
    font-weight: 600;
    color: #546E7A;
    font-size: 0.9rem;
}
/* Ensure the Weight column header aligns with its input */
.gc-assignment-grid label:nth-child(4) {
    text-align: right;
}


.gc-assignment-row input[type="text"] {
    padding: 8px;
    border: 1px solid #EF9A9A;
    border-radius: 4px;
    font-size: 0.9rem;
}
.gc-assignment-row input[type="number"], .gc-assignment-row select {
    padding: 8px;
    border: 1px solid #EF9A9A;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}
.gc-assignment-row .weight-input {
    text-align: right !important;
}

.gc-assignment-row .delete-btn {
    background: none;
    border: none;
    color: #F44336;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Add Row Button */
#addAssignmentBtn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    background-color: #E57373;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
#addAssignmentBtn:hover {
    background-color: #D32F2F;
}

/* --- 2. Final Grade Planning Section --- */
.gc-planning-section {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px dashed #FFCDD2;
}

.gc-planning-inputs {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px 2%;
    align-items: flex-end; /* Align inputs and button */
}

.gc-planning-group {
    flex-basis: 30%; /* Allows three inputs per row */
    min-width: 150px;
    display: flex;
    flex-direction: column;
}
.gc-planning-group label {
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem; 
    margin-bottom: 6px;
}
.gc-planning-group input, .gc-planning-group select {
    padding: 10px;
    border: 1px solid #F44336;
    border-radius: 6px;
    font-size: 1rem;
    text-align: right;
}

.gc-calculate-btn {
    display: block;
    width: 100%;
    padding: 14px; 
    margin-top: 25px; 
    background-color: #F44336; /* Primary Red */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}
.gc-calculate-btn:hover {
    background-color: #D32F2F;
}

/* --- Results Display --- */
.gc-results {
    margin-top: 20px; 
    padding: 20px;
    border: 2px solid #E57373; 
    border-radius: 8px;
    background-color: #FFEBEE; /* Lightest Red */
    text-align: center;
}
.gc-results-title {
    color: #F44336;
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #FFCDD2;
    padding-bottom: 5px;
}
.gc-results-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: #4CAF50; /* Green for good grade */
}
.gc-results-label {
    font-size: 1rem;
    font-weight: 600;
    color: #546E7A;
    margin-top: 5px;
}


/* --- Responsive Adjustments --- */
@media (max-width: 700px) {
    .gc-assignment-grid {
        /* Collapse to 4 columns: Name | Score | Max | Weight */
        grid-template-columns: 3fr 1fr 1fr 1fr; 
        gap: 8px;
    }
    .gc-assignment-grid label:last-child {
        display: none; /* Hide delete label */
    }
    .gc-assignment-row .delete-btn {
        display: none; /* Hide delete button on small screens */
    }
    .gc-planning-group {
        flex-basis: 48%; /* Collapse planning to two columns */
    }
    .gc-planning-inputs {
        /* Force button to take full width */
        flex-direction: column; 
    }
}
@media (max-width: 400px) {
    .gc-assignment-grid {
        /* Stack inputs for extreme compactness */
        grid-template-columns: 1fr;
    }
    .gc-assignment-row > input, .gc-assignment-row > select {
        width: 100%;
    }
}