/**
 * Fresh Math Adaptive Testing Styles
 * Matches site theme with purple/blue color scheme
 */

/* Test Selection Page */
.test-selection-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

.test-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.test-card h2 {
    color: var(--primary-purple);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-purple);
}

.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Test Interface */
.test-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
}

.test-header {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.test-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
}

.test-header p {
    margin: 0;
    opacity: 0.9;
}

.progress-bar-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-purple), var(--primary-blue));
    transition: width 0.3s ease;
    border-radius: 6px;
}

.current-rating {
    display: inline-block;
    background: var(--primary-purple);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Question Card */
.question-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 450px;
    min-width: 600px;
    display: flex;
    flex-direction: column;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.question-type {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.question-difficulty {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Multiple Choice Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-button {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.option-button:hover {
    border-color: var(--primary-purple);
    background: var(--bg-secondary);
    transform: translateX(5px);
}

.option-button.selected {
    border-color: var(--primary-purple);
    background: var(--primary-purple);
    color: white;
}

.option-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Fill in Blank */
.fill-blank-container {
    margin-bottom: 2rem;
}

.fill-blank-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
}

.fill-blank-input:focus {
    outline: none;
    border-color: var(--primary-purple);
}

/* Submit Button */
.submit-container {
    text-align: center;
    margin-top: auto;
    padding-top: 2rem;
}

.btn-submit {
    min-width: 200px;
}

/* Feedback */
#feedback-container {
    min-height: 120px;
}

.feedback-container {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-correct {
    background: #D1FAE5;
    border: 2px solid #10B981;
    color: #065F46;
}

.feedback-incorrect {
    background: #FEE2E2;
    border: 2px solid #EF4444;
    color: #991B1B;
}

.feedback-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.feedback-explanation {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid currentColor;
    opacity: 0.8;
}

/* Select All Question Type */
.select-all-option {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.checkbox-icon {
    font-size: 1.5rem;
    min-width: 30px;
    color: var(--primary-purple);
}

.select-all-option.selected .checkbox-icon {
    color: var(--primary-blue);
}

/* Matching Question Type */
.matching-container {
    margin: 2rem 0;
}

.matching-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.matching-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
}

.item-number {
    font-weight: 700;
    color: var(--primary-purple);
    font-size: 1.1rem;
}

.item-text {
    color: var(--text-primary);
    font-size: 1rem;
}

.matching-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.matching-select:focus {
    outline: none;
    border-color: var(--primary-purple);
}

/* Drag and Drop Question Type */
.drag-drop-container {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drag-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: move;
    transition: all 0.2s;
    user-select: none;
}

.drag-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-purple);
}

.drag-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.drag-handle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-text {
    color: var(--text-primary);
    font-size: 1rem;
    flex: 1;
}

/* Night Mode for New Question Types */
html.night-mode .matching-select {
    background: var(--bg-secondary);
}

html.night-mode .drag-item:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* High Contrast Mode for New Question Types */
.high-contrast-mode .select-all-option {
    border-width: 3px !important;
}

.high-contrast-mode .checkbox-icon {
    color: #FFFF00 !important;
}

.high-contrast-mode .matching-item,
.high-contrast-mode .drag-item {
    border-width: 3px !important;
}

.high-contrast-mode .matching-select {
    border-width: 3px !important;
    background: #000000 !important;
    color: #FFFFFF !important;
}

/* Responsive for New Question Types */
@media (max-width: 768px) {
    .matching-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .matching-select {
        width: 100%;
        min-width: unset;
    }

    .drag-item {
        padding: 1rem;
    }
}

/* Results Page */
.results-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
}

