* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cal Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fafafa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.top-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.top-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.top-nav a:hover {
    text-decoration: underline;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    min-height: 70vh;
}

.left-panel, .right-panel {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
}

.controls {
    margin-bottom: 2rem;
}

.language-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.language-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.language-group label {
    font-weight: 600;
    color: #555;
}

select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

select:focus {
    outline: none;
    border-color: #007bff;
}

.drop-zone {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 2rem;
}

.drop-zone:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.drop-zone.drag-over {
    border-color: #007bff;
    background: #f0f8ff;
}

.drop-content svg {
    color: #999;
    margin-bottom: 1rem;
}

.drop-content h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.drop-content p {
    color: #666;
}

.browse-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
}

.file-list {
    margin-bottom: 2rem;
}

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

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: #333;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.remove-file:hover {
    background: #ffe6e6;
}

.translate-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.translate-btn:hover:not(:disabled) {
    background: #0056b3;
}

.translate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.output-controls {
    display: flex;
    gap: 1rem;
}

.export-btn {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.export-btn:hover {
    background: #1e7e34;
}

.output-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    min-height: 400px;
    font-family: 'Noto Sans', sans-serif;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-y: auto;
}

.placeholder {
    text-align: center;
    color: #999;
    padding: 4rem 0;
}

.progress-bar {
    margin-top: 2rem;
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

.chunk-indicator {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
    border-left: 3px solid #007bff;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .language-selectors {
        grid-template-columns: 1fr;
    }
    
    .output-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
}