/*
 * Standalone Stylesheet for Test Pages
 * This file uses hardcoded colors and is independent of theme.css.
 */

/* --- Base & Typography --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa; /* --light-color */
    color: #212529; /* --text-color */
    line-height: 1.6;
    margin: 0;
    padding: 1rem;
}

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}
.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 2.5rem;
    border: 1px solid #dee2e6; /* --border-color */
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}
.modal.active .modal-content {
    transform: scale(1);
}
.modal-content h2 {
    margin-top: 0;
    color: #007bff; /* --primary-color */
    font-size: 1.8rem;
}
.modal-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 2rem;
    text-align: left;
}
.modal-content li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}
.modal-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745; /* --success-color */
    font-weight: bold;
}
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* --- General Quiz Layout --- */
#quiz-section {
    display: none; /* Hidden until quiz starts */
}
#quiz-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
#question-area {
    flex-grow: 1;
    min-width: 0;
}
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
}
#timer {
    font-size: 1.1rem;
    font-weight: 500;
    background-color: #e6f2ff; /* --light-primary */
    color: #007bff; /* --primary-color */
    padding: 0.5rem 1rem;
    border-radius: 20px;
}


/* --- Question Palette (Sidebar) --- */
#question-palette-container {
    flex-shrink: 0;
    background-color: #ffffff; /* --card-bg */
    border: 1px solid #dee2e6; /* --border-color */
    border-radius: 10px; /* --border-radius */
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* --card-shadow */
}
.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}
.palette-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #212529; /* --text-color */
}
#question-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.75rem;
}
.palette-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}
/* Palette States */
.palette-item.unvisited {
    background-color: #f8f9fa; /* --input-bg */
    border-color: #dee2e6; /* --border-color */
    color: #6c757d; /* --secondary-color */
}
.palette-item.unvisited:hover {
    border-color: #007bff; /* --primary-color */
    color: #007bff;
}
.palette-item.answered {
    background-color: #007bff; /* --primary-color */
    color: #ffffff;
    border-color: #007bff;
}
.palette-item.skipped {
    background-color: transparent;
    border-color: #dc3545; /* --danger-color */
    color: #dc3545;
}
.palette-item.current {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    transform: scale(1.1);
}

/* --- Question Block & Options --- */
.question-block {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #ffffff; /* --card-bg */
    border: 1px solid #dee2e6; /* --border-color */
    border-radius: 10px; /* --border-radius */
}
.question {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    color: #343a40; /* --dark-color */
}
.options label {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.options label:hover {
    background-color: #e6f2ff; /* --light-primary */
    border-color: #007bff;
}
.options input[type="radio"] {
    margin-right: 12px;
    flex-shrink: 0;
    width: 1.2em;
    height: 1.2em;
}
.options input[type="radio"]:checked + span {
    font-weight: bold;
    color: #007bff;
}

/* --- Navigation & Action Buttons --- */
#question-navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}
.start-btn, .submit-btn, .retry-btn, .review-btn, .skip-btn, .next-btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.start-btn, .next-btn, .submit-btn, #main-submit-btn {
    background-color: #007bff; /* --primary-color */
    color: #ffffff;
}
.start-btn:hover, .next-btn:hover, .submit-btn:hover, #main-submit-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.review-btn, .retry-btn {
    background-color: #6c757d; /* --secondary-color */
    color: #ffffff;
}
.review-btn:hover, .retry-btn:hover {
    background-color: #5a6268;
}
.skip-btn {
    background-color: transparent;
    border-color: #dee2e6;
    color: #6c757d;
}
.skip-btn:hover {
    background-color: #f8f9fa; /* --light-color */
    border-color: #6c757d;
}
#main-submit-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* --- Review Styles --- */
#review-questions { display: none; }
.review .options label { cursor: default; }
.review .options label:hover { background-color: transparent; }
.review .options label.correct-option {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}
.review .options label.incorrect-option {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
.review .options label.incorrect-option span {
    text-decoration: line-through;
}
#review-questions .explanation {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa; /* --light-color */
    border-radius: 8px;
    border-left: 4px solid #007bff; /* --primary-color */
    text-align: left;
}

/* --- Responsive Design --- */
@media (min-width: 768px) {
    #quiz-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    #question-palette-container {
        width: 280px;
        position: sticky;
        top: 80px; /* Header height + margin */
    }
    #question-palette {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }
}
