/* Smooth RTL/LTR Transitions */

/* HTML and Body transitions */
html {
    transition: direction 0.3s ease;
}

body {
    transition: all 0.3s ease;
}

/* Text content transitions */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
li,
label,
button,
input,
textarea,
select {
    transition: all 0.3s ease;
}

/* Translatable elements */
[data-translate],
[data-translate-placeholder] {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Language-specific images */
img[data-img-fr],
img[data-img-en],
img[data-img-ar] {
    transition: opacity 0.3s ease;
}

/* Layout containers */
.w-container,
.base-container,
.container-default,
.container-small,
.container-medium,
.container-large {
    transition: all 0.3s ease;
}

/* Navigation elements */
.nav-menu,
.nav-link,
.navbar,
.footer-wrapper,
.footer-bottom {
    transition: all 0.3s ease;
}

/* Grid and flex layouts */
.w-layout-grid,
.w-layout-blockcontainer,
[class*="grid"],
[class*="flex"] {
    transition: all 0.3s ease;
}

/* Text alignment transitions */
.text-align-left,
.text-align-right,
.text-align-center {
    transition: text-align 0.3s ease;
}

/* Flexbox direction transitions */
.flex-horizontal,
.flex-vertical {
    transition: flex-direction 0.3s ease;
}

/* Padding and margin transitions for RTL adjustments */
* {
    transition-property: padding-left, padding-right, margin-left, margin-right, text-align, direction;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Language switching loader */
.language-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.language-loader.active {
    opacity: 1;
    pointer-events: all;
}

.language-loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transition when changing languages */
body.translating {
    opacity: 0.7;
    pointer-events: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}