* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.header .subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8fafc;
}

.button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.button-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.language-option:hover {
    border-color: #667eea;
    background: #f8fafc;
}

.language-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.lang-code {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    background: #e2e8f0;
    border-radius: 0.25rem;
    font-family: monospace;
}

.language-option.selected .lang-code {
    background: rgba(255,255,255,0.3);
}

.output {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #e2e8f0;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-item {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-language {
    font-weight: bold;
    font-size: 1.1rem;
}

.result-text {
    line-height: 1.5;
    white-space: pre-wrap;
}

.footer {
    text-align: center;
    color: white;
    padding: 2rem;
    opacity: 0.8;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    .card {
        padding: 1rem;
    }
    
    .language-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
}