/**
 * Styles de base RTL (Right-to-Left)
 * Support pour la langue arabe
 */

/* Direction globale RTL */
html[dir="rtl"],
body {
    direction: rtl;
    text-align: right;
}

/* Police pour l'arabe - meilleure lisibilité */
body {
    font-family: 'Cairo', 'Tajawal', 'Arial', 'Helvetica', sans-serif;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Alignement des titres */
h1, h2, h3, h4, h5, h6 {
    text-align: right;
}

/* Alignement des paragraphes */
p, li, td, th {
    text-align: right;
}

/* Exception : Hero section doit être centré */
.hero .hero-title,
.hero .hero-subtitle,
.hero .hero-badge,
.hero-content {
    text-align: center !important;
}

/* Listes avec bullets à droite */
ul, ol {
    padding-right: 1.5rem;
    padding-left: 0;
    margin-right: 0;
    margin-left: 0;
}

/* Flexbox RTL inversions */
.flex-row {
    flex-direction: row-reverse;
}

/* Grid RTL - commence à droite */
.grid {
    direction: rtl;
}

/* Marges et padding - inversion pour RTL */
.mr-auto { margin-left: auto !important; margin-right: 0 !important; }
.ml-auto { margin-right: auto !important; margin-left: 0 !important; }
.pr-0 { padding-left: 0 !important; }
.pl-0 { padding-right: 0 !important; }

/* Inputs et formulaires */
input, textarea, select {
    text-align: right;
    direction: rtl;
}

/* Exception pour les numéros de téléphone - gardent LTR */
input[type="tel"],
.ltr-content {
    direction: ltr;
    text-align: left;
}

/* Nombres (prix, quantités) restent LTR pour lisibilité */
.price, .number, .quantity {
    direction: ltr;
    display: inline-block;
}

/* Icônes - positionnement adapté pour RTL */
.icon-right {
    margin-left: 0.5rem;
    margin-right: 0;
}

.icon-left {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Boutons avec icônes */
button .icon,
.btn .icon {
    margin-left: 0.5rem;
    margin-right: 0;
}

button .icon-left,
.btn .icon-left {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Badges et labels */
.badge, .label {
    margin-left: 0.25rem;
    margin-right: 0;
}

/* Float inversions */
.float-right { float: left !important; }
.float-left { float: right !important; }

/* Text alignment utilities */
.text-right { text-align: left !important; }
.text-left { text-align: right !important; }

/* Border radius pour éléments asymétriques */
.rounded-left {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
}

.rounded-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 0.25rem !important;
    border-bottom-left-radius: 0.25rem !important;
}

/* Transformations pour flèches et chevrons */
.arrow-right::after {
    content: "←";
}

.arrow-left::after {
    content: "→";
}

/* Scrollbar RTL (Webkit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* Animations - ajustement pour RTL */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Forms - labels alignés */
label {
    text-align: right;
    display: block;
}

/* Select dropdown */
select {
    background-position: left 0.75rem center;
    padding-right: 0.75rem;
    padding-left: 2.5rem;
}

/* Checkbox et radio */
input[type="checkbox"],
input[type="radio"] {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Tables RTL */
table {
    direction: rtl;
}

th, td {
    text-align: right;
}

/* Modal et popups */
.modal-header .close {
    margin-left: 0;
    margin-right: auto;
}

/* Breadcrumb */
.breadcrumb-item + .breadcrumb-item::before {
    content: "\\";
    padding-right: 0;
    padding-left: 0.5rem;
}

/* Progress bars */
.progress-bar {
    right: 0;
    left: auto;
}

/* Tooltips */
.tooltip {
    text-align: right;
}

/* Cards */
.card-img-left {
    border-radius: 0 0.25rem 0.25rem 0;
}

.card-img-right {
    border-radius: 0.25rem 0 0 0.25rem;
}

/* Navigation */
.nav-item {
    margin-left: 0;
    margin-right: 1rem;
}

.nav-item:last-child {
    margin-right: 0;
}

/* Dropdown menus */
.dropdown-menu {
    right: 0;
    left: auto;
    text-align: right;
}

/* Carousel controls */
.carousel-control-prev {
    right: 0;
    left: auto;
}

.carousel-control-next {
    left: 0;
    right: auto;
}

/* Pagination */
.pagination {
    padding-right: 0;
}

/* Alert close button */
.alert .close {
    left: 0;
    right: auto;
}

/* Fixed positions pour RTL */
.fixed-right {
    left: 1rem;
    right: auto;
}

.fixed-left {
    right: 1rem;
    left: auto;
}
