/* --- Session Dashboard Button Styling --- */

/* Style for the "Activate Quiz" button to be green (Go / Start) */
#activate_quiz_btn.button.start {
    background-color: #28a745; /* A positive green */
    border-color: #218838;
}

#activate_quiz_btn.button.start:hover {
    background-color: #218838; /* A slightly darker green on hover */
    border-color: #1e7e34;
}

/* Style for the "End Quiz" button to be red (Stop / Danger) */
#end_quiz_btn.button.delete {
    background-color: #dc3545; /* A warning red */
    border-color: #c82333;
}

#end_quiz_btn.button.delete:hover {
    background-color: #c82333; /* A slightly darker red on hover */
    border-color: #bd2130;
}


/* --- Live Participant List Styling --- */

/* Container for the list */
.participant-list-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #ffffff;
    max-height: 350px; /* Prevents the list from becoming too long */
    overflow-y: auto;  /* Adds a scrollbar only when needed */
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* The list itself (<ul>) */
#participant_list_ul {
    list-style-type: none; /* This removes the dots */
    padding-left: 0;       /* Removes the default browser indentation */
    margin: 0;
}

/* Each student's name in the list (<li>) */
#participant_list_ul li {
    padding: 12px 5px; /* Adds nice vertical spacing */
    border-bottom: 1px solid #f0f0f0; /* A faint line between names */
    color: #333;
    font-size: 1em;
}

/* Removes the line from the very last name in the list */
#participant_list_ul li:last-child {
    border-bottom: none;
}

/* --- Add these styles for the avatars --- */

/* Make the list item a flex container to align avatar and name */
#participant_list_ul li {
    display: flex;
    align-items: center; /* This vertically centers the avatar with the name */
    padding: 8px 5px;   /* Adjusted padding for a tighter look */
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 1em;
}

/* Style the avatar image itself */
.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Makes the avatar circular */
    margin-right: 12px; /* Adds space between the avatar and the name */
    object-fit: cover;  /* Prevents the image from being squished */
}



/* --- Deep Analysis Stats Grid Styling --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 15px;
    text-align: center;
}

.stats-grid > div {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-grid > div strong {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.stats-grid > div span {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}


/* --- Analysis Table Progress Bar Styling --- */
.progress-bar-container {
    position: relative;
    width: 100%;
    height: 22px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden; /* Ensures the inner bar respects the radius */
}

.progress-bar {
    height: 100%;
    background-color: #28a745; /* A success green color */
    border-radius: 5px;
    transition: width 0.4s ease-in-out;
}

/* Style for the percentage text inside the bar */
.progress-bar-container span {
    position: absolute;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}


/* --- Analysis Table Row Highlighting --- */
.analysis-table tbody tr.highlight-fastest {
    background-color: #e6ffed; /* A light, soft green */
    --tw-ring-color: #10b981; /* For a subtle focus ring if needed */
}

.analysis-table tbody tr.highlight-slowest {
    background-color: #fff0f1; /* A light, soft red */
    --tw-ring-color: #f43f5e; /* For a subtle focus ring if needed */
}

/* Optional: Add a smooth transition to the color change */
.analysis-table tbody tr {
    transition: background-color 0.3s ease-in-out;
}



/* --- Participant List for Answer Review --- */
.participant-list-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background-color: #fdfdfd;
}

.participant-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.participant-list li a {
    display: block;
    padding: 8px 12px;
    color: #0056b3;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.participant-list li a:hover {
    background-color: #e9ecef;
    text-decoration: underline;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
}
.modal-close-btn:hover {
    color: #333;
}

.modal-body-content .review-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}
.modal-body-content .review-item:last-child {
    border-bottom: none;
}
.modal-body-content .review-question-text {
    font-weight: bold;
    margin-bottom: 8px;
}
.modal-body-content .correct-answer-text {
    color: #28a745;
}
.modal-body-content .incorrect-answer-text {
    color: #dc3545;
}



/* --- SPECIFIC MODAL STYLES FOR session_dashboard.php --- */

/* This utility class will handle showing and hiding the modal */
.modal-overlay.hidden {
    display: none;
}

/* Styles for the content inside our specific confirmation modal */
#confirm-modal-body h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}
#confirm-modal-body p {
    margin-bottom: 25px;
    line-height: 1.6;
    color: #555;
}

.confirm-modal-actions {
    text-align: right;
    margin-top: 20px;
}

.confirm-modal-actions .button {
    margin-left: 10px;
}
/* --- END: NEW & SPECIFIC MODAL STYLES --- */

/* =================================================
   Bulk Import Button Styles
   ================================================= */

/* .page-actions-container {
    
} */

