/* Styles cho trang kết quả */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.search-section {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

#search-input,
#filter-status {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#search-input {
    flex: 1;
}

.results-table-container {
    overflow-x: auto;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#results-table th,
#results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#results-table th {
    background-color: #f5f5f5;
}

.btn-view {
    padding: 6px 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-view:hover {
    background-color: #0056b3;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 20px 0;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

#results-container {
    max-width: 800px;
    margin: 5rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.final-score {
    font-size: 1.5rem;
    color: var(--primary);
}

.question-result {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.correct-answer {
    color: #28a745;
    /* Green */
}

.incorrect-answer {
    color: #dc3545;
    /* Red */
    text-decoration: line-through;
}

/* === PREMIUM UI UPGRADE === */

/* --- Hero Section --- */
.results-hero {
    position: relative;
    padding: 100px 20px 80px;
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #090a57);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    color: white;
    text-align: center;
    border-radius: 0 0 40px 40px;
    margin-bottom: -60px;
    /* Overlap with content */
    z-index: 1;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    animation: floatShape 20s infinite linear;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -50px;
    left: -50px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent);
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: 20%;
    right: 10%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2), transparent);
    animation-direction: reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 20%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent);
}

@keyframes floatShape {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(30px, 50px) rotate(180deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.results-hero .page-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.results-hero .page-subtitle {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Glass Container --- */
.glass-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.header-actions {
    margin-bottom: 20px;
}

/* --- Glass Inputs --- */
.glass-input-group {
    margin-bottom: 30px;
}

.glass-input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: white;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* --- Modern Table --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

#history-table th {
    background: #f1f5f9;
    padding: 15px 20px;
    font-weight: 600;
    color: #475569;
    text-align: left;
    white-space: nowrap;
}

#history-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

#history-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-graded {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef9c3;
    color: #854d0e;
}

.status-submitted {
    background: #dbeafe;
    color: #1e40af;
}

/* Action Button */
.button-details {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.button-details:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.question-review-block {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-soft);
    background-color: #fdfdfd;
}

.question-review-block h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

.question-review-block.is-correct h4::after {
    content: '✓';
    color: var(--color-success);
}

.question-review-block.is-incorrect h4::after {
    content: '✗';
    color: var(--color-danger);
}

.answer-wrapper p {
    margin: 0.5rem 0;
}

.correct {
    color: #28a745;
    font-weight: 600;
}

.incorrect {
    color: #dc3545;
    font-weight: 600;
    text-decoration: line-through;
}

.true-false-review-list {
    list-style: none;
    padding-left: 0;
}

.true-false-review-list li {
    margin-bottom: 0.5rem;
}

.history-body {
    padding: 1.5rem;
    background-color: var(--color-surface);
    border-radius: var(--border-radius-soft);
    box-shadow: var(--shadow-subtle);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.history-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-text-primary);
}

.history-header .filter {
    display: flex;
    gap: 10px;
}

.history-header .filter select {
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background-color: var(--color-surface-soft);
}

.history-header .filter select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.history-header .filter select option {
    padding: 8px;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
}

.history-header .filter select option:hover {
    background-color: var(--color-surface-soft);
}

.history-header .filter select option:checked {
    background-color: var(--color-primary);
    color: white;
}

.history-header .filter select option:checked:hover {
    background-color: var(--color-primary-dark);
    color: white;
}

