* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    transition: all 0.3s ease;
}

/* RTL Support */
body[dir="rtl"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 'Arial Unicode MS', sans-serif;
}

body[dir="rtl"] .language-selector {
    left: 0;
    right: auto;
}

body[dir="rtl"] .result-item {
    direction: rtl;
}

body[dir="rtl"] .gender-selection {
    flex-direction: row-reverse;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

.language-selector {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 100;
}

.language-selector select {
    padding: 10px 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 120px;
}

.language-selector select:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.language-selector select:focus {
    border-color: rgba(255,255,255,0.8);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

.language-selector option {
    background: #333;
    color: white;
    padding: 8px 12px;
}

header h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-top: 20px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.converter-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.tabs {
    display: flex;
    background: #f8f9fa;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.tab-button:hover:not(.active) {
    background: #e9ecef;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.converter-card h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
}

.gender-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.gender-selection label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

body[dir="rtl"] .gender-selection label {
    flex-direction: row-reverse;
}

.gender-selection input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

body[dir="rtl"] .gender-selection input[type="radio"] {
    margin-right: 0;
    margin-left: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.input-group label {
    font-weight: 600;
    color: #555;
}

.input-group select,
.input-group input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.results {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.result-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.result-label {
    font-weight: 600;
    color: #555;
}

.result-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.no-results {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2.2rem;
        margin-top: 60px;
    }
    
    .language-selector {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 1000;
    }
    
    body[dir="rtl"] .language-selector {
        left: 10px;
        right: auto;
    }
    
    .language-selector select {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .input-group {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .gender-selection {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    body[dir="rtl"] .result-item {
        align-items: flex-end;
    }
}

/* Smooth transitions for language changes */
.fade-transition {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fade-transition.show {
    opacity: 1;
}