/* Language Switcher Styles */
.lang-switcher-container {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    margin-right: 20px;
    position: relative;
    z-index: 10;
}

.lang-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid #000000;
    /* Solid black border */
    border-radius: 12px;
    color: #000000;
    /* Black text */
    background: rgba(0, 0, 0, 0.05);
    /* Subtle black tint */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 800;
    /* Extra bold for clarity */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 100;
}

.lang-toggle-btn:hover {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    color: var(--white-color);
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.theme-toggle-btn:hover {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

/* Styles for sticky/fixed header where background is white or for light headers */
/* Ensure consistency across all header states */
.fixed-header .lang-toggle-btn,
.sticky-header .lang-toggle-btn,
.header-style1 .lang-toggle-btn,
.tv-header .lang-toggle-btn {
    color: #000000;
    border: 2px solid #000000;
    background: rgba(0, 0, 0, 0.05);
}

/* White color for dark headers like header-style2 */
.header-style2 .lang-toggle-btn {
    color: #ffffff;
    border: 2px solid #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.header-style2 .lang-toggle-btn:hover {
    background: #ffffff;
    color: #000000 !important;
    border-color: #ffffff;
}

.fixed-header .lang-toggle-btn:hover,
.sticky-header.fixed-header .lang-toggle-btn:hover,
.header-style1 .lang-toggle-btn:hover,
.tv-header .lang-toggle-btn:hover {
    background: #000000;
    color: #ffffff !important;
    border-color: #000000;
}

.fixed-header .theme-toggle-btn,
.sticky-header.fixed-header .theme-toggle-btn,
.header-style1 .theme-toggle-btn {
    background: #f0f0f0;
    border-color: transparent;
    color: var(--title-color);
    backdrop-filter: none;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

:root {
    --z-index-base: 1;
    --z-index-deep: 10;
    --z-index-top: 1000;
    --z-index-header: 10000;
    --z-index-sticky: 11000;
    --z-index-popup: 99999;
    --z-index-mobile-menu: 999999;
    --z-index-preloader: 9999999;
}

.search-popup,
.popup-status {
    z-index: var(--z-index-popup) !important;
}

[dir="rtl"] .main-menu {
    text-align: right;
}

[dir="rtl"] .tv-header {
    z-index: var(--z-index-header) !important;
}

[dir="rtl"] .sticky-header {
    z-index: var(--z-index-sticky) !important;
    background: #ffffff !important;
}

[dir="rtl"] .sticky-header.fixed-header {
    z-index: var(--z-index-sticky) !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #ffffff !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Global header visibility and stacking fix */
.tv-header {
    z-index: var(--z-index-header) !important;
}

.sticky-header {
    z-index: var(--z-index-sticky) !important;
}

.sticky-header.fixed-header {
    z-index: var(--z-index-sticky) !important;
}

/* Specific section overrides to ensure they don't hide the header */
.tv-contact-section,
.tv-faq-section,
.footer-section {
    /* position: relative; */
    z-index: var(--z-index-deep);
}

.mobile-menu-wrapper {
    z-index: var(--z-index-mobile-menu) !important;
}

.loading-screen {
    z-index: var(--z-index-preloader) !important;
}

[dir="rtl"] .header-right-wrapper {
    margin-left: 0;
    margin-right: 0;
}

[dir="rtl"] .logo {
    margin-right: 0;
    margin-left: 0;
}

[dir="rtl"] .lang-switcher-container {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .theme-btn .arrow-all {
    margin-left: 0;
    margin-right: 10px;
    transform: rotate(180deg);
}

[dir="rtl"] .navigation>li>a i {
    margin-left: 0;
    margin-right: 5px;
}

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

[dir="rtl"] .sub-menu .sub-menu {
    left: auto;
    right: 100%;
}

/* Fix for icons and alignment in RTL */
[dir="rtl"] .fa-solid,
[dir="rtl"] .fas,
[dir="rtl"] .far,
[dir="rtl"] .fal {
    display: inline-block;
}

/* Flip arrows in RTL */
[dir="rtl"] .fa-arrow-right:before {
    content: "\f060";
}

[dir="rtl"] .fa-arrow-left:before {
    content: "\f061";
}

[dir="rtl"] .fa-chevron-right:before {
    content: "\f053";
}

[dir="rtl"] .fa-chevron-left:before {
    content: "\f054";
}

[dir="rtl"] .fa-angle-right:before {
    content: "\f104";
}

[dir="rtl"] .fa-angle-left:before {
    content: "\f105";
}

/* Flip CSS Transforms */
[dir="rtl"] .arrow-all i {
    transform: rotate(180deg);
}

[dir="rtl"] .navigation li.menu-item-has-children>a:after {
    margin-left: 0;
    margin-right: 5px;
}

[dir="rtl"] .header-right-wrapper .outer-box {
    flex-direction: row-reverse;
}

/* Individual design for Choose Us section: Keep layout same as English, only translate */
[dir="rtl"] .choose-section {
    direction: ltr !important;
}

[dir="rtl"] .choose-section .sec-title,
[dir="rtl"] .choose-section .sub-title-2,
[dir="rtl"] .choose-section .tab-content h4,
[dir="rtl"] .choose-section .tab-content p,
[dir="rtl"] .choose-section .feature-item,
[dir="rtl"] .choose-section .choose-card .content,
[dir="rtl"] .tv-faq-section .sec-title,
[dir="rtl"] .tv-faq-section .sub-title-2 {
    direction: rtl !important;
    text-align: right !important;
}

[dir="rtl"] .choose-section .feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-start;
}

[dir="rtl"] .choose-section .feature-item .icon {
    margin-right: 0;
}

[dir="rtl"] .skills .skill-item .skill-bar .bar-inner .skill-percentage {
    right: auto;
    left: 0;
}

/* Fix Project cards in RTL */
[dir="rtl"] .tv-project-wrapper .tv-project-card .project-content {
    left: auto !important;
    right: 50px !important;
    text-align: right;
}

[dir="rtl"] .tv-project-wrapper .tv-project-card .project-text h2,
[dir="rtl"] .tv-project-wrapper .tv-project-card .project-text p {
    text-align: right;
}

[dir="rtl"] .tv-project-wrapper .tv-project-card .active-content h3 {
    left: auto !important;
    right: 50% !important;
    transform: translateX(50%) rotate(180deg) !important;
    writing-mode: vertical-rl !important;
}

[dir="rtl"] .tv-project-wrapper .tv-project-card .video-btn {
    left: auto !important;
    right: 30px !important;
}

[dir="rtl"] .skills .skill-item .skill-bar .bar-inner .bar {
    left: auto;
    right: 0;
}

/* Fix Counter/Odometer numbers flipping in RTL */
[dir="rtl"] .count,
[dir="rtl"] .odometer,
[dir="rtl"] .count-number,
[dir="rtl"] .count span {
    direction: ltr !important;
    display: inline-flex;
    align-items: center;
}

[dir="rtl"] .count-item {
    text-align: right;
}

/* Feature Box Icon Top Fix in RTL */
[dir="rtl"] .tv-feature-section .tv-feature-box .icon-top {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 20px solid var(--light-color);
    border-radius: 0 0 40% 0;
}

[dir="rtl"] .tv-feature-section .tv-feature-box .icon-top::before {
    left: auto;
    right: -44px;
    transform: rotate(0deg);
}

[dir="rtl"] .tv-feature-section .tv-feature-box .icon-top::after {
    right: auto;
    left: 0px;
    transform: rotate(0deg);
}

/* Flip the arrow inside the icon for RTL */
[dir="rtl"] .tv-feature-section .tv-feature-box .icon-top .icon i svg {
    transform: scaleX(-1) translateY(-1px);
}

[dir="rtl"] .tv-feature-section .tv-feature-box .icon-top .icon i svg:last-child {
    transform: scaleX(-1) translate(0, 0);
}

[dir="rtl"] .tv-feature-section .tv-feature-box:hover .icon-top .icon i svg:first-child {
    transform: scaleX(-1) translate(16px, -16px);
}

[dir="rtl"] .tv-feature-section .tv-feature-box:hover .icon-top .icon i svg:last-child {
    transform: scaleX(-1) translate(13px, -12px);
}

/* Service Box Five Icon Top Fix in RTL */
[dir="rtl"] .service-box-five .icon-top {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 12px solid var(--light-color2);
    border-radius: 0 0 40% 0;
}

[dir="rtl"] .service-box-five .icon-top::before {
    left: auto;
    right: -36px;
    transform: rotate(0deg);
}

[dir="rtl"] .service-box-five .icon-top::after {
    right: auto;
    left: 0px;
    transform: rotate(0deg);
}

/* Blog Box Icon Top Fix in RTL */
[dir="rtl"] .tv-blog-box .icon-top {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 15px solid var(--light-color);
    border-radius: 0 40% 0 0;
}

[dir="rtl"] .tv-blog-box .icon-top::before {
    left: auto;
    right: 22px;
    transform: rotate(-90deg);
}

[dir="rtl"] .tv-blog-box .icon-top::after {
    right: auto;
    left: 59px;
    transform: rotate(-90deg);
}

/* Achievement Section */
[dir="rtl"] .tv-achivement-section .achivement-image-wrapper .thumb {
    margin-left: 0;
    margin-right: -340px;
}

[dir="rtl"] .tv-achivement-section .achivement-image-wrapper .thumb-bg {
    left: auto;
    right: -180px;
}

[dir="rtl"] .faq-image-wrapper {
    margin-right: 0 !important;
    margin-left: 60px !important;
    text-align: right;
}

[dir="rtl"] .faq-image-wrapper .faq-image {
    direction: ltr;
}

[dir="rtl"] .faq-image-wrapper .shape {
    right: auto;
    left: -110px;
}

[dir="rtl"] .faq-image-wrapper .faq-single-card {
    right: auto;
    left: -130px;
    border-radius: 0 30px 0 0;
}

[dir="rtl"] .faq-image-wrapper .faq-single-card .faq-car-inner {
    text-align: right;
}

[dir="rtl"] .faq-image-wrapper .faq-single-card .p-top-right {
    right: auto;
    left: 0;
    transform: scaleX(-1);
}

[dir="rtl"] .tv-faq-section .accordion-box .accordion .acc-btn {
    padding-right: 30px;
    padding-left: 50px;
    text-align: right;
}

[dir="rtl"] .tv-faq-section .accordion-box .accordion .acc-btn .icon {
    right: auto;
    left: 20px;
}

[dir="rtl"] .title-wrap .sub-title-2 i {
    margin-right: 0 !important;
    margin-left: 10px !important;
}

@media (max-width: 1199px) {
    [dir="rtl"] .faq-image-wrapper {
        margin-left: 30px !important;
        margin-right: 0 !important;
    }

    [dir="rtl"] .faq-image-wrapper .faq-single-card {
        left: -80px;
    }
}

@media (max-width: 991px) {
    [dir="rtl"] .faq-image-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    [dir="rtl"] .faq-image-wrapper .faq-single-card {
        left: 0;
        position: relative;
        margin-top: 30px;
    }
}

.footer-sep {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

[dir="rtl"] .footer-bottom .text-md-end {
    text-align: left !important;
}

[dir="rtl"] .footer-section .footer-bottom .footer-policy a {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .footer-section .footer-bottom .footer-policy a+a::before {
    left: auto;
    right: -10px;
}

/* Newsletter RTL Fix */
[dir="rtl"] .newsletter {
    padding: 40px 60px 40px 0;
    /* Mirrored from 40px 60px 40px 0? Wait, LTR was 40px 60px 40px 0. So mirror is 40px 0 40px 60px. */
    padding: 40px 0 40px 60px;
}

[dir="rtl"] .newsletter .thumb {
    left: auto;
    right: 50px;
}

[dir="rtl"] .newsletter .image-text {
    padding-left: 0;
    padding-right: 230px;
    text-align: right;
}

[dir="rtl"] .newsletter .image-text img {
    margin-left: 20px;
    margin-right: 0;
}

[dir="rtl"] .newsletter .arrow-shape {
    right: auto;
    left: 480px;
    transform: scaleX(-1);
}

[dir="rtl"] .newsletter .newsletter-form {
    margin-right: 0;
    margin-left: 0;
    /* Reset */
}

[dir="rtl"] .newsletter .newsletter-form .form-group button[type=submit] {
    right: auto;
    left: 10px;
}

[dir="rtl"] .newsletter .newsletter-form .form-group input[type=email] {
    padding: 10px 50px 10px 25px;
    /* More padding on the left for the button */
    text-align: right;
}

@media (max-width: 1199px) {
    [dir="rtl"] .newsletter .image-text {
        padding-right: 60px;
        padding-left: 0;
    }
}

@media (max-width: 1024px) {
    [dir="rtl"] .newsletter {
        padding: 42px 30px 45px;
    }

    [dir="rtl"] .newsletter .image-text {
        padding-right: 0;
    }
}

@media (max-width: 575px) {
    [dir="rtl"] .newsletter {
        flex-direction: column;
        /* Normal column in RTL is fine */
    }
}

/* Fix for Team Cards as Service Cards */
.tv-team-card.style-2 .team-info {
    padding: 25px 20px !important;
    height: auto !important;
    min-height: 90px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: translate(-50%, -45px) !important;
}

.tv-team-card.style-2 .team-info .info-inner {
    width: 100%;
}

.tv-team-card.style-2 .team-info::before,
.tv-team-card.style-2 .team-info::after {
    display: none !important;
}


.tv-team-card.style-2 .team-info .team-name {
    margin: 0 !important;
    font-size: 22px !important;
}