/* ==========================================================================
   Internationalization (i18n) Styles
   Language Switcher + RTL Support for Arabic
   ========================================================================== */

/* Language Switcher Container */
.lang-switcher-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Language Switcher Button - Elegant Compact Design */
.lang-switcher-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lang-switcher-btn .lang-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 1.5;
}

.lang-switcher-btn .lang-arrow {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 1.5;
    transition: transform 0.3s ease;
}

.lang-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--color-gold);
    color: var(--color-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-switcher-container:has(.lang-switcher-dropdown.show) .lang-arrow,
.lang-switcher-container.dropdown-open .lang-arrow {
    transform: rotate(180deg);
}

/* Language Dropdown - Navy Blue Theme */
.lang-switcher-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--color-navy);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 4000;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-switcher-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-switcher-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.lang-switcher-dropdown button:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lang-switcher-dropdown button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
}

/* Selected language - Gold accent */
.lang-switcher-dropdown button.active {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--color-gold);
    font-weight: 600;
    justify-content: space-between;
}

.lang-switcher-dropdown button.active .lang-check {
    display: block;
}

.lang-switcher-dropdown button .lang-check {
    display: none;
    width: 14px;
    height: 14px;
    stroke: var(--color-gold);
    stroke-width: 2.5;
    flex-shrink: 0;
}

/* RTL: Text alignment for Arabic */
html[dir="rtl"] .lang-switcher-dropdown button {
    text-align: right;
    flex-direction: row-reverse;
}

.lang-switcher-dropdown button.active:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   RTL (Right-to-Left) Support for Arabic
   ========================================================================== */

/* RTL Base Styles */
html[dir="rtl"] {
    direction: rtl;
}

/* RTL Text Alignment */
html[dir="rtl"] body {
    text-align: right;
}

/* RTL Header */
/* html[dir="rtl"] .header-container { } - Removed empty rule */

html[dir="rtl"] .header-logo {
    /* order: 3; Removed to follow DOM order (Logo First -> Rightmost in RTL) */
    margin-left: 0;
    margin-right: 0;
}

html[dir="rtl"] .main-nav {
    /* order: 2; Removed */
    /* Flip margins for RTL: Push Left (away from Logo), Gap on Left (from Phone) */
    margin-right: auto;
    margin-left: var(--spacing-xl);
}

/* html[dir="rtl"] .header-phone-desktop { } - Removed empty rule */

