body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin: 20px;
    padding: 30px;
    min-height: calc(100vh - 40px);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

    .header h1 {
        background: linear-gradient(45deg, #667eea, #764ba2);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: 700;
        font-size: 2.5rem;
    }

.content-area {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

.input-section {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.output-section {
    flex: 2; /* Increased to take more space */
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.upload-section {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.page-list-section {
    flex: 0.5; /* Reduced to half size */
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f8f9fa;
}

    .section-header h3 {
        margin: 0;
        color: #495057;
        font-weight: 600;
    }

    .section-header i {
        margin-right: 10px;
        color: #667eea;
    }

.contenteditable-input, .contenteditable-corrected {
    width: 90%;
    min-height: 400px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
    overflow-y: auto;
}

    .contenteditable-input:empty::before, .contenteditable-corrected:empty::before {
        content: attr(placeholder);
        color: #6c757d;
        font-style: italic;
    }

    .contenteditable-input:focus, .contenteditable-corrected:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    }

.original-paragraph {
    width: calc(100% - 90px);
    min-height: 80px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    line-height: 1.6;
    background: #f1f1f1;
    margin-bottom: 10px;
}

.paragraph-content.editable {
    width: calc(100% - 90px);
    min-height: 80px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    line-height: 1.6;
    transition: border-color 0.3s ease;
    vertical-align: top;
}

.error-word {
    border-bottom: 2px solid red;
}

.corrected-sentence {
    border-bottom: 2px solid blue;
}

.correct-btn, .upload-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-btn {
    margin-top: 0;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

    .correct-btn:hover, .upload-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }

    .correct-btn:disabled, .upload-btn:disabled {
        background: #6c757d;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.loading-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.corrected-paragraphs {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

    .corrected-paragraphs::-webkit-scrollbar {
        width: 6px;
    }

    .corrected-paragraphs::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .corrected-paragraphs::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 10px;
    }

.paragraph-item {
    margin-bottom: 20px;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

    .paragraph-item.approved {
        border-color: #28a745;
        background: #d4edda;
    }

    .paragraph-item.pending {
        opacity: 0.6;
        border-color: #ffc107;
        background: #fff3cd;
    }

    .paragraph-item.error {
        border-color: #dc3545;
        background: #f8d7da;
    }

.paragraph-content.editable:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.paragraph-item .approve-btn {
    float: right;
    margin-left: 10px;
}

.approve-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

    .approve-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
    }

    .approve-btn.approved {
        background: #6c757d;
        cursor: default;
        transform: none;
        box-shadow: none;
    }

.final-output {
    margin-top: 20px;
    padding: 20px;
    background: #e7f3ff;
    border: 2px solid #0066cc;
    border-radius: 12px;
    min-height: 200px;
}

    .final-output h4 {
        color: #0066cc;
        margin-bottom: 15px;
        font-weight: 600;
    }

.final-text .approved-text {
    line-height: 1.8;
    font-size: 14px;
    color: #333;
}

.empty-state {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 12px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-weight: 700;
    font-size: 18px;
    color: #667eea;
    display: block;
}

.file-upload-box {
    border: 2px dashed #e9ecef;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: not-allowed;
    opacity: 0.5;
}

    .file-upload-box:hover {
        border-color: #e9ecef;
    }

    .file-upload-box i {
        color: #6c757d;
        font-size: 3rem;
    }

.page-list-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.page-list-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.5;
}

.upload-section {
    margin-top: 30px;
    padding: 20px;
}

.file-upload-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    display: none;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-loading {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@media (max-width: 768px) {
    .content-area {
        flex-direction: column;
    }

    .main-container {
        margin: 10px;
        padding: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .page-list-section, .input-section, .output-section {
        flex: 1; /* Stack vertically on mobile */
    }

    .paragraph-content.editable, .original-paragraph {
        width: 100%;
    }

    .paragraph-item .approve-btn {
        float: none;
        margin-top: 10px;
    }
}
