html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

.container {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
}

/* Styling for the subjects list */
#subjects-list {
    /* Removed custom flex properties to rely on Bootstrap's .row class */
    /* Removed gap to avoid conflict with Bootstrap's row/col spacing */
    padding: 20px 0;
}

.list-group-item {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 20px;
    text-align: left; /* Changed from center to left */
    font-size: 1.2em;
    color: #333;
    background-color: #fff;
    display: flex;
    flex-direction: row; /* Changed to row for icon and text side-by-side */
    align-items: center;
    justify-content: flex-start; /* Align items to the start */
    min-height: 80px; /* Adjusted for icon and text side-by-side */
}

.list-group-item-action:hover {
    background-color: #007bff; /* Primary blue for hover */
    color: white;
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.list-group-item-action:hover .subject-text {
    color: white; /* Ensure text color changes on hover */
}

.subject-icon {
    width: 50px; /* Adjust icon size as needed */
    height: 50px;
    object-fit: contain; /* Ensure image scales properly */
    margin-right: 15px; /* Space between icon and text */
}

.subject-text {
    font-weight: bold;
    /* Add any other text specific styles here */
}

/* Styling for the chapters list */
#chapters-list {
    display: grid;
    grid-template-columns: 1fr; /* Single column layout */
    gap: 15px;
    padding: 10px 0;
}

#chapters-list .list-group-item {
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 30px 25px; /* Increased padding */
    text-align: left;
    font-size: 1.1em;
    min-height: auto;
    flex-direction: row;
    justify-content: space-between; /* Pushes chapter name and buttons apart */
    align-items: center;
}

#chapters-list .list-group-item:hover {
    background-color: #f8f9fa; /* Subtle hover effect */
    transform: none; /* No lift on hover for this view */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Keep shadow consistent */
}

.chapter-name-text {
    font-weight: bold;
    font-size: 1.2em;
}


/* Styling for the formulas list */
#formulas-list {
    display: grid; /* Use grid for consistent spacing */
    grid-template-columns: 1fr; /* Single column */
    gap: 15px; /* Gap between formula items */
    padding: 10px 0;
}

#formulas-list .list-group-item {
    border: 1px solid #dee2e6; /* Visible border */
    border-radius: 8px; /* Consistent border radius */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Subtle shadow */
    padding: 15px;
    text-align: left;
    font-size: 1em;
    background-color: #fff;
    transition: all 0.2s ease; /* Smooth transition for any future hover effects */
}

#formulas-list .list-group-item:hover {
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Styling for the questions list */
#questions-list {
    display: grid; /* Use grid for consistent spacing */
    grid-template-columns: 1fr; /* Single column */
    gap: 15px; /* Gap between question items */
    padding: 10px 0;
}

#questions-list .list-group-item {
    border: 1px solid #dee2e6; /* Visible border */
    border-radius: 8px; /* Consistent border radius */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Subtle shadow */
    padding: 15px; /* Consistent padding with formulas */
    text-align: left; /* Ensure questions list items are left-aligned */
    font-size: 1em;
    background-color: #fff;
    transition: all 0.2s ease;
}

#questions-list .list-group-item:hover {
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Styling for all "Back" buttons */
.app-back-btn {
    background-color: #5a6268; /* Darker shade of secondary */
    border-color: #5a6268;
    color: #fff;
    font-weight: 600;
    padding: 10px 20px; /* More padding */
    border-radius: 0.5rem; /* Slightly more rounded */
    transition: all 0.3s ease;
    text-decoration: none; /* Ensure no underline if it's an anchor */
    display: inline-block; /* For proper padding and margin */
}

.app-back-btn:hover {
    background-color: #494f54; /* Even darker on hover */
    border-color: #494f54;
    transform: translateY(-1px); /* Subtle lift */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #fff; /* Ensure text color remains white on hover */
}

/* Styling for primary action buttons */
.app-primary-btn {
    background-color: #007bff; /* Bootstrap primary blue */
    border-color: #007bff;
    color: #fff;
    font-weight: 600;
    padding: 10px 20px; /* Consistent padding with back buttons */
    border-radius: 0.5rem; /* Consistent border-radius */
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.app-primary-btn:hover {
    background-color: #0056b3; /* Darker blue on hover */
    border-color: #0056b3;
    transform: translateY(-1px); /* Subtle lift */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #fff;
}

/* Styling for Question Bank button */
.app-question-bank-btn {
    background-color: #28a745; /* Bootstrap's success color */
    border-color: #28a745;
    color: #fff;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.app-question-bank-btn:hover {
    background-color: #218838; /* Darker green on hover */
    border-color: #1e7e34;
    color: #fff;
}


#toast.bg-danger .toast-header {
    background-color: #dc3545;
    color: white;
}

/* Form specific styling */
.form-container {
    background-color: #ffffff;
    padding: 50px 30px 30px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-weight: 600;
}

.form-control {
    border-radius: 0.3rem;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 500;
    color: #555;
}

.btn-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.toggle-password-btn {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #495057;
}

.toggle-password-btn:hover {
    background-color: #dee2e6;
    border-color: #ced4da;
}

/* Scroll-to-top and bottom button styling */
.scroll-buttons {
    position: fixed;
    bottom: 80px; /* Adjusted to be above the footer */
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between buttons */
}

