* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h2 {
    color: #3498db;
    margin-bottom: 15px;
}

.conversion-rules, .text-conversion {
    margin-bottom: 30px;
}

.rule {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
}

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

.from-char, .to-char {
    width: 120px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.arrow {
    margin: 0 15px;
    color: #7f8c8d;
}

.delete-rule {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.3s;
}

.delete-rule:hover {
    background: #c0392b;
}

#add-rule {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background 0.3s;
}

#add-rule:hover {
    background: #27ae60;
}

.separator-option {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.separator-option label {
    margin-right: 10px;
    font-weight: 500;
}

#separator {
    width: 80px;
    height: 30px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.text-conversion {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

textarea, .output-display {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    resize: vertical;
}

.output-display {
    background-color: #f8f9fa;
    overflow-y: auto;
}

#convert-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#convert-btn:hover {
    background: #2980b9;
}

.rules-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#save-rules {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

#save-rules:hover {
    background: #2980b9;
}

#clear-rules {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

#clear-rules:hover {
    background: #c0392b;
}

.catalog-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

#rule-catalog {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 38px;
}

.save-ruleset {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

#ruleset-name {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 38px;
}

#save-ruleset, #load-ruleset, #delete-ruleset {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

#delete-ruleset {
    background: #e74c3c;
}

#save-ruleset:hover, #load-ruleset:hover {
    background: #2980b9;
}

#delete-ruleset:hover {
    background: #c0392b;
}

/* Highlight characters that were converted */
.converted-char {
    background-color: #fff59d;
    padding: 0 2px;
    border-radius: 2px;
}