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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f7fafc;
    color: #2d3748;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2b6cb0;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
}

.language-selector {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 5px;
}

.lang-btn {
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    background-color: white;
    color: #4a5568;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.lang-btn:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.lang-btn.active {
    background-color: #4299e1;
    color: white;
    border-color: #4299e1;
}

main {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-section,
.output-section {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #4299e1;
}

textarea[readonly] {
    background-color: #f7fafc;
    cursor: default;
}

.options-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f7fafc;
    border-radius: 8px;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

select,
input[type="text"],
input[type="number"] {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: white;
    transition: border-color 0.2s;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #4299e1;
}

select {
    cursor: pointer;
}

.custom-format {
    grid-column: span 2;
}

.custom-format small {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 5px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn {
    background-color: #4299e1;
    color: white;
    flex: 1;
    min-width: 150px;
}

.primary-btn:hover {
    background-color: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background-color: #e2e8f0;
    color: #4a5568;
}

.secondary-btn:hover {
    background-color: #cbd5e0;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #2d3748;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

footer {
    text-align: center;
    padding: 20px;
    color: #718096;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    main {
        padding: 20px;
    }
    
    .options-section {
        grid-template-columns: 1fr;
    }
    
    .custom-format {
        grid-column: span 1;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .secondary-btn {
        width: 100%;
    }
    
    .language-selector {
        position: static;
        margin-top: 15px;
    }
}