/* Style for the Bulk Import button */
.bulk-import-btn {
    display: inline-flex; /* Aligns icon and text */
    align-items: center;
    gap: 8px; /* Space between icon and text */
    background-color: #f0f4f8; /* A light, secondary color */
    color: #4a5568;
    border: 1px solid #dcdfe6;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.bulk-import-btn:hover {
    background-color: #e2e8f0;
    border-color: #c0c4cc;
    color: #2d3748;
    transform: translateY(-1px); /* Subtle lift effect */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* The SVG icon inherits the color from the button's text color */
.bulk-import-btn svg {
    stroke: currentColor;
}


/* Style for the new Generate button */
.generate-material-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #007bff; /* A primary blue color */
    border-color: #007bff;
    color: #fff;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.generate-material-btn:hover {
    background-color: #0069d9;
    border-color: #0062cc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.generate-material-btn svg {
    stroke: currentColor;
}

/* =================================================
   Bulk Import Preview Styles
   ================================================= */

.preview-question {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    background-color: #fafafa;
}

.preview-question h4 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.preview-option {
    display: flex;
    align-items: center; /* This is the key for vertical alignment */
    gap: 10px; /* Space between radio and text input */
    margin-bottom: 8px;
}

.preview-option input[type="radio"] {
    flex-shrink: 0; /* Prevents the radio button from shrinking */
    margin: 0;
}

.preview-option input[type="text"] {
    flex-grow: 1; /* Makes the text input take all available space */
    width: 100%; /* Fallback for older browsers */
}

/* Consistent styling for new points/time inputs */
.preview-question .form-group-inline {
    display: flex;
    gap: 20px;
}
.preview-question .form-group-inline .form-group {
    flex: 1;
}

/* Character counting */
.char-counter-wrapper {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}


/* =================================================
   Generate From Material Page Styles
   ================================================= */

