h1, h2, h3, h4, h5, h6 {
    font-family: "Cairo", sans-serif;
    color: var(--dark);
}

.custom-font-secondary {
    font-family: "Cairo", sans-serif !important;
}

.custom-font-tertiary {
    font-family: "Cairo", serif !important;
}

p {
    line-height: 1.8;
    font-size: 16px;
    font-size: 1rem;
    letter-spacing: -0.015em;
    direction: rtl;
    text-align: right;
}

.badge {
    font-weight: 500;
    font-family: "Cairo", sans-serif !important;
}

.custom-graph-svg-color-primary {
    fill: var(--primary) !important;
}

.custom-graph-svg-color-secondary {
    fill: var(--secondary) !important;
}

.btn {
    font-family: "Cairo", sans-serif !important;
    padding: 16px 35.2px;
    padding: 1rem 2.2rem;
    font-size: 14.4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.custom-text-color-1 {
    color: #df0b0b;
}

.custom-text-color-2 {
    color: #e3993f;
}

@media (min-width: 992px) {
    #header .header-nav.header-nav-links:not(.header-nav-light-text) nav > ul > li > a {
        font-family: "Cairo", sans-serif !important;
        font-size: 17px;
        font-weight: 500;
        letter-spacing: -0.6px;
        color: var(--dark);
    }
    #header .header-nav.header-nav-links:not(.header-nav-light-text) nav > ul > li > a:hover {
        color: var(--primary) !important;
    }
    #header .header-nav.header-nav-links:not(.header-nav-light-text) nav > ul > li > a.active {
        color: var(--dark-rgba-50) !important;
    }
    #header .header-nav.header-nav-links:not(.header-nav-light-text) nav > ul > li.dropdown:not(.dropdown-mega) .dropdown-menu {
        transition: all 300ms;
        opacity: 0;
        transform: translate3d(5px, 0, 0) !important; /* Changed from -5px to 5px */
        border: 1px solid var(--grey-200);
        border-radius: var(--border-radius2x) !important;
        overflow: hidden;
        padding-top: 0;
        padding-bottom: 0;
    }
    #header .header-nav.header-nav-links:not(.header-nav-light-text) nav > ul > li.dropdown:not(.dropdown-mega) .dropdown-menu li a {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        padding-left: 22px !important; /* Swapped from right to left */
        padding-right: 22px !important; /* Swapped from left to right */
        text-align: right;
    }
    #header .header-nav.header-nav-links:not(.header-nav-light-text) nav > ul > li:hover.dropdown:not(.dropdown-mega) .dropdown-menu {
        opacity: 1;
        transform: translate3d(5px, -10px, 0) !important; /* Changed from -5px to 5px */
    }
}

/* Mask Image */
.custom-mask-img {
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100%;
    mask-size: 100%;
    -webkit-mask-position: center;
    mask-position: center;
}

.custom-mask-img-1 {
    -webkit-mask-image: url(../../img/demos/accounting-1/generic/mask-image-1.png);
    mask-image: url(../../img/demos/accounting-1/generic/mask-image-1.png);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100%;
    mask-size: 100%;
    -webkit-mask-position: center;
    mask-position: center;
}

.custom-mask-img-2 {
    -webkit-mask-image: url(../../img/demos/accounting-1/generic/mask-image-2.png);
    mask-image: url(../../img/demos/accounting-1/generic/mask-image-2.png);
}

.custom-mask-img-3 {
    -webkit-mask-image: url(../../img/demos/accounting-1/generic/mask-image-3.png);
    mask-image: url(../../img/demos/accounting-1/generic/mask-image-3.png);
}

.custom-mask-img-4 {
    -webkit-mask-image: url(../../img/demos/accounting-1/generic/mask-image-4.png);
    mask-image: url(../../img/demos/accounting-1/generic/mask-image-4.png);
}

/* Cascading Wrapper */
.custom-cascading-images-wrapper-1 {
    /* padding: 20% 30% 0 0%; /* Swapped left and right padding */
}

/* Stamp */
.custom-stamp-1 {
    width: 180px;
    height: 180px;
    right: -90px; /* Changed from left to right */
    top: 55%;
    border-radius: 50%;
}

.custom-stamp-1 svg {
    position: relative;
    right: 4px; /* Changed from left to right */
    top: 1px;
    margin: 2px;
}

.custom-stamp-1:after {
    opacity: 0.2;
    position: absolute;
    content: "";
    width: 105px;
    height: 105px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #FFF;
    border-radius: 50%;
    display: block;
}

@media (max-width: 992px) {
    .custom-stamp-1 {
        top: 30%;
        transform: scale(0.5);
    }
}

/* Custom Elements */
.custom-el-1 {
    bottom: 13%;
    left: 7%; /* Changed from right to left */
}

