/* RTL Styles for Arabic Language */

/* Arabic Font Import */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

/* Apply Arabic font when RTL is active */
body.rtl {
    font-family: 'Cairo', 'Poppins', sans-serif;
}

/* Navbar RTL Adjustments */
body.rtl .navbar-brand {
    margin-right: 0;
    margin-left: auto;
}

body.rtl .navbar-brand .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

body.rtl .navbar-nav {
    margin-left: 0;
    margin-right: auto;
}

body.rtl .navbar-nav .nav-link {
    margin: 0 0.5rem;
}

body.rtl .navbar-toggler {
    margin-left: 0;
}

/* Language Switcher Positioning */
body.rtl #languageSwitcher {
    margin-right: auto;
    margin-left: 0;
}

/* Hero Section RTL */
body.rtl .hero-content {
    text-align: right;
}

body.rtl .cta-button i {
    margin-left: 0;
    margin-right: 10px;
    transform: rotate(180deg);
}

body.rtl .cta-button:hover i {
    transform: translateX(-5px) rotate(180deg);
}

/* Service Cards RTL - Keep centered */
body.rtl .service-card {
    text-align: center;
}

/* Footer RTL */
body.rtl footer {
    text-align: right;
}

body.rtl .footer-brand {
    direction: rtl;
}

body.rtl .footer-brand i {
    margin-right: 0;
    margin-left: 0.5rem;
}

body.rtl .footer-links {
    text-align: right;
}

body.rtl .footer-links i {
    margin-right: 0;
    margin-left: 0.5rem;
}

body.rtl .social-links {
    justify-content: flex-start;
}

/* ============================================
   STATS SECTION RTL - FIXED
   ============================================ */
body.rtl .stats-section {
    direction: rtl;
}

body.rtl .stats-section .row {
    direction: rtl;
}

body.rtl .stats-section .col-lg-3,
body.rtl .stats-section .col-md-6 {
    text-align: center;
}

body.rtl .stat-item {
    text-align: center;
    direction: rtl;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.rtl .stat-number {
    font-family: 'Poppins', sans-serif; /* Keep English numbers */
    direction: ltr;
    display: block;
    text-align: center;
    width: 100%;
}

body.rtl .stat-label {
    direction: rtl;
    text-align: center;
    width: 100%;
}

/* Section Titles RTL */
body.rtl .section-title {
    text-align: center;
}

body.rtl .section-title h2,
body.rtl .section-title p {
    text-align: center;
}

/* Bootstrap RTL Overrides */
body.rtl .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

body.rtl .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

body.rtl .text-end {
    text-align: right !important;
}

body.rtl .text-start {
    text-align: left !important;
}

/* Responsive RTL Adjustments */
@media (max-width: 991px) {
    body.rtl .navbar-collapse {
        text-align: right;
    }

    body.rtl .navbar-nav {
        align-items: flex-end;
    }
}

/* Icon Flipping for RTL */
body.rtl .fa-arrow-right {
    transform: rotate(180deg);
}

body.rtl .fa-arrow-left {
    transform: rotate(180deg);
}

/* Language Switcher Button Styles */
#languageSwitcher {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

#languageSwitcher:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-2px);
}

#languageSwitcher i {
    font-size: 1.1rem;
}

/* Smooth transitions for language switch */
body {
    transition: direction 0.3s ease;
}

[data-i18n], [data-i18n-html] {
    transition: opacity 0.2s ease;
}

/* Arabic Text Improvements */
body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl h5,
body.rtl h6 {
    font-weight: 700;
}

body.rtl p {
    line-height: 1.8;
}

/* Ensure proper text alignment */
body.rtl .text-center {
    text-align: center !important;
}

/* Products/Services Preview RTL */
body.rtl .services-preview {
    direction: rtl;
}

body.rtl .services-preview .row {
    direction: rtl;
}

/* Keep cards centered in RTL */
body.rtl .services-preview .service-card {
    text-align: center;
}

body.rtl .services-preview .service-icon {
    margin: 0 auto 1.5rem auto;
}

body.rtl .services-preview h4,
body.rtl .services-preview p {
    text-align: center;
}

/* ============================================
   ABOUT PAGE RTL STYLES
   ============================================ */

/* Page Header RTL */
body.rtl .page-header {
    direction: rtl;
}

body.rtl .page-header h1,
body.rtl .page-header p {
    text-align: center;
}

/* About Section RTL */
body.rtl .about-section {
    direction: rtl;
}

body.rtl .about-section .row {
    direction: rtl;
}

body.rtl .about-section h2,
body.rtl .about-section p {
    text-align: right;
}

body.rtl .about-section ul {
    text-align: right;
}

body.rtl .about-section li {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

body.rtl .about-section li i {
    margin-right: 0;
    margin-left: 0.5rem;
}

body.rtl .about-section .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

/* Mission & Vision Cards RTL - Keep Centered */
body.rtl .mission-vision-card {
    text-align: center;
}

body.rtl .mission-vision-card h3,
body.rtl .mission-vision-card p {
    text-align: center;
}

/* Why Choose Us Cards RTL - Keep Centered */
body.rtl .why-card {
    text-align: center;
}

body.rtl .why-card h5,
body.rtl .why-card p {
    text-align: center;
}

/* Center the "Why Choose Us" title */
body.rtl h2.text-center {
    text-align: center !important;
}