/* New styles for the controls */
.generation-controls {
    display: flex;
    align-items: flex-end; /* This aligns the bottom of the items */
    gap: 15px; /* Space between the dropdown and the button */
    margin-top: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.generation-controls .form-group {
    margin: 0;
}

.generation-controls .button {
    margin-bottom: 0;
}

/* Style for the AI generation status message */
#status_message.loading::before {
    content: '';
    display: inline-block;
    width: 20px;          /* Adjust size as needed */
    height: 20px;         /* Adjust size as needed */
    margin-right: 10px;   /* Space between icon and text */
    vertical-align: middle; /* Aligns the icon nicely with the text */

    /* --- IMPORTANT --- */
    /* Update the path to your actual clock.gif file */
    background-image: url('../images/clock.gif');

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


/* For the "text is too short" warning message */
.message.warning {
    background-color: #fff3e0;
    border-color: #ffc107;
    color: #8a6d3b;
}



/* AI Grading Review Section Styling */
.ai-grading-review-container {
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fcfcfc;
}

.graded-question-block {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}
.graded-question-block:last-child {
    border-bottom: none;
}
.graded-question-block .question-text {
    font-size: 1.1em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
}

.student-answer-item {
    background-color: #fff;
    border: 1px solid #edebeb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.student-answer-item:last-child {
    margin-bottom: 0;
}

.student-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.student-info strong {
    font-size: 1.1em;
}

.overridden-badge {
    background-color: #ffc107;
    color: #333;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 10px;
    margin-left: 10px;
}

.student-answer-text {
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #333;
}

.ai-justification {
    background-color: #f4f6ff;
    border-left: 4px solid #8B5CF6; /* AI Purple */
    padding: 10px 15px;
    margin: 0 0 15px 0;
    font-style: italic;
    color: #555;
}
.ai-justification cite {
    display: block;
    text-align: right;
    font-style: normal;
    font-size: 0.9em;
    color: #8B5CF6;
    margin-top: 5px;
}

.grade-override-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.grade-override-controls label {
    font-weight: bold;
}
.grade-override-controls .score-input {
    width: 60px;
    padding: 5px 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.grade-override-controls .save-status {
    font-size: 14px;
    font-weight: bold;
}


/* Styling for the "Complete Your Profile" prompt on the dashboard */

/* The main container box for the prompt */
.name-prompt-box {
    background-color: #eef7ff; /* A light, friendly blue background */
    border-left: 5px solid #007bff; /* A prominent blue left border */
    padding: 15px 20px;
    margin-top: 20px;
    margin-bottom: 25px;
    border-radius: 4px;
}

/* The form itself */
.name-prompt-form {
    margin-top: 10px;
}

/* The label above the input field */
.name-prompt-form label {
    display: block; /* Make the label take its own line */
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

/* The container for the input and button to align them side-by-side */
.name-prompt-form div {
    display: flex; /* Use Flexbox for easy alignment */
    align-items: center; /* Vertically align items in the middle */
}

/* The text input field */
.name-prompt-form input[type="text"] {
    flex-grow: 1; /* Allow the input to take up available space */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin-right: 10px; /* Space between the input and the button */
    max-width: 400px; /* Optional: prevent it from becoming too wide on large screens */
}

/* Style for the button */
.name-prompt-form button {
    padding: 10px 20px;
    background-color: #007bff; /* The blue color from your screenshot */
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* A simple hover effect for the button */
.name-prompt-form button:hover {
    background-color: #0056b3; /* A slightly darker blue on hover */
}

/* Styling for the validation error message */
.name-prompt-box .error-text {
    color: #D8000C; /* A standard error red color */
    font-weight: bold;
    margin-top: 10px;
}


/* =============================================== */
/* === STYLES FOR CLASS & STUDENT MANAGEMENT === */
/* =============================================== */

/* --- "Back to All Classes" Link --- */
.back-link {
    display: inline-block;
    padding: 8px 16px;
    margin-bottom: 25px;
    background-color: #f0f2f5; /* A light, neutral background */
    color: #444;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid #ddd;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.back-link:hover {
    background-color: #e4e6e9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- "Add Student" Form Container & Input --- */
.add-student-form-container {
    background-color: #f9fafb;
    padding: 20px 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 30px;
    max-width: 650px; /* Limits the width of the form */
}

.add-student-form-container .inline-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.add-student-form-container .inline-form .form-group {
    flex-grow: 1; /* Allows the input field to take up available space */
}

/* --- New rule for the progress button --- */
.actions-cell .button-small.progress {
    background-color: #03c6e4; /* A nice info/teal color */
    color: white;
}
.actions-cell .button-small.progress:hover {
    background-color: #138496;
}

/* --- Consistent Table Action Buttons --- */
/* Your screenshot shows these already have color, but let's ensure they are consistent */
.actions-cell .button-small {
    border-radius: 5px; /* Ensures consistent border radius */
    border: none;
    padding: 6px 12px;
}

.actions-cell .button-small.edit {
    background-color: #ffc107; /* A nice yellow */
    color: #212529;
}
.actions-cell .button-small.edit:hover {
    background-color: #e0a800;
}

.actions-cell .button-small.delete {
    background-color: #dc3545; /* A strong red */
    color: white;
}
.actions-cell .button-small.delete:hover {
    background-color: #c82333;
}


/* --- Modal Button Styling --- */
.modal-content .button.delete {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}
.modal-content .button.delete:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.modal-content .button-secondary {
    background-color: #6c757d; /* A neutral grey */
    color: white;
    border: 1px solid #6c757d;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px; /* Or whatever your main .button radius is */
    transition: background-color 0.2s;
}
.modal-content .button-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.button.premium-feature {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Adjust spacing between icon and text */
}

.button.premium-feature .lock-icon {
    fill: currentColor; /* Makes the SVG icon inherit the button's text color */
}


    .participant-list li {
        display: flex;
        align-items: center;
        margin-bottom: 8px; /* Adds a little space between names */
        padding: 5px;
        border-radius: 5px;
        transition: background-color 0.2s ease;
    }

    .participant-list li:hover {
        background-color: #f8f9fa; /* Light grey background on hover */
    }

    /* Style for the participant's name and avatar */
    .participant-list li .participant-avatar {
        margin-right: 10px;
    }
    
    .participant-list li span {
        flex-grow: 1; /* This makes the name take up all available space */
    }

    /* Styles for our new "Remove" button */
    .remove-participant-btn {
        /* Sizing and Shape */
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 16px;
        line-height: 28px; /* Vertically center the '✖' */
        text-align: center;
        border-radius: 50%; /* Make it a perfect circle */
        
        /* Coloring and Appearance */
        background-color: #f1f1f1;
        color: #888;
        border: 1px solid #ddd;
        cursor: pointer;
        
        /* Hide it by default */
        opacity: 0.75;
        visibility: visible;
        transform: scale(0.8);
        transition: all 0.2s ease;
    }

    /* VERY IMPORTANT: Only show the button when the user hovers over the list item */
    .participant-list li:hover .remove-participant-btn {
        opacity: 1;
        transform: scale(1);
    }
    
    /* Style for when the user hovers directly over the button */
    .remove-participant-btn:hover {
        background-color: #e74c3c; /* Red background */
        color: white; /* White 'X' */
        border-color: #c0392b;
    }



/* Style for the Google Sign-in Button */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    background-color: #4285F4;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background-color .3s;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.google-btn:hover {
    background-color: #357ae8;
}

.google-btn img {
    margin-right: 15px;
    width: 36px;
    height: 36px;
    background-color: white;
    padding: 2px;
    border-radius: 50%;
}