/* General Page Styles */
body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.remove-btn {
    background-color: #dc3545;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.remove-btn:hover {
    background-color: #c82333;
}

.ActionBtn {
    color: white;
    background-color: #28a745;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.ActionBtn:hover {
    background-color: #218838;
}

/* Headings */
h1 {
    margin-top: 20px;
    color: #333;
    font-size: 32px;
}

h2 {
    color: #2a6c2a;
    font-size: 36px;
    margin: 10px 0;
}

/* Search Box and Input Form Container */
#SearchCourse {
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Input box */
#SearchCourse input[type="text"] {
    width: calc(70% - 10px);
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    outline: none;
}

#SearchCourse input[type="text"]:focus {
    border-color: #007bff;
}

/* Search Button */
#search-btn {
    padding: 12px 20px;
    margin-left: 10px;
    font-size: 16px;
    background: #007bff;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

#search-btn:hover {
    background: #0056b3;
}

/* Radio Button Container */
#SearchCourse > div:first-of-type {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

/* Radio Button Styles */
input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #007bff;
    vertical-align: middle;
}

input[type="radio"]:hover {
    opacity: 0.8;
}

/* Radio Button Labels */
input[type="radio"] + label {
    font-size: 15px;
    color: #333;
    cursor: pointer;
    user-select: none;
    display: inline-block;
    margin-bottom: 8px;
}

/* Radio Button Wrapper */
#SearchCourse > div:first-of-type label {
    display: inline-block;
    padding: 5px 0;
}

/* Results Section */
#result {
    margin-top: 15px;
    padding: 10px;
    min-height: 20px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 500px;
    overflow-y: auto;
}

/* Scrollbar styling */
#result::-webkit-scrollbar {
    width: 8px;
}

#result::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#result::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 10px;
}

#result::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Input Form Container (courses list area) */
#InputFormContainer {
    margin-top: 20px;
}

/* GPA Display Section */
#gpa-d {
    margin-top: 20px;
    padding: 25px;
    background: #e8f5e9;
    border-left: 5px solid #28a745;
    border-radius: 10px;
    font-size: 18px;
    color: #2a6c2a;
    text-align: center;
}

#gpa-d h1 {
    color: #2a6c2a;
    margin: 0 0 10px 0;
    font-size: 24px;
}

#gpa-d h2 {
    font-size: 48px;
    font-weight: bold;
    margin: 0;
}

/* Buttons inside dynamic forms */
button {
    cursor: pointer;
}

/* Rules Section */
#rules {
    width: 90%;
    max-width: 800px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#rules h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

#rules ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#rules ul li {
    padding: 15px 20px;
    margin: 12px 0;
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    border-radius: 5px;
    line-height: 1.6;
    color: #555;
}

/* Footer Styles */
footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 25px;
    margin-top: 50px;
    font-size: 14px;
    border-top: 4px solid #007bff;
}

footer a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Course Form Styles */
.course-form {
    background: white;
    padding: 25px;
    margin: 20px 0;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.course-form h3 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.marks-form {
    margin-top: 15px;
}

.input-group {
    margin: 15px 0;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-container input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    flex: 1;
}

.input-container input[type="number"]:focus {
    border-color: #007bff;
}

.input-container span {
    color: #777;
    font-weight: bold;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#result table {
    display: table;
    overflow-x: auto;
}

table thead {
    background: #007bff;
    color: white;
}

table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #007bff;
    z-index: 10;
}

table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

table tbody tr {
    background: white;
}

table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

table tbody tr:hover {
    background: #e3f2fd;
}

/* Make table scrollable on smaller screens */
#result {
    overflow-x: auto;
}

#result table {
    min-width: 600px;
}

/* Calculate GPA Button */
#InputFormContainer > button {
    background: #007bff;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    width: 100%;
}

#InputFormContainer > button:hover {
    background: #0056b3;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 24px;
        margin-top: 15px;
    }

    #SearchCourse {
        width: 95%;
        padding: 15px;
    }

    #SearchCourse input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
        font-size: 14px;
    }

    #search-btn {
        width: 100%;
        margin-left: 0;
        padding: 12px;
    }
    
    #SearchCourse > div:first-of-type {
        padding: 10px;
    }
    
    input[type="radio"] {
        width: 16px;
        height: 16px;
    }
    
    input[type="radio"] + label {
        font-size: 14px;
    }

    #rules {
        width: 95%;
        padding: 20px 15px;
    }

    #rules h1 {
        font-size: 22px;
    }

    #rules ul li {
        padding: 10px 12px;
        font-size: 14px;
    }

    .course-form {
        padding: 15px;
    }

    .course-form h3 {
        font-size: 16px;
    }

    .input-group label {
        font-size: 13px;
    }

    .input-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .input-container input[type="number"] {
        width: 100%;
    }

    .input-container span {
        text-align: center;
    }

    .remove-btn,
    .ActionBtn {
        width: 100%;
        padding: 12px;
        margin: 5px 0;
    }

    table {
        font-size: 11px;
        min-width: 100%;
    }

    table th,
    table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    #result table {
        min-width: 500px;
    }

    footer {
        padding: 15px;
        font-size: 13px;
    }

    #gpa-d h1 {
        font-size: 20px;
    }

    #gpa-d h2 {
        font-size: 32px;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 20px;
    }

    #rules h1 {
        font-size: 20px;
    }

    #rules ul li {
        font-size: 13px;
        padding: 8px 10px;
    }

    table th,
    table td {
        padding: 6px 3px;
        font-size: 10px;
    }
    
    #result table {
        min-width: 400px;
    }

    .course-form h3 {
        font-size: 14px;
    }

    .input-group label {
        font-size: 12px;
    }
}