.scroll-buttons .btn {
    display: none; /* Hidden by default */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5em;
    line-height: 1;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    text-align: left;
    font-weight: bold;
}

.unselectable {
    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
    user-select: none;
}

fmath.ma-block {
    color: #FFFFFF !important;
}

fmath mrow {
    color: #FFFFFF !important;
}

fmath table, fmath tbody, fmath tr, fmath td {
    color: #FFFFFF !important;
}


label {
    padding-left: 20px;
    vertical-align: top;
}

input[type="checkbox"] {
    margin: 5px;
    height: 18px;
    width: 18px;
    vertical-align: bottom;
    position: relative;
    top: 4px;
    *overflow: hidden;
    border-radius: 50%;
}

input[type="radio"] {
    margin: 5px;
    height: 15px;
    width: 15x;
    top: -4px;
}

/* Custom styles for the Question Calendar Modal */

/* Modal Dialog - Increased Height and Custom Width */
#question-calender-modal .modal-dialog {
    width: 80vw; /* Set width to 80% of viewport width */
    max-width: none; /* Override Bootstrap's max-width for modal-xl to allow 80vw */
    max-height: 90vh; /* Increased maximum height */
    display: flex; /* Use flexbox for better height control */
    align-items: center; /* Center vertically if content is shorter */
    margin: 1.75rem auto; /* Standard Bootstrap margin */
}

#question-calender-modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 100%; /* Allow content to fill the dialog height */
}

/* Modal Header */
#question-calender-modal .modal-header {
    background-color: #f0f2f5; /* Lighter gray background */
    border-bottom: 1px solid #e0e0e0;
    border-top-left-radius: 0.5rem; /* Slightly more rounded corners */
    border-top-right-radius: 0.5rem;
    padding: 1.25rem 2rem; /* Increased padding */
}

#question-calender-modal .modal-title {
    color: #212529; /* Darker text for title */
    font-weight: 700; /* Bolder title */
    font-size: 1.35rem; /* Slightly larger title */
}

/* Modal Body */
#question-calender-modal .modal-body {
    padding: 1.5rem 2rem; /* Increased horizontal padding */
    overflow-y: auto; /* Allow modal body to scroll if content exceeds height */
    flex-grow: 1; /* Allow modal body to take up available space */
}

/* Modal Footer */
#question-calender-modal .modal-footer {
    border-top: 1px solid #e0e0e0;
    padding: 1.25rem 2rem;
    background-color: #f0f2f5;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Table Container Styling */
#question-calendar-table-container {
    border: 1px solid #d1d1d1; /* Softer border */
    border-radius: 0.75rem; /* More rounded corners */
    overflow: hidden; /* Ensures border-radius applies to children */
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08); /* More pronounced shadow */
}

/* Table Styling */
#question-calendar-table-container table {
    margin-bottom: 0; /* Remove default table margin */
    border-collapse: separate; /* Allows border-radius on cells if needed */
    border-spacing: 0; /* Remove spacing between cells */
}

#question-calendar-table-container thead {
    background-color: #0056b3; /* Darker blue for header */
    color: white;
    position: sticky;
    top: 0;
    z-index: 10; /* Ensure header stays above scrolling content */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for header */
}

#question-calendar-table-container th {
    padding: 1rem 1.75rem; /* Increased padding */
    border-bottom: none; /* Remove default border */
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem; /* Slightly smaller font for headers */
    letter-spacing: 0.03em; /* Slight letter spacing */
    text-transform: uppercase; /* Uppercase for headers */
}

#question-calendar-table-container tbody tr {
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-out; /* Added transform for subtle animation */
    border-bottom: 1px solid #e9ecef; /* Subtle border between rows */
}

#question-calendar-table-container tbody tr:last-child {
    border-bottom: none; /* No border for the last row */
}

#question-calendar-table-container tbody tr:hover {
    background-color: #e2f0ff; /* Lighter blue on hover */
    transform: scale(1.005); /* Subtle grow effect on hover */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05); /* Subtle shadow on hover */
}

#question-calendar-table-container td {
    padding: 0.9rem 1.75rem; /* Increased padding */
    vertical-align: middle;
    border-top: none; /* Remove default border, using tbody tr border instead */
    font-size: 0.9rem; /* Consistent font size for body cells */
    color: #343a40;
}

/* Striped rows custom color */
#question-calendar-table-container tbody tr:nth-of-type(odd) {
    background-color: #f8f9fa; /* Lightest gray for odd rows */
}

/* Scrollbar Styling (for Webkit browsers) */
#question-calendar-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#question-calendar-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#question-calendar-table-container::-webkit-scrollbar-thumb {
    background: #a8a8a8; /* Slightly darker scrollbar thumb */
    border-radius: 10px;
}

#question-calendar-table-container::-webkit-scrollbar-thumb:hover {
    background: #7c7c7c; /* Even darker on hover */
}

/* No Data Message Styling */
#question-calendar-table-container .alert {
    margin: 0; /* Remove default margin from alert */
    border-radius: 0.75rem; /* Match container border-radius */
    font-size: 1.05rem;
    padding: 1.5rem;
}

/* Custom large spinner size */
.large-spinner {
    width: 5rem; /* Adjust size as needed */
    height: 5rem; /* Adjust size as needed */
}
