/**
 * Quiz Templates CSS
 * Combined styles for quiz-home.php, quiz-result.php, and quiz-single.php
 */

.quiz-single-body header, .quiz-single-body footer {
    display: none;
}
.quiz-single-body .site-main#main {
    margin: 0;
}

.quiz-single-body .site-main#main {
    margin: 0;
}

/* KaTeX Math Formula Styles */
.katex {
    font-size: 1.1em !important;
    line-height: 1.2 !important;
}

.katex-display {
    margin: 0.5em 0 !important;
    text-align: center;
}

/* Ensure math formulas align properly in quiz questions */
.quiz-question-text .katex,
.question-title .katex {
    vertical-align: middle;
    margin: 0 2px;
}

/* Ensure math formulas align properly in answer options */
.quiz-answer-text .katex,
.option-text .katex {
    vertical-align: middle;
    margin: 0 2px;
}

/* Fix potential overflow issues with long formulas */
.katex .katex-html {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .katex {
        font-size: 1em !important;
    }
    
    .katex .katex-html {
        max-width: 100%;
    }
}

.full-width-content {
    width: 100% !important;
    max-width: none !important;
}

.full-width-main {
    width: 100% !important;
    max-width: none !important;
}

.site-content .inside-quiz {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Hide any potential sidebar elements */
.sidebar, .widget-area, .secondary {
    display: none !important;
}

/* ===== QUIZ HOME STYLES ===== */
.quiz-frontend-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Tab Navigation Styles */
.quiz-tabs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.quiz-tab-buttons {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.quiz-tab-btn {
    flex: 0 0 25%;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.quiz-tab-btn:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.quiz-tab-btn.active {
    background: white;
    color: #3498db;
    border-bottom-color: #3498db;
}

.quiz-tab-content {
    display: none;
    padding: 20px;
}

.quiz-tab-content.active {
    display: block;
}

.quiz-center-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.quiz-center-title {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.quiz-center-description {
    padding: 10px;
}
.welcome-message {
    font-size: 1.1rem;
    margin: 0;
}

.guest-mode {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.quiz-section {
    margin-bottom: 40px;
}

.quiz-section-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e5e9;
}

.section-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
}

/* Available Quizzes List Styles */
.quiz-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-item {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quiz-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.quiz-item-left {
    margin-right: 20px;
}

.quiz-logo {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-item-center {
    flex: 1;
}

.quiz-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2c3e50;
}

.quiz-item-title a {
    text-decoration: none;
    color: inherit;
}

.quiz-item-title a:hover {
    color: #3498db;
}

.quiz-item-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.quiz-validity {
    color: #27ae60;
    font-weight: 500;
}

.quiz-item-right {
    margin-left: 20px;
}

.quiz-start-btn {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.quiz-start-btn:hover {
    background: #2980b9;
    color: white;
}

.view-more-link, .search-btn {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.view-more-link:hover {
    text-decoration: underline;
}

.quiz-search {
    display: flex;
    gap: 10px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 250px;
}

.search-btn {
    padding: 8px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Quiz Records Tab Styles */
.quiz-records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.records-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-box {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    min-width: 80px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.records-search {
    display: flex;
    gap: 10px;
}

.records-search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 200px;
}

.records-search-btn {
    padding: 8px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.quiz-records-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-header {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    font-weight: 600;
    color: #2c3e50;
}

.table-row {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.table-row:hover {
    background-color: #f8f9fa;
}

.th, .td {
    padding: 12px 8px;
    text-align: left;
    border-right: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.th:first-child, .td:first-child {
    flex: 0 0 40px;
    text-align: center;
}

.th:nth-child(2), .td:nth-child(2) {
    flex: 1;
    min-width: 200px;
}

.th:nth-child(3), .td:nth-child(3) {
    flex: 0 0 100px;
    text-align: center;
}

.th:nth-child(4), .td:nth-child(4) {
    flex: 0 0 100px;
    text-align: center;
}

.th:nth-child(5), .td:nth-child(5) {
    flex: 0 0 100px;
    text-align: center;
}

.th:nth-child(6), .td:nth-child(6) {
    flex: 0 0 100px;
    text-align: center;
}

.th:nth-child(7), .td:nth-child(7) {
    flex: 0 0 140px;
    text-align: center;
}

.th:nth-child(8), .td:nth-child(8) {
    flex: 0 0 100px;
    text-align: center;
}

.th:nth-child(9), .td:nth-child(9) {
    flex: 0 0 80px;
    text-align: center;
}

.th:nth-child(10), .td:nth-child(10) {
    flex: 0 0 80px;
    text-align: center;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.score-value {
    font-weight: 600;
    color: #f39c12;
}

.time-duration {
    color: #3498db;
    font-family: monospace;
}

.device-icon {
    font-size: 1.2rem;
}

.action-btn {
    color: #3498db;
    text-decoration: none;
    font-size: 0.85rem;
}

.action-btn:hover {
    text-decoration: underline;
}

/* Answer Mode Badge Styles */
.mode-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.mode-badge.exam {
    background: #e3f2fd;
    color: #1976d2;
}

.mode-badge.practice {
    background: #e8f5e8;
    color: #388e3c;
}

.reports-grid, .quizzes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.report-card, .quiz-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.report-card:hover, .quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.report-header, .quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.quiz-title, .quiz-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
}

.quiz-card-title a {
    text-decoration: none;
    color: inherit;
}

.quiz-card-title a:hover {
    color: #3498db;
}

.report-date, .quiz-card-date {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.report-stats {
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
}

.stat-value {
    font-weight: 500;
}

.quiz-card-description {
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.5;
}

.quiz-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.meta-item {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.report-actions, .quiz-card-actions {
    text-align: center;
}

.view-result-btn, .start-quiz-btn {
    background: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: background 0.2s;
}

.view-result-btn:hover, .start-quiz-btn:hover {
    background: #2980b9;
    color: white;
}

.quiz-pagination {
    text-align: center;
    margin-top: 30px;
}

.pagination-btn {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #3498db;
}

.pagination-btn:hover, .pagination-btn.current {
    background: #3498db;
    color: white;
}

.no-quizzes {
    text-align: center;
    padding: 60px 20px;
}

.empty-state {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.empty-state p {
    color: #7f8c8d;
}

/* ===== QUIZ RESULT STYLES ===== */
.quiz-result-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.quiz-result-title {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0 0 10px 0;
    text-align: center;
}

.breadcrumb {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-align: left;
    margin: 10px 20px 40px 20px;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.separator {
    margin: 0 8px;
}

.result-tabs {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 1rem;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-btn:hover {
    color: #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.exam-info {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 8px 20px;
}

.info-row {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 0.9rem;
}

.info-row .label {
    min-width: 100px;
}

.label {
    font-weight: 500;
    color: #2c3e50;
}

.value {
    color: #7f8c8d;
}

/* Mobile responsive for exam-info */
@media (max-width: 768px) {
    .exam-info {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, auto);
        gap: 8px;
        padding: 12px 15px;
    }
    
    .info-row {
        padding: 2px 0;
    }
}

.score-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: white;
    padding: 40px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.score-item {
    text-align: center;
}

.score-item.main-score {
    position: relative;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 15px;
}

.score-number {
    font-size: 2.5rem;
    font-weight: bold;
}

.score-circle .score-label {
    font-size: 1rem;
    margin-top: 5px;
}

.score-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.score-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.pass-status {
    font-size: 1.1rem;
    font-weight: bold;
}

.pass-status.passed {
    color: #27ae60;
}

.pass-status.failed {
    color: #e74c3c;
}

.detailed-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-number.correct { color: #27ae60; }
.stat-number.wrong { color: #e74c3c; }
.stat-number.unanswered { color: #f39c12; }
.stat-number.total { color: #3498db; }

.question-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid #e1e5e9;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    color: #7f8c8d;
    transition: all 0.3s;
}

.filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.filter-btn:hover {
    border-color: #3498db;
}

.question-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.question-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-number {
    font-weight: bold;
    color: #2c3e50;
}

.question-status-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.question-status-badge.correct {
    background: #d4edda;
    color: #155724;
}

.question-status-badge.wrong {
    background: #f8d7da;
    color: #721c24;
}

.question-status-badge.unanswered {
    background: #fff3cd;
    color: #856404;
}

.question-content {
    padding: 20px;
}

.question-text {
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.8;
    color: #2c3e50;
    opacity: 0.85;
}

.question-image {
    margin-bottom: 20px;
    text-align: center;
}

.question-image img {
    max-width: 50%;
    max-height: 200px;
    border-radius: 5px;
}

.answer-options {
    margin-bottom: 20px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 5px;
    border: 1px solid #e1e5e9;
    position: relative;
}

.answer-option.correct-answer {
    background: #d4edda;
    border-color: #c3e6cb;
}

.answer-option.wrong-answer {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.option-letter {
    font-weight: bold;
    margin-right: 10px;
    min-width: 20px;
}

.option-text {
    flex: 1;
    font-size: 0.9rem;
    color: #2c3e50;
}

.katex-html {
    color: #2c3e50;
}
.user-choice-marker {
    margin-left: 10px;
    font-size: 0.9rem;
}

.correct-marker {
    margin-left: 10px;
    color: #27ae60;
    font-weight: bold;
}

.question-explanation {
    border-top: 1px solid #e1e5e9;
    padding: 20px;
}

.question-explanation h4 {
    font-size: 1rem;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.question-explanation p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
    color: #555;
}

.question-explanation .question-solution-title {
    border-bottom: 2px solid currentColor;
    padding-bottom: 2px;
    margin-bottom: 4px;
    display: inline-block;
}

.result-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e1e5e9;
}

.back-btn, .print-btn {
    display: inline-block;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.back-btn {
    background: #3498db;
    color: white;
}

.back-btn:hover {
    background: #2980b9;
    color: white;
}

.print-btn {
    background: #95a5a6;
    color: white;
}

.print-btn:hover {
    background: #7f8c8d;
}

/* ===== QUIZ SINGLE STYLES ===== */
.quiz-single-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Quiz Introduction Styles */
.quiz-intro-container {
    background: #f8f9fa;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-intro-content {
    background: white;
    padding: 60px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 600px;
    font-size: 0.8rem;
    width: 100%;
}

/* Quiz Intro Header Container */
.quiz-intro-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.quiz-notice p {margin: 0;}
.quiz-logo {
    flex-shrink: 0;
}

.quiz-intro-title {
    font-size: 1.7rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
    text-align: left;
}

.quiz-intro-description {
    color: #7f8c8d;
    margin-bottom: 40px;
    line-height: 1.6;
    font-size: 0.9rem;
    padding: 2px 10px;
}

.quiz-info-section {
    text-align: left;
    margin-bottom: 40px;
}

.quiz-info-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0 0 20px 0;
    text-align: center;
}

.quiz-info-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.quiz-info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.quiz-info-label {
    color: #7f8c8d;
    font-weight: 500;
}

.quiz-info-value {
    color: #2c3e50;
    font-weight: 600;
}

.quiz-instructions {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #2c3e50;
    line-height: 1.6;
}

/* Answer Mode Section */
.answer-mode-section {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mode-title {
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.mode-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.mode-option {
    --radio-size: 18px;
    --gap: 15px;
    
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.mode-option:hover {
    border-color: #3498db;
}

.mode-option:has(input:checked) {
    border-color: #3498db;
    background: #f0f8ff;
}

.mode-option input[type="radio"] {
    width: var(--radio-size);
    height: var(--radio-size);
    flex-shrink: 0;
    margin: 0;
}

.mode-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.mode-text {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.mode-desc {
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.3;
}

.quiz-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 5px;
    color: #856404;
}

.quiz-start-section {
    text-align: center;
}

.quiz-start-button {
    background: #3498db;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.quiz-start-button:hover {
    background: #2980b9;
}

/* Quiz Exam Interface Styles */
.quiz-exam-container {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 0;
}

.quiz-exam-form {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

/* Quiz exam header removed - content redistributed */

.quiz-exam-title {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
}


.quiz-exam-content {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    min-height: 600px;
    padding: 20px;
}

.quiz-left-sidebar {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-right-sidebar {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

/* User Info Sections */
.user-avatar-section {
    display: flex;
    justify-content: center;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name-section,
.user-account-section {
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-info-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.user-info-value {
    font-size: 1rem;
    color: #2c3e50;
}

/* Left Sidebar Sections */
.quiz-name-section {
    text-align: center;
    margin-bottom: 0;
}

.quiz-name-title {
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
}

.quiz-timer-section {
    text-align: center;
    margin-bottom: 0;
}

.quiz-timer-display {
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-timer {
    font-size: 1.6rem;
    font-weight: 600;
    color: #3498db;
    font-family: 'Courier New', monospace;
}

.quiz-timer-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 5px;
}

.quiz-count-section {
    margin-bottom: 0;
    text-align: center;
}

.quiz-count-display {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    color: #2c3e50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.quiz-nav-section {
    margin-bottom: 0;
}

.quiz-nav-title {
    font-size: 1rem;
    color: #2c3e50;
    margin: 0 0 15px 0;
    text-align: center;
}

.quiz-nav-grid-container {
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 280px;
}

.quiz-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.quiz-nav-btn {
    width: 35px;
    height: 35px;
    border: 1px solid #bdc3c7;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.quiz-nav-btn.current {
    border: 1px solid #3498db;
}


.quiz-nav-btn.answered {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.quiz-nav-btn.marked {
    position: relative;
}

.quiz-nav-btn.marked::after {
    content: "★";
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 16px;
    color: #f39c12;
    line-height: 1;
}

.quiz-submit-section {
    text-align: center;
}

.quiz-submit-button {
    background: #3498db;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    width: 50%;
    font-size: 1rem;
}

/* Quiz Legend */
.quiz-legend-section {
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-title {
    font-size: 0.9rem;
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.legend-items {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #2c3e50;
    flex: 1;
    justify-content: center;
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    position: relative;
}

.legend-box.answered {
    background: #3498db;
}

.legend-box.unanswered {
    background: white;
    border: 1px solid #bdc3c7;
}

.legend-box.marked {
    background: #3498db;
    position: relative;
}

.legend-box.marked::after {
    content: "★";
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 16px;
    color: #f39c12;
    line-height: 1;
}

.quiz-submit-button:hover {
    background: #3498db;
}

.quiz-submit-button.showing {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-main-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Quiz Meta in Center */
.quiz-question-meta {
    opacity: 0.9;
    margin-bottom: 10px;
    color: #2980b9;
}
.quiz-question-indicator {
    font-size: 1rem;
    color: #2980b9;
}

.quiz-questions-container {
    flex: 1;
    margin-bottom: 30px;
}

.quiz-question-step {
    display: none;
}

.quiz-question-step.active-step {
    display: block;
}

.quiz-question-content {
    padding: 4px;
    border-radius: 8px;
}

.question-title {
    font-size: 1rem;
    color: #2c3e50;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.quiz-question-image {
    margin: 20px 0;
    text-align: center;
}

.quiz-question-image img {
    max-width: 50%;
    max-height: 200px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Question Mark Button Styles */
.quiz-question-mark {
    margin: 10px 0;
    text-align: right;
}

.mark-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: white;
    border: 1px solid #bdc3c7;
    color: #7f8c8d;
    font-size: 0.6rem;
    font-weight: 500;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mark-btn:hover {
    border-color: #f39c12;
    color: #f39c12;
}

.mark-btn.marked {
    background: #f39c12;
    border-color: #f39c12;
    color: white;
}

.mark-btn.marked .star-icon {
    color: white;
}

.mark-btn .star-icon {
    font-size: 0.8rem;
    color: #f39c12;
    transition: color 0.3s ease;
    font-style: normal;
}

.mark-btn.marked .star-icon {
    color: white;
}

.quiz-answer-options {
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #2c3e50;
}

.quiz-answer-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 15px;
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    transition: all 0.2s;
}

.quiz-answer-label:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.quiz-answer-label.selected {
    border-color: #3498db;
    background: #e3f2fd;
}

.quiz-answer-input {
    margin: 6px 12px 0 0;
}

.quiz-answer-text {
    flex: 1;
    line-height: 1.5;
}

.quiz-text-answer {
    margin-top: 20px;
}

.quiz-text-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.quiz-text-input:focus {
    outline: none;
    border-color: #3498db;
}

.quiz-navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.quiz-nav-button {
    flex: 1;
    padding: 8px 20px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-nav-button:hover:not(:disabled) {
    background: #3498db;
    color: white;
}

.quiz-nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-next-btn {
    background: #3498db;
    color: white;
}

.quiz-next-btn:hover {
    background: #2980b9;
}


.quiz-nav-button.showing {
    background: #95a5a6 !important;
    border-color: #95a5a6 !important;
    color: white !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* ===== RESPONSIVE STYLES ===== */

/* Medium screens (tablets) */
@media (max-width: 992px) {
    .quiz-intro-header {
        gap: 15px;
    }
    
    .quiz-intro-title {
        font-size: 1.6rem;
    }
    
    .quiz-logo svg {
        width: 50px;
        height: 50px;
    }
}

/* Small screens (mobile) */
@media (max-width: 768px) {
    /* Quiz Home Mobile */
    .quiz-frontend-app {
        padding: 10px;
    }
    
    .quiz-center-title {
        font-size: 2rem;
    }
    
    .quiz-tab-buttons {
        flex-direction: column;
    }
    
    .quiz-tab-btn {
        flex: 1;
    }
    
    .quiz-tab-content {
        padding: 15px;
    }
    
    .quiz-section-header {
        justify-content: center;
    }
    
    .quiz-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .quiz-item-left, 
    .quiz-item-right {
        margin: 0;
    }
    
    .quiz-records-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .records-stats {
        justify-content: center;
    }
    
    .records-search {
        justify-content: center;
    }
    
    .records-search-input {
        width: 150px;
    }
    
    .quiz-records-table {
        font-size: 0.8rem;
    }
    
    .th, .td {
        padding: 8px 4px;
    }
    
    /* Hide some columns on mobile */
    .th:nth-child(4), .td:nth-child(4),
    .th:nth-child(6), .td:nth-child(6),
    .th:nth-child(8), .td:nth-child(8) {
        display: none;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .quiz-search {
        justify-content: center;
    }
    
    .search-input {
        width: 200px;
    }
    
    .reports-grid, .quizzes-grid {
        grid-template-columns: 1fr;
    }

    /* Quiz Result Mobile */
    .quiz-result-app {
        padding: 10px;
    }
    
    .quiz-result-title {
        font-size: 1.5rem;
    }
    
    .result-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 12px 20px;
    }
    
    .score-display {
        flex-direction: column;
        gap: 20px;
    }
    
    .detailed-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .question-filters {
        justify-content: center;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    /* Quiz Single Mobile */
    .quiz-single-app {
        padding: 10px;
    }
    
    .quiz-intro-content {
        padding: 40px 20px;
    }
    
    /* Mobile layout for quiz intro header */
    .quiz-intro-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .quiz-intro-title {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .quiz-logo svg {
        width: 50px;
        height: 50px;
    }
    
    .quiz-exam-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .quiz-left-sidebar {
        order: 1;
        padding: 15px;
        position: static;
        gap: 12px;
    }
    
    .quiz-main-content {
        order: 2;
        padding: 15px;
    }
    
    .quiz-right-sidebar {
        order: 3;
        padding: 15px;
        position: static;
        gap: 12px;
    }
    
    .quiz-nav-grid-container {
        min-height: 200px;
    }
    
    .quiz-name-title {
        font-size: 1rem;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
    }
    
    .quiz-nav-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 4px;
    }
    
    .quiz-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    
    .quiz-navigation-buttons {
        flex-direction: column;
    }
    
    .quiz-question-mark {
        text-align: center;
        margin: 15px 0;
    }
    
    .mark-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 8px;
    }
    
    .legend-item {
        justify-content: flex-start;
    }
}

/* ===== TOAST NOTIFICATION STYLES ===== */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.toast {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    pointer-events: auto;
    max-width: 400px;
    min-width: 300px;
    word-wrap: break-word;
    text-align: center;
}

.toast.show {
    transform: scale(1);
    opacity: 1;
}

.toast.success {
    background: #27ae60;
}

.toast.warning {
    background: #f39c12;
}

.toast.error {
    background: #e74c3c;
}

.toast.info {
    background: #3498db;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* Mobile toast adjustments */
@media (max-width: 768px) {
    .toast-container {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100vw - 40px);
        max-width: none;
    }
    
    .toast {
        max-width: none;
        min-width: auto;
        width: 100%;
        transform: scale(0.8);
    }
    
    .toast.show {
        transform: scale(1);
    }
}

/* ===== LOADING OVERLAY STYLES ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-dialog {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: all 0.3s ease;
    text-align: center;
}

.loading-overlay.show .loading-dialog {
    transform: scale(1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    font-size: 1rem;
    color: #2c3e50;
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
}

/* Mobile loading adjustments */
@media (max-width: 768px) {
    .loading-dialog {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        margin: 20px;
        padding: 30px 20px;
    }
    
    .loading-spinner {
        width: 35px;
        height: 35px;
        margin-bottom: 15px;
    }
    
    .loading-message {
        font-size: 0.9rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .result-tabs,
    .question-filters,
    .result-actions {
        display: none;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .toast-container {
        display: none;
    }
}

/* ===== CUSTOM CONFIRM DIALOG STYLES ===== */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: white;
    border-radius: 12px;
    padding: 0;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.confirm-overlay.show .confirm-dialog {
    transform: scale(1);
}

.confirm-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e1e5e9;
}

.confirm-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.confirm-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background: #f39c12;
}

.confirm-body {
    padding: 20px 24px;
}

.confirm-message {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #34495e;
}

.confirm-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.confirm-btn-cancel {
    background: #ecf0f1;
    color: #7f8c8d;
}

.confirm-btn-cancel:hover {
    background: #d5dbdb;
    color: #2c3e50;
}

.confirm-btn-confirm {
    background: #3498db;
    color: white;
}

.confirm-btn-confirm:hover {
    background: #2980b9;
}

.confirm-btn-danger {
    background: #e74c3c;
    color: white;
}

.confirm-btn-danger:hover {
    background: #c0392b;
}

/* Mobile confirm adjustments */
@media (max-width: 768px) {
    .confirm-dialog {
        min-width: 320px;
        max-width: calc(100vw - 40px);
        margin: 20px;
    }
    
    .confirm-header {
        padding: 20px 20px 16px;
    }
    
    .confirm-body {
        padding: 16px 20px;
    }
    
    .confirm-footer {
        padding: 16px 20px 20px;
        flex-direction: column-reverse;
    }
    
    .confirm-btn {
        width: 100%;
        padding: 12px;
    }
}

/* ===== SECONDARY LANGUAGE STYLING ===== */

/* Secondary Language Styling */
.secondary-lang {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
    line-height: 1.8;
    opacity: 0.85;
}

/* Dark mode support for secondary language */
@media (prefers-color-scheme: dark) {
    .secondary-lang {
        color: #aaa;
        border-left-color: #444;
    }
}

/* Secondary language in answer options */
.answer-option .secondary-lang,
.quiz-answer-text .secondary-lang {
    font-size: 0.85em;
    margin-top: 3px;
    border-left-width: 1px;
}

/* Secondary language in question text */
.question-text .secondary-lang,
.quiz-question-text .secondary-lang {
    margin-top: 8px;
}

/* Secondary language in explanation */
.question-explanation .secondary-lang {
    margin-top: 6px;
}

/* Responsive adjustments for secondary language */
@media (max-width: 768px) {
    .secondary-lang {
        font-size: 0.85em;
        margin-top: 3px;
    }
    
    .question-text .secondary-lang,
    .quiz-question-text .secondary-lang {
        margin-top: 6px;
    }
}

/* Continue Quiz Button Styling */
.quiz-start-btn.continue-quiz {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    position: relative;
}

.quiz-start-btn.continue-quiz:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
}

/* ===== QUESTION INDEX STYLES ===== */

/* Filter and Index Container - Left Right Layout */
.filter-index-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.question-filters {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    min-width: 400px;
}

.question-index-container {
    flex: 1;
    min-width: 400px;
    padding: 4px;
    transition: all 0.3s ease;
}

.filter-index-container.show-fixed {
    position: fixed;
    top: 35px;
    right: 0;
    width: 100vw;
    margin-bottom: 0;
    z-index: 100;
}

.filter-index-container.show-fixed .question-filters {
    display: none;
}

.filter-index-container.show-fixed .question-index-container {
    flex: none;
    width: 690px;
    max-width: 100%;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 2px;
    margin: 0 30px 0 auto;
}

.question-index-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.question-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 38px);
    gap: 6px;
    justify-content: start;
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px;
}

.index-btn {
    width: 38px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 11px;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: #555;
}

.index-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.index-btn.current {
    background: #007bff !important;
    color: white !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .filter-index-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .question-filters {
        min-width: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .question-index-grid {
        grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
        max-height: 120px;
    }
    
    .index-btn {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }    
}

@media (max-width: 480px) {
    .question-index-grid {
        grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
        gap: 4px;
    }
    
    .index-btn {
        width: 28px;
        height: 28px;
        font-size: 9px;
    }
    
}