.history-header .filter select option:disabled {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.history-header .filter select option:disabled:hover {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.history-header .filter select option:disabled:checked {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.history-header .filter select option:disabled:checked:hover {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.history-header .filter select option:disabled:checked:focus {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.history-header .filter select option:disabled:checked:focus:hover {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.history-header .filter select option:disabled:checked:focus:active {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.history-header .filter select option:disabled:checked:focus:active:hover {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.history-header .filter select option:disabled:checked:focus:active:focus {
    background-color: var(--color-surface-soft);
    color: var(--color-text-secondary);
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.question-review-block {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.question-review-block h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

.question-review-block p {
    margin: 0.5rem 0;
}

.correct {
    color: #28a745;
    /* Màu xanh lá */
    font-weight: bold;
}

.incorrect {
    color: #dc3545;
    /* Màu đỏ */
    font-weight: bold;
}

.question-review-block ul {
    list-style: none;
    padding-left: 1rem;
}


#summary-section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

#summary-section p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

#summary-section p strong {
    color: var(--color-text-primary);
}

#summary-section h1,
#summary-section h2 {
    margin-top: 0;
}

#summary-section h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

#summary-section h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

#summary-section h2 {
    color: var(--color-text-secondary);
}

#summary-section h2 strong {
    color: var(--color-text-primary);
}

#summary-section h2 span {
    color: var(--color-text-secondary);
}

#summary-section h2 span.correct {
    color: #28a745;
    /* Màu xanh lá */
}

#summary-section h2 span.incorrect {
    color: #dc3545;
    /* Màu đỏ */
}

#summary-section h2 span.correct::before {
    content: '✓ ';
    color: #28a745;
    /* Màu xanh lá */
}

#summary-section h2 span.incorrect::before {
    content: '✗ ';
    color: #dc3545;
    /* Màu đỏ */
}

#summary-section h2 span.total {
    font-weight: bold;
    color: var(--color-text-primary);
}

#summary-section h2 span.total::before {
    content: 'Tổng: ';
    font-weight: normal;
    color: var(--color-text-secondary);
}

#summary-section h2 span.total.correct {
    color: #28a745;
    /* Màu xanh lá */
}

#summary-section h2 span.total.incorrect {
    color: #dc3545;
    /* Màu đỏ */
}

#summary-section h2 span.total.correct::before {
    content: 'Tổng đúng: ';
    font-weight: normal;
    color: var(--color-text-secondary);
}

#summary-section h2 span.total.incorrect::before {
    content: 'Tổng sai: ';
    font-weight: normal;
    color: var(--color-text-secondary);
}

#details-section h2 {
    margin-bottom: 2rem;
}

.question-review-block {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.question-review-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.question-review-block h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Kiểu dáng cho câu trả lời */
.question-review-block p {
    margin: 0.5rem 0;
}

.correct {
    color: #28a745;
    font-weight: 600;
}

.incorrect {
    color: #dc3545;
    font-weight: 600;
    text-decoration: line-through;
}

.question-review-block ul {
    list-style: none;
    padding-left: 1rem;
}

.question-review-block li {
    margin-bottom: 0.5rem;
}

.feedback-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

#generate-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#generate-feedback-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

#generate-feedback-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#generate-feedback-btn i {
    font-size: 16px;
}

.results-container {
    max-width: 800px;
    margin: 2rem auto;
    background-color: var(--color-surface);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

#summary-section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

#summary-section h1,
#summary-section h2 {
    margin-top: 0;
}

#summary-section p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}

#summary-section p strong {
    color: var(--color-text-primary);
}

.question-review-block {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.question-review-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.question-review-block h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

.question-review-block {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-soft);
    background-color: #fdfdfd;
}

.question-review-block h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

/* Biểu tượng Đúng/Sai cho tiêu đề câu hỏi */
.question-review-block.is-correct h4::after {
    content: '✓';
    color: var(--color-success);
}

.question-review-block.is-incorrect h4::after {
    content: '✗';
    color: var(--color-danger);
}

.answer-wrapper p {
    margin: 0.5rem 0;
}

.correct {
    color: #28a745;
    font-weight: 600;
}

.incorrect {
    color: #dc3545;
    font-weight: 600;
    text-decoration: line-through;
}

.true-false-review-list {
    list-style: none;
    padding-left: 0;
}

.true-false-review-list li {
    margin-bottom: 0.5rem;
}

.view-result-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.view-result-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.view-result-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* css/pages/results.css */
/* File này chứa các style cụ thể cho trang kết quả và lịch sử làm bài */

/* Huy hiệu trạng thái */
.score-graded {
    color: #35dc59;
    font-weight: bold;
    font-size: 1.2rem;
}

.score-pending {
    color: var(--color-warning);
    font-weight: bold;
    font-size: 1.2rem;
}

.review-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Cột trái chiếm 2/3, cột phải 1/3 */
    gap: 2rem;
    align-items: flex-start;
    margin-top: 5rem;
}

.review-sidebar {
    position: sticky;
    top: 100px;
}

