:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

* {
    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: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.language-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.lang-button {
    border: none;
    background: transparent;
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.lang-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.lang-button.active {
    background: white;
    color: #764ba2;
    box-shadow: var(--shadow);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    text-align: center;
}

main {
    padding: 40px;
}

section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Upload Section */
.drop-zone {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--background);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    transform: translateY(-2px);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.drop-zone h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.file-button {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.file-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.supported-formats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Status Section */
.status-section {
    background: var(--background);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-message.success {
    color: var(--success-color);
}

.status-message.error {
    color: var(--error-color);
}

.status-message.warning {
    color: var(--warning-color);
}

.info-section {
    display: flex;
    gap: 16px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid rgba(118, 75, 162, 0.2);
    padding: 20px 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.info-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.info-content h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.info-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.ai-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #b76e00;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 8px;
}

.info-content .limitations-list {
    margin-top: 12px;
    padding-left: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Files Section */
.files-list {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.file-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.file-status.processing {
    color: var(--warning-color);
}

.file-status.completed {
    color: var(--success-color);
}

.file-status.failed {
    color: var(--error-color);
}

.remove-file {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-file:hover {
    background: var(--error-color);
    color: white;
}

/* Convert Button */
.convert-button {
    width: 100%;
    padding: 16px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.convert-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.convert-button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

.button-icon {
    width: 20px;
    height: 20px;
}

/* Results Section */
.result-item {
    background: var(--background);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.result-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 10px;
}

.action-button {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.action-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.action-button.secondary {
    background: var(--text-secondary);
}

.action-button.secondary:hover {
    background: var(--text-primary);
}

.result-content {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-content::-webkit-scrollbar {
    width: 8px;
}

.result-content::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Footer */
footer {
    background: var(--background);
    padding: 30px;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

footer p {
    margin: 5px 0;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .header-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 20px;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .info-section {
        flex-direction: column;
        align-items: flex-start;
    }

    section h2 {
        font-size: 1.4rem;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .result-actions {
        width: 100%;
    }

    .action-button {
        flex: 1;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item,
.result-item {
    animation: fadeIn 0.3s ease;
}

