/*
 * ARCADIS Engineering - RTL & Mobile Fix
 * Version: 3.0 - Complete Fix
 * For Arabic Language Support
 */

/* ========================================
   1. RTL SUPPORT
======================================== */
html[dir="rtl"] {
    font-family: 'Tajawal', 'Inter', sans-serif;
}

html[dir="rtl"] body {
    font-family: 'Tajawal', 'Inter', sans-serif;
    direction: rtl;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-family: 'Tajawal', 'Raleway', sans-serif;
}

/* Navigation RTL - Keep normal direction */
html[dir="rtl"] .navbar-container {
    flex-direction: row;
}

html[dir="rtl"] .navbar-menu {
    flex-direction: row;
}

html[dir="rtl"] .navbar-brand {
    text-align: right;
}

/* Content RTL */
html[dir="rtl"] .about-home-text,
html[dir="rtl"] .about-text {
    padding-left: 50px;
    padding-right: 0;
    text-align: right;
}

html[dir="rtl"] .about-home-text h2::after,
html[dir="rtl"] .about-text h2::after {
    left: auto;
    right: 0;
}

html[dir="rtl"] .section-subtitle {
    text-align: center;
}

html[dir="rtl"] .btn-link i,
html[dir="rtl"] .service-link i,
html[dir="rtl"] .project-slide-link i,
html[dir="rtl"] .back-btn i,
html[dir="rtl"] .cta-btn i {
    transform: rotate(180deg);
}

/* Footer RTL */
html[dir="rtl"] .footer-content,
html[dir="rtl"] .footer-grid {
    direction: rtl;
}

html[dir="rtl"] .footer-col,
html[dir="rtl"] .footer-section {
    text-align: right;
}

html[dir="rtl"] .contact-info li {
    flex-direction: row-reverse;
}

html[dir="rtl"] .contact-info i {
    margin-left: 10px;
    margin-right: 0;
}

