/* RTL-Specific Styles for Arabic Language */

/* Arabic Font Support - Improved readability */
body {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', 'Helvetica Neue', sans-serif;
    line-height: 1.8; /* Increased line height for Arabic text */
}

/* Improve Arabic text rendering */
h1, h2, h3, .title, .success-title {
    line-height: 1.6;
}

p, .subtitle, .terms-text {
    line-height: 1.9;
}

/* RTL-specific shake animation */
@keyframes shake-rtl {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(10px); } /* Reversed direction */
    20%, 40%, 60%, 80% { transform: translateX(-10px); } /* Reversed direction */
}

[dir="rtl"] .shake {
    animation: shake-rtl 0.5s ease-in-out;
}

/* Ensure phone input wrapper displays correctly in RTL */
[dir="rtl"] .phone-input-wrapper {
    flex-direction: row-reverse;
}

/* Country prefix (flag + code) should remain LTR for correct number display */
[dir="rtl"] .country-prefix {
    direction: ltr;
}

/* Back button arrow positioning for RTL */
[dir="rtl"] .btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row-reverse;
}

/* Number inputs remain LTR for correct digit entry */
.phone-input,
.pin-input {
    direction: ltr;
    text-align: center;
}

/* Phone display should also remain LTR for correct number formatting */
[dir="rtl"] .phone-display {
    direction: ltr;
}

/* Improve button text alignment */
[dir="rtl"] .btn {
    text-align: center;
}

/* Terms toggle alignment */
[dir="rtl"] .terms-toggle {
    flex-direction: row-reverse;
}

/* Optimize spacing for Arabic characters */
[dir="rtl"] .input-label {
    letter-spacing: 0;
}

/* Progress indicator - maintain number order but flip layout */
[dir="rtl"] .progress-indicator {
    flex-direction: row-reverse;
}

/* Ensure gift icon animation works in RTL */
[dir="rtl"] .gift-icon {
    direction: ltr;
}

/* Pin input letter spacing adjustment for better visual */
[dir="rtl"] .pin-input {
    letter-spacing: 8px; /* Slightly reduced for better Arabic context */
}

/* Improve focus states */
[dir="rtl"] .phone-input:focus,
[dir="rtl"] .pin-input:focus {
    outline: none;
}

/* Mobile optimization for RTL */
@media (max-width: 480px) {
    [dir="rtl"] body {
        line-height: 1.7;
    }

    [dir="rtl"] .title {
        line-height: 1.4;
    }
}
