/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
}

nav .nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: background-color 0.3s ease;
}

nav .nav-link:hover,
nav .nav-link.active {
    background-color: rgba(255,255,255,0.2);
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #dee2e6;
}

.btn.secondary:hover {
    background: #e9ecef;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn.outline {
    background: transparent;
    color: #007bff;
    border: 2px solid #007bff;
}

.btn.outline:hover {
    background: #007bff;
    color: white;
}

/* Lesson grid */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.lesson-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.lesson-card:hover {
    transform: translateY(-5px);
}

.lesson-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.lesson-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.lesson-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #888;
}

.difficulty {
    color: #ff6b6b;
}

.lesson-btn {
    width: 100%;
}

.progress-indicator {
    margin-top: 1rem;
}

.progress-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.progress-badge.completed {
    background: #28a745;
    color: white;
}

.progress-badge.in-progress {
    background: #ffc107;
    color: #212529;
}

.progress-badge.not-started {
    background: #6c757d;
    color: white;
}

/* About section */
.about-content {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.feature h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

/* Problem view */
.problem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.problem-info {
    display: flex;
    gap: 1rem;
    font-weight: 600;
    color: #667eea;
}

.problem-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

#problem-title {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#problem-text {
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

#problem-image {
    margin-bottom: 2rem;
    text-align: center;
}

#problem-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.answer-section {
    margin-bottom: 2rem;
}

.answer-section h4 {
    margin-bottom: 1rem;
    color: #333;
}

#choices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.choice {
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.choice.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

#text-input {
    margin-bottom: 1rem;
}

#text-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

#answer-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    resize: vertical;
    min-height: 150px;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

#answer-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #fafbff;
}

/* Visual hint for multi-line input */
#answer-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Input guidance styling */
.input-guidance {
    margin-bottom: 10px;
}

.input-guidance details {
    margin-bottom: 8px;
}

.input-guidance summary {
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
    user-select: none;
}

.input-guidance pre {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-top: 8px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

/* Keyboard key styling */
kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    color: #333;
    background: linear-gradient(180deg, #f9f9f9 0%, #e9e9e9 100%);
    border: 1px solid #aaa;
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15), 0 0 0 1px #fff inset;
    white-space: nowrap;
    margin: 0 2px;
}

/* Keyboard hint styling */
.input-guidance p {
    padding: 10px 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
    border-left: 4px solid #2196f3;
    border-radius: 6px;
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

#result {
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
}

#result.correct {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#result.incorrect {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

#result-message {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

#explanation {
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Problem selection styles */
.selection-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.problem-list h3 {
    margin-bottom: 1rem;
    color: #333;
}

.problem-checkboxes {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 2rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.problem-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.problem-checkbox:hover {
    background: #f0f7ff;
    border-color: #007bff;
}

.problem-checkbox input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.problem-checkbox label {
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    flex-grow: 1;
}

.selection-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.selection-actions .btn {
    min-width: 120px;
}

/* Results view */
.results-content {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.score-display {
    margin: 2rem 0;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Progress Section */
.progress-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.chapter-progress {
    margin-bottom: 3rem;
}

.chapter-progress h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.chapter-progress-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.chapter-progress-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.chapter-progress-item.completed {
    background: #d4edda;
    border-color: #28a745;
}

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

.chapter-title {
    font-weight: 600;
    color: #333;
}

.chapter-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.chapter-status.completed {
    background: #28a745;
    color: white;
}

.chapter-status.in-progress {
    background: #ffc107;
    color: #212529;
}

.chapter-status.not-started {
    background: #6c757d;
    color: white;
}

.chapter-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.chapter-stat {
    text-align: center;
}

.chapter-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.chapter-stat-label {
    font-size: 0.8rem;
    color: #666;
}

.chapter-progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.chapter-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.review-section {
    border-top: 2px solid #dee2e6;
    padding-top: 2rem;
}

.review-section h3 {
    color: #dc3545;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.wrong-answer-item {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wrong-answer-text {
    flex: 1;
    color: #721c24;
}

.wrong-answer-chapter {
    background: #dc3545;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 1rem;
}

.remove-wrong-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    transition: background 0.3s ease;
}

.remove-wrong-btn:hover {
    background: #218838;
}

/* AI and Input Method Styles */
.answer-method-selection {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.method-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.method-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: 120px;
    transition: all 0.3s ease;
}

.method-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.method-btn:hover {
    transform: translateY(-1px);
}

#photo-input, #handwriting-input {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* Expanded handwriting input area */
#handwriting-input {
    width: 100%;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
}

#handwriting-canvas {
    flex: 1;
    width: 100%;
    min-height: 60vh;
}

