* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.upload-section,
.results-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.upload-section h2,
.results-section h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.5em;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.tab-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* File Upload */
.file-upload-area {
    border: 3px dashed #d0d0d0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 5px;
}

.browse-link {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
}

.file-info {
    font-size: 0.9em;
    color: #999;
}

.file-preview {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.file-name {
    flex: 1;
    text-align: left;
}

.file-size {
    color: #999;
    font-size: 0.9em;
}

.remove-file {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1em;
}

/* Text Input */
#textInput {
    width: 100%;
    min-height: 250px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
}

/* Options */
.options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.options h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #333;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.model-path {
    margin-top: 15px;
}

.model-path label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.model-path input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
}

.model-path input:focus {
    outline: none;
    border-color: #667eea;
}

/* Extract Button */
.extract-btn {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.extract-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.extract-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.hidden {
    display: none;
}

/* Results */
.results-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.empty-hint {
    font-size: 0.9em;
    color: #bbb;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.results-count {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
}

.download-btn {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #45a049;
}

.mcq-card {
    background: #f8f9ff;
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}

.mcq-card:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.mcq-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.mcq-number {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1em;
}

.mcq-type,
.mcq-math {
    padding: 4px 10px;
    background: #ffd700;
    color: #333;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

.mcq-math {
    background: #90caf9;
}

.mcq-question {
    font-size: 1.1em;
    margin-bottom: 10px;
    line-height: 1.6;
}

.mcq-translation {
    font-size: 1em;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.mcq-options {
    margin-top: 15px;
}

.option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
}

.option:hover {
    border-color: #667eea;
}

.option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #667eea;
    color: white;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.option.correct .option-letter {
    background: #4caf50;
}

.option-text {
    flex: 1;
    line-height: 1.5;
}

.correct-mark {
    color: #4caf50;
    font-size: 1.3em;
    font-weight: 600;
}

/* Scrollbar */
.results-container::-webkit-scrollbar {
    width: 8px;
}

.results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}
