:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5a623;
    --background-color: #f7f9fc;
    --text-color: #333;
    --border-radius: 8px;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 24px;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}
input, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    -webkit-appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}
#result, #explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: #e7f3fe;
    border-left: 5px solid var(--primary-color);
    border-radius: var(--border-radius);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}
#result.show, #explanation.show {
    opacity: 1;
    transform: translateY(0);
}
.lang-switch {
    text-align: right;
    margin-bottom: 20px;
}
.lang-switch button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    margin-left: 5px;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}
.lang-switch button:hover {
    background-color: #e09511;
}
.input-icon {
    position: relative;
}
.input-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}
.input-icon input {
    padding-left: 35px;
}
.examples {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}
.examples h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 20px;
    }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.pulse {
    animation: pulse 0.5s;
}

/* RTL Support */
.rtl {
    direction: rtl;
    text-align: right;
}
.rtl .lang-switch {
    text-align: left;
}
.rtl .input-icon i {
    left: auto;
    right: 12px;
}
.rtl .input-icon input {
    padding-left: 12px;
    padding-right: 35px;
}
.rtl select {
    background-position: left 12px center;
    padding-right: 12px;
    padding-left: 30px;
}
.rtl #result, .rtl #explanation {
    border-left: none;
    border-right: 5px solid var(--primary-color);
}