/* Keep phone numbers in LTR format - they should display the same in all languages */
html[dir="rtl"] a[href^="tel:"] span,
html[dir="rtl"] .btn-modern-primary[href^="tel:"] span {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

html[dir="rtl"] .header-phone-desktop {
    direction: ltr;
    /* display: flex; Removed to prevent duplicate switcher on mobile (it inherits display:none from header.css and becomes flex on desktop via media query) */
    /* align-items: center; */
}

html[dir="rtl"] .header-phone-desktop a[href^="tel:"] {
    direction: ltr;
    unicode-bidi: isolate;
}

html[dir="rtl"] .nav-list {
    /* Don't reverse - natural RTL flow will put Home on right, Contact on left */
    direction: rtl;
}

html[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
    text-align: right;
}

/* html[dir="rtl"] .mobile-controls { } - Removed empty rule */

/* RTL Mobile Menu */
html[dir="rtl"] .mobile-menu {
    left: -100%;
    right: auto;
}

html[dir="rtl"] .mobile-menu.show {
    left: 0;
    right: auto;
}

/* html[dir="rtl"] .mobile-menu-header { } - Removed empty rule */

html[dir="rtl"] .mobile-menu-content a {
    flex-direction: row-reverse;
}

html[dir="rtl"] .mobile-menu-content .dropdown-menu {
    padding-left: 0;
    padding-right: var(--spacing-lg);
}

/* RTL Hero Section */
html[dir="rtl"] .modern-hero-container {
    /* flex-direction: row-reverse; Removed/Handled by media query or natural flow */
    /* Note: Hero container might need row-reverse on Desktop if the design requires image swap, but on mobile it stacks. */
    /* Let's keep hero modification separate or safe? user asked for header. */
    /* I will skip hero for now to focus on header, unless it's obviously wrong. */
    flex-direction: row-reverse;
}

html[dir="rtl"] .modern-hero-cta {
    flex-direction: row-reverse;
}

html[dir="rtl"] .welcome-cta {
    flex-direction: row-reverse;
}

html[dir="rtl"] .btn-modern-primary svg,
html[dir="rtl"] .btn-modern-secondary svg {
    transform: scaleX(-1);
}

/* RTL Stats */
html[dir="rtl"] .stats-container {
    flex-direction: row-reverse;
}

html[dir="rtl"] .stat-header {
    flex-direction: row-reverse;
}

/* RTL Services Grid */
html[dir="rtl"] .bento-grid {
    direction: rtl;
}

html[dir="rtl"] .bento-card {
    text-align: right;
}

/* RTL Testimonials */
html[dir="rtl"] .testimonials-grid {
    direction: rtl;
}

html[dir="rtl"] .testimonial-author {
    flex-direction: row-reverse;
    text-align: right;
}

/* RTL FAQ */
html[dir="rtl"] .faq-question {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .faq-answer {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .faq-item {
    direction: rtl;
}

/* RTL How It Works */
html[dir="rtl"] .how-it-works-wrapper {
    direction: rtl;
}

html[dir="rtl"] .how-it-works-header {
    text-align: right;
}

html[dir="rtl"] .how-step-header {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .how-step-content {
    text-align: right;
    padding-right: calc(var(--spacing-lg) + 36px + var(--spacing-md));
    padding-left: var(--spacing-lg);
}

html[dir="rtl"] .how-it-works-container {
    direction: rtl;
}

/* RTL Footer */
html[dir="rtl"] .footer-container {
    direction: rtl;
}

html[dir="rtl"] .footer-col,
html[dir="rtl"] .footer-col h4,
html[dir="rtl"] .footer-nav-list li {
    text-align: right;
    justify-content: flex-start;
}

html[dir="rtl"] .footer-contact-list li,
html[dir="rtl"] .footer-contact-link {
    direction: ltr;
    justify-content: flex-end;
    text-align: right;
}

/* RTL Contact Page */
html[dir="rtl"] .contact-container {
    direction: rtl;
}

html[dir="rtl"] .contact-item {
    direction: ltr;
    justify-content: flex-end;
    text-align: right;
}

html[dir="rtl"] .contact-text {
    text-align: right;
    width: 100%;
}

/* RTL: Location and other text should flow right-to-left */
html[dir="rtl"] .location-text,
html[dir="rtl"] .testimonial-content,
html[dir="rtl"] .service-card p,
html[dir="rtl"] .about-text {
    text-align: right;
    direction: rtl;
}

/* RTL Social Icons flow naturally with direction */

/* RTL Form Elements */
html[dir="rtl"] .form-group {
    text-align: right;
}

html[dir="rtl"] .form-input,
html[dir="rtl"] .form-textarea,
html[dir="rtl"] .form-select {
    text-align: right;
}

html[dir="rtl"] .form-consent {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .form-consent input[type="checkbox"] {
    margin-left: var(--spacing-sm);
    margin-right: 0;
}

/* RTL Welcome Section */
html[dir="rtl"] .welcome-badge {
    flex-direction: row-reverse;
}

html[dir="rtl"] .welcome-content {
    text-align: right;
}

/* RTL Scroll Indicator - flip arrow */
html[dir="rtl"] .scroll-down-btn {
    transform: scaleX(-1);
}

/* RTL Section Headers */
html[dir="rtl"] .section-header {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .section-header p {
    margin-right: 0;
    margin-left: auto;
}

/* RTL CTA Section */
html[dir="rtl"] .cta-container {
    text-align: right;
}

/* RTL Spacing Adjustments */
html[dir="rtl"] .nav-item-dropdown .dropdown-arrow {
    margin-left: 0;
    margin-right: 4px;
}

/* Mobile RTL Adjustments */
@media (max-width: 768px) {
    html[dir="rtl"] .modern-hero-container {
        flex-direction: column;
    }

    html[dir="rtl"] .footer-container {
        flex-direction: column;
    }

    html[dir="rtl"] .how-it-works-wrapper {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .mobile-lang-switcher {
        /* margin-right: 8px; Removed to rely on flex gap */
    }

    .mobile-lang-switcher .lang-switcher-btn {
        padding: 5px 8px;
    }

    .mobile-lang-switcher .lang-switcher-btn span {
        display: none;
        /* Only show icon on very small screens? No, maybe show code */
    }

    .mobile-lang-switcher .lang-switcher-btn::after {
        content: attr(data-lang-code);
        font-size: 10px;
    }
}

/* Language switcher on scrolled header */
.site-header.scrolled .lang-switcher-btn {
    border-color: rgba(255, 255, 255, 0.4);
}

.site-header.scrolled .lang-switcher-btn:hover {
    border-color: var(--color-gold);
}