.info-card {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--border-radius-soft);
    box-shadow: var(--shadow-small);
    margin-bottom: 1.5rem;
}

.info-card h2 {
    margin: auto;
    font-size: 1.5 rem;
}

.page-review .container {
    max-width: 100%;
    /* Cho phép container chiếm 100% chiều rộng */
    padding-left: 2rem;
    /* Giữ lại một chút lề */
    padding-right: 2rem;
}

/* --- TRANG CHI TIẾT BÀI LÀM --- */
.page-review .container {
    max-width: 100%;
    padding: 1rem 2rem;
    /* Thêm padding cho màn hình lớn */
}

.review-layout {
    display: grid;
    grid-template-columns: 1fr;
    /* Mặc định 1 cột cho mobile */
    gap: 2rem;
    align-items: flex-start;
}

/* Bố cục 2 cột cho màn hình lớn hơn */
@media (min-width: 1024px) {
    .review-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.review-content h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.review-sidebar {
    position: sticky;
    top: 2rem;
}

.info-card {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--border-radius-soft);
    box-shadow: var(--shadow-small);
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
}

.info-card h3 {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.info-card p {
    margin: 0.5rem 0;
}

.final-score {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--color-primary);
}

/* Khối xem lại từng câu hỏi */
.question-review-block {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-soft);
    background-color: #fdfdfd;
}

.question-review-block h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

/* Biểu tượng Đúng/Sai */
.question-review-block.is-correct h4::after {
    content: '✓';
    color: var(--color-success);
}

.question-review-block.is-incorrect h4::after {
    content: '✗';
    color: var(--color-danger);
}

/* Kiểu dáng câu trả lời */
.correct {
    color: #28a745;
    font-weight: 600;
}

.incorrect {
    color: #dc3545;
    font-weight: 600;
}

.true-false-review-list {
    list-style: none;
    padding-left: 0;
}

.true-false-review-list li {
    margin-bottom: 0.5rem;
}

/* Styling for AI Feedback */
#ai-feedback-content strong {
    color: var(--color-primary);
    /* Or a success color like #28a745 */
    font-weight: 600;
}

#ai-feedback-content p {
    margin: 0.5rem 0;
}

#ai-feedback-content .error-message {
    color: var(--color-danger);
    font-style: italic;
}

#manual-grading-card {
    background-color: var(--color-surface-soft);
    border: 1px solid var(--color-border);
}

#manual-score-input {
    width: 100px;
    /* Chiều rộng vừa phải */
    padding: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* CSS cho ô nhập điểm từng câu */
.score-input-wrapper {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-input-wrapper label {
    font-weight: 600;
}

.score-input {
    width: 80px;
    padding: 5px 8px;
    text-align: center;
}

strong,
b {
    font-weight: bold;
    /* Đảm bảo chữ luôn được in đậm */
    color: var(--color-text-primary);
    /* Sử dụng màu chữ chính để nổi bật hơn */
}

/* Định dạng cho văn bản in nghiêng */
em,
i {
    font-style: italic;
    /* Đảm bảo chữ luôn được in nghiêng */
}

/* Định dạng cho danh sách (dấu hoa thị) */
ul {
    list-style-type: disc;
    /* Sử dụng dấu chấm tròn cho danh sách */
    padding-left: 2rem;
    /* Thêm khoảng cách thụt vào đầu dòng */
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
    /* Thêm khoảng cách giữa các mục trong danh sách */
    color: var(--color-text-secondary);
}

/* Thêm vào file CSS chung */

.ai-feedback-container {
    background-color: var(--color-surface-soft);
    border-radius: var(--border-radius-soft);
    padding: 1.5rem;
    border-left: 4px solid var(--color-primary);
}

.ai-feedback-container h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Định dạng cho văn bản in đậm */
.ai-feedback-container strong {
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Định dạng cho danh sách (dấu hoa thị) */
.ai-feedback-container ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.ai-feedback-container li {
    margin-bottom: 0.75rem;
    color: var(--color-text-secondary);
}

.ai-feedback-container li::marker {
    color: var(--color-primary);
}

.question-review-block.is-manually-graded-correct {
    border-left-color: #28a745;
    /* Màu xanh lá cây */
    background-color: #e6f7eb;
}