/* ========================================
   2. SERVICE ICONS - ALWAYS CENTERED
======================================== */
.service-icon,
.service-card .service-icon,
.card-icon,
.marketing-card .card-icon,
.why-icon,
.value-icon,
.vm-icon,
.study-icon {
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.service-card,
.marketing-card,
.why-card,
.value-card,
.study-card {
    text-align: center !important;
}

html[dir="rtl"] .service-icon,
html[dir="rtl"] .service-card .service-icon,
html[dir="rtl"] .card-icon,
html[dir="rtl"] .marketing-card .card-icon,
html[dir="rtl"] .why-icon,
html[dir="rtl"] .value-icon,
html[dir="rtl"] .vm-icon,
html[dir="rtl"] .study-icon {
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

html[dir="rtl"] .service-card,
html[dir="rtl"] .marketing-card,
html[dir="rtl"] .why-card,
html[dir="rtl"] .value-card,
html[dir="rtl"] .study-card {
    text-align: center !important;
}

/* Project Category Badge RTL */
html[dir="rtl"] .project-slide-category,
html[dir="rtl"] .project-category {
    left: auto;
    right: 15px;
}

/* Hero RTL */
html[dir="rtl"] .slide-buttons,
html[dir="rtl"] .hero-buttons,
html[dir="rtl"] .cta-buttons {
    flex-direction: row;
}

/* Office Cards RTL */
html[dir="rtl"] .office-card {
    border-left: none;
    border-right: 4px solid var(--primary);
}

/* CEO Section RTL */
html[dir="rtl"] .ceo-message {
    border-left: none;
    border-right: 4px solid var(--primary);
    padding-left: 0;
    padding-right: 30px;
}

/* Values RTL */
html[dir="rtl"] .vm-card::before {
    left: auto;
    right: 0;
}

/* ========================================
   3. SOCIAL MEDIA ICONS - BEAUTIFUL STYLE
======================================== */
.social-links {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.social-links a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(228, 109, 10, 0.15);
    border: 2px solid #e46d0a;
    color: #e46d0a;
    font-size: 16px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #e46d0a;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(228, 109, 10, 0.4);
}

html[dir="rtl"] .social-links {
    flex-direction: row;
}

/* Footer Social Links */
.footer .social-links a,
footer .social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    transition: all 0.3s ease;
}

.footer .social-links a:hover,
footer .social-links a:hover {
    background: #e46d0a;
    border-color: #e46d0a;
    color: white;
    transform: translateY(-3px);
}

/* ========================================
   4. LANGUAGE SWITCHER
======================================== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    margin-right: 15px;
    flex-shrink: 0;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #e46d0a;
    border-radius: 25px;
    color: #e46d0a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.lang-btn:hover {
    background: #e46d0a;
    color: white;
}

.lang-btn i {
    font-size: 14px;
}

html[dir="rtl"] .lang-switcher {
    margin-left: 15px;
    margin-right: 15px;
}

/* ========================================
   5. MOBILE MENU - FIXED
======================================== */
@media (max-width: 992px) {
    .marketing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lang-switcher {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Hide desktop language switcher */
    .navbar .lang-switcher {
        display: none !important;
    }

    /* Mobile Menu Styles */
    .navbar-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        flex-direction: column !important;
        padding: 20px 30px 30px;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    html[dir="rtl"] .navbar-menu {
        transform: translateX(100%);
        flex-direction: column !important;
        text-align: right;
    }

    .navbar.mobile-active .navbar-menu {
        transform: translateX(0) !important;
    }

    .navbar-menu li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .navbar-menu li:last-child {
        border-bottom: none;
    }

    .navbar-menu li a {
        display: block;
        padding: 15px 0;
        font-size: 14px;
        color: #404141;
    }

    /* Mobile Language Button Inside Menu */
    .mobile-lang-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-top: 15px;
        padding: 12px 20px;
        background: #e46d0a;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .mobile-lang-btn:hover {
        background: #c45a08;
    }

    /* RTL Mobile Menu */
    html[dir="rtl"] .navbar-menu li a {
        text-align: right;
    }

    html[dir="rtl"] .about-home-text,
    html[dir="rtl"] .about-text {
        padding-left: 0;
        padding-right: 0;
    }

    .marketing-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Contact Button */
    .btn-contact {
        display: none;
    }
}

@media (max-width: 480px) {
    .marketing-grid {
        grid-template-columns: 1fr;
    }

    .navbar-menu {
        padding: 15px 20px 25px;
    }

    .navbar-menu li a {
        padding: 12px 0;
        font-size: 13px;
    }
}

/* ========================================
   6. SLIGHT SIZE ADJUSTMENTS
======================================== */
.navbar-menu {
    gap: 30px;
}

.navbar-menu li a {
    font-size: 12px;
    letter-spacing: 1.2px;
}

.btn-contact {
    padding: 10px 24px;
    font-size: 11px;
    letter-spacing: 1.2px;
}

.section-subtitle {
    font-size: 11px;
    letter-spacing: 2px;
}

.service-card,
.service-item {
    padding: 35px 28px;
}

.marketing-card {
    padding: 28px 22px;
}

/* ========================================
   7. FIX CONTACT PAGE MOBILE LANGUAGE
======================================== */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #e46d0a;
    border-radius: 25px;
    color: #e46d0a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.lang-switch:hover {
    background: #e46d0a;
    color: white;
}

@media (max-width: 768px) {
    .lang-switch {
        display: none !important;
    }

    .mobile-lang-switch {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-top: 15px;
        padding: 12px 20px;
        background: #e46d0a;
        color: white !important;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .mobile-lang-switch:hover {
        background: #c45a08;
    }
}

/* ========================================
   8. MOBILE MENU - Contact Page Fix
======================================== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    padding: 20px 30px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 999;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu ul li {
    border-bottom: 1px solid #eee;
}

.mobile-menu ul li:last-child {
    border-bottom: none;
}

.mobile-menu ul li a {
    display: block;
    padding: 15px 0;
    font-size: 14px;
    color: #404141;
    text-decoration: none;
    font-weight: 500;
}

.mobile-menu ul li a:hover,
.mobile-menu ul li a.active {
    color: #e46d0a;
}

html[dir="rtl"] .mobile-menu ul li a {
    text-align: right;
}

/* ========================================
   9. NAVBAR ACTIONS FOR MOBILE
======================================== */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .navbar-actions .btn-contact {
        display: none;
    }

    .navbar-actions .lang-switch {
        display: none !important;
    }
}