/* Canvas styling for maximum space utilization */
#handwriting-canvas canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    min-height: 500px;
    border: 2px solid #007bff;
    border-radius: 8px;
    cursor: crosshair;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #handwriting-input {
        min-height: 50vh;
        padding: 0.5rem;
    }

    #handwriting-canvas {
        min-height: 40vh;
    }

    #handwriting-canvas canvas {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    #handwriting-input {
        min-height: 45vh;
    }

    #handwriting-canvas canvas {
        min-height: 300px;
    }
}

#photo-preview {
    margin: 1rem 0;
    text-align: center;
}

#photo-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.handwriting-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #e8f5e8;
    border: 1px solid #28a745;
    border-radius: 8px;
}

.handwriting-result h4 {
    color: #28a745;
    margin-bottom: 0.5rem;
}

/* AI Settings */
.ai-settings {
    margin-top: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.ai-settings h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.setting-group {
    margin-bottom: 1rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

#api-key-input {
    width: 70%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 0.5rem;
    font-family: monospace;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.status-indicator {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-indicator.online {
    background: #28a745;
    color: white;
}

.status-indicator.offline {
    background: #6c757d;
    color: white;
}

.status-note {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.api-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #e8f4fd;
    border-radius: 8px;
    border: 1px solid #007bff;
}

.api-info h4 {
    color: #007bff;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.api-info ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.api-info li {
    margin-bottom: 0.3rem;
}

.api-info a {
    color: #007bff;
    text-decoration: none;
}

.api-info a:hover {
    text-decoration: underline;
}

.api-info p {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: #d63384;
    font-weight: 600;
}

/* Enhanced result display */
.ai-enhanced-result {
    background: #fff;
    color: black;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    border: 1px solid #dee2e6;
}

.ai-enhanced-result h4 {
    margin-bottom: 1rem;
    color: black;
}

.ai-score {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.ai-feedback {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.ai-hints {
    margin-top: 1rem;
}

.ai-hints ul {
    margin: 0.5rem 0 0 1rem;
}

/* Loading spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-left: 1rem;
    font-size: 1.1rem;
}

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

/* Error notification */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10000;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .lesson-grid {
        grid-template-columns: 1fr;
    }

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

    .problem-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .results-actions {
        flex-direction: column;
        align-items: center;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    main {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .lesson-card,
    .problem-content,
    .about-content,
    .results-content {
        padding: 1.5rem;
    }
}

/* Enhanced AI evaluation styles */
.ai-enhanced-result {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

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

.overall-score {
    font-size: 18px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
}

.overall-score.excellent {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.overall-score.good {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.overall-score.needs-improvement {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.detailed-scores {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.score-breakdown {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.score-item {
    display: grid;
    grid-template-columns: 1fr auto 2fr;
    align-items: center;
    gap: 10px;
}

.score-label {
    font-weight: 600;
    color: #495057;
}

.score-value {
    font-weight: bold;
    color: #007bff;
    font-size: 14px;
}

.score-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: width 0.8s ease;
}

.ai-feedback {
    margin: 20px 0;
    padding: 15px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 0 8px 8px 0;
}

.ai-strengths {
    margin: 20px 0;
    padding: 15px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 0 8px 8px 0;
}

.ai-improvements {
    margin: 20px 0;
    padding: 15px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 0 8px 8px 0;
}

.ai-hints {
    margin: 20px 0;
    padding: 15px;
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
    border-radius: 0 8px 8px 0;
}

.ai-enhanced-result h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: black;
}

.ai-enhanced-result ul {
    margin: 0;
    padding-left: 20px;
}

.ai-enhanced-result li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: black;
}

.ai-enhanced-result p {
    color: black;
}

/* Handwritten work display */
.recognized-work {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.recognized-work h5 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 16px;
}

.work-display {
    background: white;
    border-radius: 5px;
    padding: 12px;
    border: 1px solid #dee2e6;
}

.work-display pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}