@media (max-width: 1200px) {
    .custom-el-1 {
        left: 0; /* Changed from right to left */
        bottom: 8%;
    }
}

@media (max-width: 575px) {
    .custom-el-1 {
        bottom: 0;
    }
}

.custom-el-1 p {
    font-size: clamp(35px, -1.6666666667px + 0.0763888889 * 100vw, 90px);
    letter-spacing: -5px;
    position: relative;
    z-index: 1;
    margin: 0;
    line-height: 1;
    font-weight: bold;
    direction: rtl; /* Added direction */
    text-align: right; /* Added text alignment */
}

@media (max-width: 991px) {
    .custom-el-1 p {
        letter-spacing: -2px;
    }
}

.custom-el-1 em {
    font-size: clamp(18px, 11.3333333333px + 0.0138888889 * 100vw, 28px);
    position: relative;
    bottom: 2px;
    display: inline-flex;
    letter-spacing: -2px;
}

.custom-el-1 em mark {
    padding: 0 7px 5px !important;
}

@media (max-width: 991px) {
    .custom-el-1 em {
        bottom: 5px;
        left: -1px; /* Changed from right to left */
    }
}

.custom-el-2 {
    position: absolute;
    width: 100%;
    height: 100%;
}

.custom-el-2 img {
    height: 150%;
    min-width: 1200px !important;
    min-height: 1200px !important;
    transform: scaleX(-1); /* Mirror the image horizontally for RTL */
}

@media (max-width: 1400px) {
    .custom-el-2 img {
        min-height: 1500px !important;
    }
}

.custom-el-3 {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotateY(0deg); /* Changed from 180deg to 0deg since we're flipping direction */
}

.custom-el-3 img {
    height: 100%;
    min-width: 1200px !important;
    min-height: 1200px !important;
}

.custom-el-4 svg {
    width: 100%;
    transform: scaleX(-1); /* Mirror SVG horizontally for RTL */
}

.custom-el-5 {
    position: absolute;
    width: 100%;
    height: 100%;
}

.custom-el-5 img {
    height: 100%;
    min-width: 1000px !important;
    min-height: 1000px !important;
    transform: scaleX(-1); /* Mirror the image horizontally for RTL */
}

@media (min-width: 992px) {
    .custom-el-6 {
        margin-bottom: -70px;
        margin-right: 7px; /* Changed from margin-left to margin-right */
    }
}

.custom-el-7 {
    max-height: 32px;
    width: auto !important;
    max-width: 150px !important;
    transform: scaleX(-1) !important; /* Mirror horizontally for RTL and override previous transform */
}

/* Custom Pos */
.custom-pos-1 {
    left: -37%; /* Changed from right to left */
    top: -33%;
}

.custom-pos-2 {
    right: -75%; /* Changed from left to right */
    top: -33%;
}

.custom-pos-3 {
    margin-top: -80px;
}

.custom-pos-4 {
    left: -40%; /* Changed from right to left */
    top: -57%;
}

.custom-pos-5 {
    top: -85%;
}

.custom-pos-6 {
    right: -75%; /* Changed from left to right */
    bottom: -10%;
}

/* Gradient */
.custom-bg-gradient-1 {
    background-image: linear-gradient(to left, var(--secondary-rgba-30) 30%, var(--dark) 200%) !important; /* Changed direction from right to left */
}

@media (max-width: 991px) {
    .custom-bg-gradient-1 {
        border-radius: 0 !important;
    }
}

/* Add overall RTL direction to the document */
html {
    direction: rtl;
}

body {
    direction: rtl;
    text-align: right;
}

/* Adjust header and layout for RTL */
#header .header-nav.header-nav-links nav > ul {
    padding-right: 0;
}

/* Fix dropdown directions */
.dropdown-menu {
    text-align: right;
    left: auto;
    right: 0;
}

/* Fix any float classes if they exist */
.float-start, .float-left {
    float: right !important;
}

.float-end, .float-right {
    float: left !important;
}

/* Adjust margin and padding utility classes */
.ms-1, .ms-2, .ms-3, .ms-4, .ms-5, .ms-auto, .ml-1, .ml-2, .ml-3, .ml-4, .ml-5, .ml-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

.me-1, .me-2, .me-3, .me-4, .me-5, .me-auto, .mr-1, .mr-2, .mr-3, .mr-4, .mr-5, .mr-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.ps-1, .ps-2, .ps-3, .ps-4, .ps-5, .pl-1, .pl-2, .pl-3, .pl-4, .pl-5 {
    padding-right: auto !important;
    padding-left: 0 !important;
}

.pe-1, .pe-2, .pe-3, .pe-4, .pe-5, .pr-1, .pr-2, .pr-3, .pr-4, .pr-5 {
    padding-left: auto !important;
    padding-right: 0 !important;
}