/* ========================================
RTL Fixes for Dark Modern Theme
======================================== */

[dir="rtl"] {
    text-align: right;
}

/* Navbar RTL */
[dir="rtl"] .navbar-nav {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .navbar-light .navbar-nav .nav-link {
    margin-right: 0;
    margin-left: 30px;
}

[dir="rtl"] .navbar-light .navbar-nav .nav-link::before {
    left: auto;
    right: 0;
}

/* Bootstrap overrides RTL */
[dir="rtl"] .me-3 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

[dir="rtl"] .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .me-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .ms-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

/* Dropdown RTL */
[dir="rtl"] .dropdown-menu {
    text-align: right;
}

[dir="rtl"] .dropdown-menu .dropdown-item {
    text-align: right;
}

[dir="rtl"] .dropdown-menu .dropdown-item:hover {
    padding-left: 15px;
    padding-right: 20px;
}

/* Carousel RTL */
[dir="rtl"] .carousel-item .text-start {
    text-align: right !important;
}

[dir="rtl"] .header-carousel .owl-nav {
    right: auto;
    left: 8%;
}

[dir="rtl"] .header-carousel .owl-nav .owl-prev,
[dir="rtl"] .header-carousel .owl-nav .owl-next {
    transform: scaleX(-1);
}

/* Section Title RTL */
[dir="rtl"] .section-title.bg-white.text-start {
    text-align: right !important;
}

[dir="rtl"] .section-title::before {
    left: auto;
    right: -40px;
}

[dir="rtl"] .section-title::after {
    left: auto;
    right: -60px;
}

[dir="rtl"] .section-title.text-start::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .section-title.text-start::after {
    left: auto;
    right: 0;
}

/* Hero Section RTL */
[dir="rtl"] .hero-content {
    text-align: right;
}

[dir="rtl"] .hero-title {
    text-align: right;
}

[dir="rtl"] .hero-subtitle {
    text-align: right;
}

[dir="rtl"] .d-flex.flex-wrap.gap-3.flex-row-reverse {
    flex-direction: row !important;
    justify-content: flex-start !important;
}

/* Stats Section RTL */
[dir="rtl"] .stat-card {
    text-align: center;
}

/* Service Cards RTL */
[dir="rtl"] .custom-service-card {
    text-align: right;
}

[dir="rtl"] .card-time {
    justify-content: flex-end;
}

[dir="rtl"] .card-time i {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .card-time.rtl {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

/* Announcement Cards RTL */
[dir="rtl"] .announcement-card {
    text-align: right;
}

[dir="rtl"] .announcement-card .text-muted {
    text-align: right;
}

[dir="rtl"] .announcement-card .btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* About Section RTL */
[dir="rtl"] .about-section .d-flex.align-items-center {
    flex-direction: row-reverse;
}

[dir="rtl"] .about-section .d-flex.align-items-center div[style*="margin-right"] {
    margin-right: 0 !important;
    margin-left: 15px !important;
}

/* CTA Section RTL */
[dir="rtl"] .cta-card {
    text-align: center;
}

/* Team Section RTL */
[dir="rtl"] .team-item {
    text-align: center;
}

/* Testimonial RTL */
[dir="rtl"] .testimonial-item {
    text-align: center;
}

/* Footer RTL */
[dir="rtl"] .footer .btn.btn-social {
    margin-right: 0;
    margin-left: 5px;
}

[dir="rtl"] .footer .btn.btn-link {
    text-align: right;
}

[dir="rtl"] .footer .btn.btn-link::before {
    margin-right: 0;
    margin-left: 10px;
    transform: scaleX(-1);
}

[dir="rtl"] .footer .footer-menu a {
    margin-right: 0;
    margin-left: 15px;
    padding-right: 0;
    padding-left: 15px;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, .1);
}

[dir="rtl"] .footer .footer-menu a:last-child {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

/* Buttons RTL */
[dir="rtl"] .btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .btn-primary i,
[dir="rtl"] .carousel-btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Back to top RTL */
[dir="rtl"] .back-to-top {
    right: auto;
    left: 45px;
}

/* Modal RTL */
[dir="rtl"] .modal-header .btn-close {
    margin-left: 0;
    margin-right: auto;
}

/* Badges RTL */
[dir="rtl"] .badge i {
    margin-left: 0.25rem;
    margin-right: 0;
}

/* Flex utilities RTL */
[dir="rtl"] .flex-row-reverse {
    flex-direction: row !important;
}

[dir="rtl"] .justify-content-end {
    justify-content: flex-start !important;
}

[dir="rtl"] .justify-content-start {
    justify-content: flex-end !important;
}

/* Responsive RTL */
@media (max-width: 991.98px) {
    [dir="rtl"] .navbar-light .navbar-nav .nav-link {
        margin-left: 0;
        text-align: right;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .hero-content {
        text-align: right;
    }
    
    [dir="rtl"] .hero-title,
    [dir="rtl"] .hero-subtitle {
        text-align: right;
    }
}

/* Animation fixes for RTL */
[dir="rtl"] .animated.slideInDown {
    animation-name: slideInDownRTL;
}

[dir="rtl"] .animated.slideInLeft {
    animation-name: slideInRight;
}

[dir="rtl"] .animated.slideInRight {
    animation-name: slideInLeft;
}

@keyframes slideInDownRTL {
    from {
        transform: translate3d(0, -100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

/* Owl Carousel RTL */
[dir="rtl"] .owl-carousel {
    direction: ltr;
}

[dir="rtl"] .owl-carousel .owl-item {
    direction: rtl;
}

/* Scrollbar RTL */
[dir="rtl"] ::-webkit-scrollbar {
    direction: rtl;
}

/* Print RTL */
@media print {
    [dir="rtl"] body {
        direction: rtl;
        text-align: right;
    }
}


/* ========================================
RTL Fixes for Dark Modern Theme + Typography
======================================== */

[dir="rtl"] {
    text-align: right;
    font-family: 'Tajawal', sans-serif;
}

/* تحسين قراءة النص العربي */
[dir="rtl"] body {
    line-height: 1.9;
}

/* Navbar RTL */
[dir="rtl"] .navbar-nav {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .navbar-light .navbar-nav .nav-link {
    margin-right: 0;
    margin-left: 30px;
    letter-spacing: 0 !important;
    font-weight: 600;
}

[dir="rtl"] .navbar-light .navbar-nav .nav-link::before {
    left: auto;
    right: 0;
}

/* Bootstrap overrides RTL */
[dir="rtl"] .me-3 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

[dir="rtl"] .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .me-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .ms-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

/* Dropdown RTL */
[dir="rtl"] .dropdown-menu {
    text-align: right;
}

[dir="rtl"] .dropdown-menu .dropdown-item {
    text-align: right;
}

[dir="rtl"] .dropdown-menu .dropdown-item:hover {
    padding-left: 15px;
    padding-right: 20px;
}

/* Carousel RTL */
[dir="rtl"] .carousel-item .text-start {
    text-align: right !important;
}

[dir="rtl"] .header-carousel .owl-nav {
    right: auto;
    left: 8%;
}

[dir="rtl"] .header-carousel .owl-nav .owl-prev,
[dir="rtl"] .header-carousel .owl-nav .owl-next {
    transform: scaleX(-1);
}

/* Section Title RTL */
[dir="rtl"] .section-title.bg-white.text-start {
    text-align: right !important;
}

[dir="rtl"] .section-title {
    letter-spacing: 0.05em !important;
}

[dir="rtl"] .section-title::before {
    left: auto;
    right: -40px;
}

[dir="rtl"] .section-title::after {
    left: auto;
    right: -60px;
}

[dir="rtl"] .section-title.text-start::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .section-title.text-start::after {
    left: auto;
    right: 0;
}

/* Hero Section RTL */
[dir="rtl"] .hero-content {
    text-align: right;
}

[dir="rtl"] .hero-title {
    text-align: right;
    font-weight: 900;
    line-height: 1.3;
}

[dir="rtl"] .hero-subtitle {
    text-align: right;
    font-weight: 500;
    line-height: 1.9;
}

[dir="rtl"] .d-flex.flex-wrap.gap-3.flex-row-reverse {
    flex-direction: row !important;
    justify-content: flex-start !important;
}

/* Stats Section RTL */
[dir="rtl"] .stat-card {
    text-align: center;
}

[dir="rtl"] .stat-label {
    letter-spacing: 0.03em !important;
}

/* Service Cards RTL */
[dir="rtl"] .custom-service-card {
    text-align: right;
}

[dir="rtl"] .card-time {
    justify-content: flex-end;
}

[dir="rtl"] .card-time i {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .card-time.rtl {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .card-description {
    font-weight: 500;
    line-height: 1.9;
}

/* Announcement Cards RTL */
[dir="rtl"] .announcement-card {
    text-align: right;
}

[dir="rtl"] .announcement-card .text-muted {
    text-align: right;
}

[dir="rtl"] .announcement-card .btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .announcement-card .badge {
    letter-spacing: 0 !important;
}

/* About Section RTL */
[dir="rtl"] .about-section .d-flex.align-items-center {
    flex-direction: row-reverse;
}

[dir="rtl"] .about-section .d-flex.align-items-center div[style*="margin-right"] {
    margin-right: 0 !important;
    margin-left: 15px !important;
}

/* CTA Section RTL */
[dir="rtl"] .cta-card {
    text-align: center;
}

[dir="rtl"] .cta-card p {
    font-weight: 500;
    line-height: 1.9;
}

/* Team Section RTL */
[dir="rtl"] .team-item {
    text-align: center;
}

/* Testimonial RTL */
[dir="rtl"] .testimonial-item {
    text-align: center;
}

/* Footer RTL */
[dir="rtl"] .footer .btn.btn-social {
    margin-right: 0;
    margin-left: 5px;
}

[dir="rtl"] .footer .btn.btn-link {
    text-align: right;
}

[dir="rtl"] .footer .btn.btn-link::before {
    margin-right: 0;
    margin-left: 10px;
    transform: scaleX(-1);
}

[dir="rtl"] .footer .footer-menu a {
    margin-right: 0;
    margin-left: 15px;
    padding-right: 0;
    padding-left: 15px;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, .1);
}

[dir="rtl"] .footer .footer-menu a:last-child {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

/* Buttons RTL */
[dir="rtl"] .btn {
    letter-spacing: 0 !important;
}

[dir="rtl"] .btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .btn-primary i,
[dir="rtl"] .carousel-btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Back to top RTL */
[dir="rtl"] .back-to-top {
    right: auto;
    left: 45px;
}

/* Modal RTL */
[dir="rtl"] .modal-header .btn-close {
    margin-left: 0;
    margin-right: auto;
}

/* Badges RTL */
[dir="rtl"] .badge {
    letter-spacing: 0 !important;
}

[dir="rtl"] .badge i {
    margin-left: 0.25rem;
    margin-right: 0;
}

/* Flex utilities RTL */
[dir="rtl"] .flex-row-reverse {
    flex-direction: row !important;
}

[dir="rtl"] .justify-content-end {
    justify-content: flex-start !important;
}

[dir="rtl"] .justify-content-start {
    justify-content: flex-end !important;
}

/* Responsive RTL */
@media (max-width: 991.98px) {
    [dir="rtl"] .navbar-light .navbar-nav .nav-link {
        margin-left: 0;
        text-align: right;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .hero-content {
        text-align: right;
    }
    
    [dir="rtl"] .hero-title,
    [dir="rtl"] .hero-subtitle {
        text-align: right;
    }
}

/* Animation fixes for RTL */
[dir="rtl"] .animated.slideInDown {
    animation-name: slideInDownRTL;
}

[dir="rtl"] .animated.slideInLeft {
    animation-name: slideInRight;
}

[dir="rtl"] .animated.slideInRight {
    animation-name: slideInLeft;
}

@keyframes slideInDownRTL {
    from {
        transform: translate3d(0, -100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

/* Owl Carousel RTL */
[dir="rtl"] .owl-carousel {
    direction: ltr;
}

[dir="rtl"] .owl-carousel .owl-item {
    direction: rtl;
}

/* Scrollbar RTL */
[dir="rtl"] ::-webkit-scrollbar {
    direction: rtl;
}

/* Print RTL */
@media print {
    [dir="rtl"] body {
        direction: rtl;
        text-align: right;
    }
}

/* تحسينات الخط العربي الإضافية */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 800;
    letter-spacing: 0 !important;
    line-height: 1.4;
}

[dir="rtl"] p {
    font-family: 'Tajawal', sans-serif;
    line-height: 1.9;
    font-weight: 500;
}

[dir="rtl"] a {
    font-family: 'Tajawal', sans-serif;
}

[dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] select {
    font-family: 'Tajawal', sans-serif;
}

/* ========================================
   تحسينات الخطوط والتباعد للغتين
   ======================================== */

/* ===== تحسين النصوص في اللغة العربية ===== */
[dir="rtl"] body,
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] li,
[dir="rtl"] .card-description,
[dir="rtl"] .hero-subtitle,
[dir="rtl"] .stat-label,
[dir="rtl"] .footer p,
[dir="rtl"] .footer span,
[dir="rtl"] .testimonial-text p {
    font-family: 'Cairo', 'Tajawal', 'Nunito', sans-serif;
    letter-spacing: 0.3px;
    font-weight: 500;
    line-height: 1.9;
}

/* ===== تحسين العناوين في اللغة العربية ===== */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] .hero-title,
[dir="rtl"] .section-title {
    font-family: 'Cairo', 'Tajawal', 'Nunito', sans-serif;
    font-weight: 800;
    letter-spacing: 0 !important;
    line-height: 1.4;
}

/* ===== تحسين النصوص في اللغة الإنجليزية ===== */
[dir="ltr"] body,
[dir="ltr"] p,
[dir="ltr"] span,
[dir="ltr"] li,
[dir="ltr"] .card-description,
[dir="ltr"] .hero-subtitle,
[dir="ltr"] .stat-label,
[dir="ltr"] .footer p,
[dir="ltr"] .footer span,
[dir="ltr"] .testimonial-text p {
    font-family: 'Nunito', 'Cairo', 'Tajawal', sans-serif;
    letter-spacing: 0.2px;
    font-weight: 400;
    line-height: 1.8;
}

/* ===== تحسين العناوين في اللغة الإنجليزية ===== */
[dir="ltr"] h1, [dir="ltr"] h2, [dir="ltr"] h3,
[dir="ltr"] h4, [dir="ltr"] h5, [dir="ltr"] h6,
[dir="ltr"] .hero-title,
[dir="ltr"] .section-title {
    font-family: 'Nunito', 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* ===== تنسيق نصوص الأيقونات ===== */
.fa, .fas, .far, .fal, .fab, .bi {
    color: inherit;
}

/* ===== تحسين وضوح النصوص في الخلفيات الداكنة ===== */
[dir="rtl"] .text-muted,
[dir="rtl"] .card-description,
[dir="rtl"] .card-time {
    color: var(--text-muted) !important;
    font-weight: 500;
}

[dir="ltr"] .text-muted,
[dir="ltr"] .card-description,
[dir="ltr"] .card-time {
    color: var(--text-muted) !important;
    font-weight: 400;
}

/* ===== تحسين الأزرار في RTL ===== */
[dir="rtl"] .btn {
    font-family: 'Cairo', 'Nunito', sans-serif;
    letter-spacing: 0 !important;
    font-weight: 600;
}

[dir="ltr"] .btn {
    font-family: 'Nunito', 'Cairo', sans-serif;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ===== تحسين النماذج في RTL ===== */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select,
[dir="rtl"] .form-control,
[dir="rtl"] .form-floating label {
    font-family: 'Cairo', 'Nunito', sans-serif;
    letter-spacing: 0.3px;
}

[dir="ltr"] input,
[dir="ltr"] textarea,
[dir="ltr"] select,
[dir="ltr"] .form-control,
[dir="ltr"] .form-floating label {
    font-family: 'Nunito', 'Cairo', sans-serif;
    letter-spacing: 0.2px;
}

/* ===== تحسين نصوص القوائم ===== */
[dir="rtl"] .dropdown-menu .dropdown-item {
    font-family: 'Cairo', 'Nunito', sans-serif;
    letter-spacing: 0 !important;
}

[dir="ltr"] .dropdown-menu .dropdown-item {
    font-family: 'Nunito', 'Cairo', sans-serif;
    letter-spacing: 0.3px;
}

/* ===== تحسين نصوص التنقل (Navbar) ===== */
[dir="rtl"] .navbar-nav .nav-link {
    font-family: 'Cairo', 'Nunito', sans-serif;
    letter-spacing: 0 !important;
    font-weight: 600;
}

[dir="ltr"] .navbar-nav .nav-link {
    font-family: 'Nunito', 'Cairo', sans-serif;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ========================================
   تحسينات RTL للكاردات المضغوطة
   ======================================== */

[dir="rtl"] .custom-service-card .card-time {
    justify-content: flex-end;
}

[dir="rtl"] .custom-service-card .card-time i {
    margin-left: 0.3rem;
    margin-right: 0;
}

[dir="rtl"] .custom-service-card .card-bottom-section a.card-link-btn {
    letter-spacing: 0 !important;
}

[dir="rtl"] .announcement-card .btn i {
    margin-left: 0.3rem;
    margin-right: 0;
}

[dir="rtl"] .team-item .btn i {
    margin-left: 0.3rem;
    margin-right: 0;
}

/* تحسين النصوص العربية المضغوطة */
[dir="rtl"] .custom-service-card .card-description {
    font-size: 0.78rem !important;
    line-height: 1.6 !important;
}

[dir="rtl"] .custom-service-card .card-top-section h5 {
    font-size: 0.9rem !important;
}

[dir="rtl"] .announcement-card h5 {
    font-size: 0.9rem !important;
}

[dir="rtl"] .team-item h5 {
    font-size: 0.9rem !important;
}

/* تحسين المسافات للعربية */
[dir="rtl"] .custom-service-card .card-bottom-section {
    padding: 0.8rem 0.8rem !important;
}

[dir="rtl"] .custom-service-card .card-top-section {
    padding: 1rem 0.5rem !important;
}

[dir="rtl"] .announcement-card .p-4 {
    padding: 0.8rem !important;
}

/* تحسين RTL للشاشات الصغيرة */
@media (max-width: 767px) {
    [dir="rtl"] .custom-service-card .card-top-section h5 {
        font-size: 0.75rem !important;
    }
    
    [dir="rtl"] .custom-service-card .card-description {
        font-size: 0.7rem !important;
    }
}