.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.results-header h1 {
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.rating-display {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    border-radius: 12px;
    color: white;
    margin-bottom: 2rem;
}

.rating-number {
    font-size: 5rem;
    font-weight: bold;
    margin: 0;
}

.rating-max {
    font-size: 2rem;
    opacity: 0.8;
}

.skill-level-badge {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: white;
    color: var(--primary-purple);
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

.skill-description {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-purple);
    margin: 0.5rem 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Performance Sections */
.performance-section {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.performance-section h2 {
    color: var(--primary-purple);
    margin-bottom: 1.5rem;
}

.strength-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #D1FAE5;
    border-left: 4px solid #10B981;
    border-radius: 6px;
}

.gap-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    border-radius: 6px;
}

.cluster-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cluster-percentage {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.standards-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.standards-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

/* Action Buttons */
.actions-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.actions-container .btn {
    min-width: 180px;
}

/* Email Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--primary-purple);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Test History */
.history-container {
    margin-top: 3rem;
}

.history-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.history-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.history-rating {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-purple);
}

/* Responsive Design */
@media (max-width: 768px) {
    .test-container,
    .results-container,
    .test-selection-container {
        padding: 1rem;
    }

    .question-card {
        padding: 1.5rem;
        min-width: unset;
        min-height: 350px;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .rating-number {
        font-size: 3.5rem;
    }

    .skill-level-badge {
        font-size: 1.2rem;
        padding: 0.5rem 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .actions-container {
        flex-direction: column;
    }

    .actions-container .btn {
        width: 100%;
    }
}

/* Night Mode Compatibility */
html.night-mode {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --border-color: #334155;
}

html.night-mode .feedback-correct {
    background: #064E3B;
    border-color: #10B981;
    color: #D1FAE5;
}

html.night-mode .feedback-incorrect {
    background: #7F1D1D;
    border-color: #EF4444;
    color: #FEE2E2;
}

html.night-mode .strength-item {
    background: #064E3B;
    border-left-color: #10B981;
}

html.night-mode .gap-item {
    background: #78350F;
    border-left-color: #F59E0B;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-purple);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Font Size Controls */
.font-size-controls {
    display: flex;
    gap: 0.25rem;
}

.font-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.font-btn:hover {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.test-container[data-font-size="small"] .question-text {
    font-size: 1.1rem;
}

.test-container[data-font-size="medium"] .question-text {
    font-size: 1.25rem;
}

.test-container[data-font-size="large"] .question-text {
    font-size: 1.5rem;
}

.test-container[data-font-size="xlarge"] .question-text {
    font-size: 1.75rem;
}

/* High Contrast Mode */
.high-contrast-mode {
    --bg-primary: #000000 !important;
    --bg-secondary: #1a1a1a !important;
    --text-primary: #FFFFFF !important;
    --text-secondary: #FFFF00 !important;
    --border-color: #FFFFFF !important;
    --primary-purple: #FFFF00 !important;
    --primary-blue: #00FFFF !important;
}

.high-contrast-mode .question-card,
.high-contrast-mode .test-card,
.high-contrast-mode .performance-section {
    border-width: 3px !important;
}

.high-contrast-mode .btn-primary {
    background: #FFFF00 !important;
    color: #000000 !important;
    border: 3px solid #FFFFFF !important;
}

.high-contrast-mode .option-button {
    border-width: 3px !important;
}

.high-contrast-mode .option-button.selected,
.high-contrast-mode .option-button:hover {
    background: #FFFF00 !important;
    color: #000000 !important;
    border-color: #FFFFFF !important;
}

.high-contrast-mode .feedback-correct {
    background: #004400 !important;
    border: 3px solid #00FF00 !important;
    color: #00FF00 !important;
}

.high-contrast-mode .feedback-incorrect {
    background: #440000 !important;
    border: 3px solid #FF0000 !important;
    color: #FF0000 !important;
}

/* Worksheet Recommendations */
.recommendation-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.recommendation-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-purple);
}

.recommendation-priority {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.priority-high {
    background: #FEE2E2;
    color: #991B1B;
    border: 2px solid #EF4444;
}

.priority-medium {
    background: #FEF3C7;
    color: #92400E;
    border: 2px solid #F59E0B;
}

.recommendation-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.recommendation-reason {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.recommendation-topics {
    margin-bottom: 1.5rem;
}

.recommendation-topics ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.recommendation-topics li {
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.9rem;
}

.recommendation-topics li:before {
    content: "✓ ";
    color: var(--primary-blue);
    font-weight: bold;
}

.recommendation-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.worksheet-links-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.worksheet-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.worksheet-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.worksheet-links a {
    font-size: 0.85rem;
    text-decoration: none;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Night mode for recommendations */
html.night-mode .priority-high {
    background: #7F1D1D;
    color: #FEE2E2;
}

html.night-mode .priority-medium {
    background: #78350F;
    color: #FEF3C7;
}

/* High contrast mode for recommendations */
.high-contrast-mode .recommendation-card {
    border-width: 3px !important;
}

.high-contrast-mode .priority-high {
    background: #440000 !important;
    color: #FF0000 !important;
    border-color: #FF0000 !important;
}

.high-contrast-mode .priority-medium {
    background: #443300 !important;
    color: #FFFF00 !important;
    border-color: #FFFF00 !important;
}

/* Responsive for recommendations */
@media (max-width: 768px) {
    .recommendation-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .recommendation-topics ul {
        grid-template-columns: 1fr;
    }

    .recommendation-actions {
        flex-direction: column;
    }

    .recommendation-actions .btn {
        width: 100%;
    }
}

/* Progress Chart Styles */
.progress-chart-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
}

.progress-chart {
    width: 100%;
    height: auto;
    display: block;
}

.grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 3, 3;
    opacity: 0.3;
}

.axis-label {
    fill: var(--text-secondary);
    font-size: 12px;
    font-family: system-ui, -apple-system, sans-serif;
}

.axis-title {
    fill: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: system-ui, -apple-system, sans-serif;
}

.chart-area {
    fill: url(#lineGradient);
    opacity: 0.1;
}

.chart-line {
    fill: none;
    stroke: url(#lineGradient);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point-correct {
    fill: #10B981;
    stroke: #ffffff;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.2s;
}

.chart-point-correct:hover {
    r: 7;
}

.chart-point-incorrect {
    fill: #EF4444;
    stroke: #ffffff;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.2s;
}

.chart-point-incorrect:hover {
    r: 7;
}

.legend-text {
    fill: var(--text-primary);
    font-size: 12px;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Night Mode for Chart */
html.night-mode .chart-point-correct {
    stroke: #0F172A;
}

html.night-mode .chart-point-incorrect {
    stroke: #0F172A;
}

/* High Contrast Mode for Chart */
.high-contrast-mode .grid-line {
    stroke: #FFFFFF;
    opacity: 0.5;
}

.high-contrast-mode .chart-line {
    stroke: #FFFF00;
    stroke-width: 4;
}

.high-contrast-mode .chart-area {
    fill: #FFFF00;
    opacity: 0.15;
}

.high-contrast-mode .chart-point-correct {
    fill: #00FF00;
    stroke: #FFFFFF;
    stroke-width: 3;
}

.high-contrast-mode .chart-point-incorrect {
    fill: #FF0000;
    stroke: #FFFFFF;
    stroke-width: 3;
}

/* Question Review Styles */
.review-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
}

.review-header {
    text-align: center;
    margin-bottom: 2rem;
}

.review-header h1 {
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.review-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.review-counter {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.review-question-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.review-question-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.review-time {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.review-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.review-correct {
    background: #D1FAE5;
    border: 2px solid #10B981;
    color: #065F46;
}

.review-incorrect {
    background: #FEE2E2;
    border: 2px solid #EF4444;
    color: #991B1B;
}

.review-icon {
    font-size: 1.5rem;
}

.review-question-text {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.review-cluster-info {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.review-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}

.option-label {
    font-weight: 700;
    color: var(--primary-purple);
    min-width: 25px;
}

.review-option-correct {
    background: #D1FAE5;
    border-color: #10B981;
    color: #065F46;
}

.review-option-correct-user {
    background: #D1FAE5;
    border: 3px solid #10B981;
    color: #065F46;
    font-weight: 600;
}

.review-option-incorrect-user {
    background: #FEE2E2;
    border: 3px solid #EF4444;
    color: #991B1B;
    font-weight: 600;
}

.option-badge {
    display: inline-block;
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    background: var(--primary-purple);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.option-badge-correct {
    background: #10B981;
}

.review-answer-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.review-user-answer,
.review-correct-answer {
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

.review-user-answer {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.review-user-answer.answer-correct {
    background: #D1FAE5;
    border-color: #10B981;
    color: #065F46;
}

.review-user-answer.answer-incorrect {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #991B1B;
}

.review-correct-answer {
    background: #D1FAE5;
    border: 2px solid #10B981;
    color: #065F46;
}

.review-explanation {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.review-rating-change {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.review-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Responsive for Review */
@media (max-width: 768px) {
    .review-container {
        padding: 1rem;
    }

    .review-question-card {
        padding: 1.5rem;
    }

    .review-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .review-answer-comparison {
        grid-template-columns: 1fr;
    }

    .review-question-text {
        font-size: 1.1rem;
    }
}

/* Night Mode for Review */
html.night-mode .review-correct,
html.night-mode .review-option-correct,
html.night-mode .review-option-correct-user,
html.night-mode .review-correct-answer,
html.night-mode .review-user-answer.answer-correct {
    background: #064E3B;
    border-color: #10B981;
    color: #D1FAE5;
}

html.night-mode .review-incorrect,
html.night-mode .review-option-incorrect-user,
html.night-mode .review-user-answer.answer-incorrect {
    background: #7F1D1D;
    border-color: #EF4444;
    color: #FEE2E2;
}

/* High Contrast Mode for Review */
.high-contrast-mode .review-option,
.high-contrast-mode .review-question-card {
    border-width: 3px !important;
}

.high-contrast-mode .review-option-correct,
.high-contrast-mode .review-correct-answer {
    background: #004400 !important;
    border-color: #00FF00 !important;
    color: #00FF00 !important;
}

.high-contrast-mode .review-option-correct-user {
    background: #004400 !important;
    border-color: #00FF00 !important;
    color: #00FF00 !important;
    border-width: 4px !important;
}

.high-contrast-mode .review-option-incorrect-user {
    background: #440000 !important;
    border-color: #FF0000 !important;
    color: #FF0000 !important;
    border-width: 4px !important;
}

.high-contrast-mode .review-correct {
    background: #004400 !important;
    border-color: #00FF00 !important;
    color: #00FF00 !important;
}

.high-contrast-mode .review-incorrect {
    background: #440000 !important;
    border-color: #FF0000 !important;
    color: #FF0000 !important;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus states for keyboard navigation */
.btn:focus,
.option-button:focus,
.fill-blank-input:focus,
select:focus {
    outline: 3px solid var(--primary-purple);
    outline-offset: 2px;
}
