/* ================================================================
   Weighted Grade Calculator - Custom Styles
   ================================================================ */

/* Table Styling for the Calculator Form */
#weighted-grade-form table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

#weighted-grade-form th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 12px 10px;
    border: 1px solid #e0e0e0;
}

#weighted-grade-form td {
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
}

#weighted-grade-form tr:hover td {
    background-color: #fafafa;
}

/* Inputs inside the table */
#weighted-grade-form input[type="number"] {
    width: 100%;
    max-width: 100px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    height: 38px;
    box-sizing: border-box;
}

#weighted-grade-form input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

/* Highlight the Final Exam Row */
#final-exam-row td {
    background-color: #f0f7ff;
}

#final-exam-row td:first-child {
    font-weight: 600;
    color: #1e40af;
}

/* Action Buttons Layout */
.calc-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* Common Button Styles */
.calc-action-buttons button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
}

/* Specific Button Colors */
#add-assignment {
    background-color: #0ea5e9; /* Blue */
}
#add-assignment:hover {
    background-color: #0284c7;
}

#calculate-graded {
    background-color: #10b981; /* Green */
}
#calculate-graded:hover {
    background-color: #059669;
}

#clear-all {
    background-color: #ef4444; /* Red */
}
#clear-all:hover {
    background-color: #dc2626;
}

/* Result Box */
#result {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

#result .result {
    color: #2e7d32 !important;
    font-weight: 600;
    margin-bottom: 5px;
}

#weighted-grade-result {
    color: #1b5e20;
    font-size: 22px;
    font-weight: 700;
}

/* Error Box */
#resultError {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
}

#resultError p {
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    text-align: center;
}


/* ================================================================
   FORCE OVERRIDE FOR MAIN CSS TABLE WIDTHS
   ================================================================ */

th:nth-child(1), td:nth-child(1) {
    width: auto !important;
}



/* Responsive Design for Mobile */
@media (max-width: 767px) {
    #weighted-grade-form table {
        font-size: 13px;
    }
    
    #weighted-grade-form th, 
    #weighted-grade-form td {
        padding: 8px 5px;
    }
    
    #weighted-grade-form input[type="number"] {
        max-width: 70px;
        padding: 6px;
    }

    .calc-action-buttons button {
        width: 100%; /* Buttons full width on mobile */
    }
}

/* Table Styling for the SEO Content */
.tool-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}
.tool-content table th {
    background: #f5f5f5;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
}
.tool-content table td {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    color: #555;
}
.tool-content table tr:hover td {
    background: #fafafa;
}