/* Custom styles for Topbar and Language Switcher */

/* Topbar Layout & UI Refinement */
.topbar {
    background: #001A3D; 
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.topbar .col-sm-6 {
    display: flex;
    align-items: center;
}

.topbar .col-sm-6:last-child {
    justify-content: flex-end;
}

.contact-info {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 25px;
}

.contact-info li {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1; /* Reset line height for better alignment */
}

.contact-info li i {
    color: #05C206;
    margin-right: 10px;
    font-size: 14px;
    position: relative;
    top: 1px; /* Subtle nudge for perfect optical alignment */
}

.contact-info li span {
    display: inline-block;
    padding-top: 0px; /* Align text precisely with icon center */
}

[dir="rtl"] .contact-info li i {
    margin-right: 0;
    margin-left: 10px;
}

/* Social Icons Horizontal Alignment */
.topbar .social ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px; /* Consistent spacing between all items including lang-switcher */
}

.topbar .social ul li {
    display: flex;
    align-items: center;
}

.topbar .social ul li a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
}

.topbar .social ul li a:hover {
    color: #fff;
    background: transparent;
    transform: translateY(-2px);
}




/* Fix for inner page header collapse if needed */
/* Ensure header has height or overlay correctly */
.tp-site-header {
    width: 100%;
    z-index: 999;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .topbar .row {
        flex-direction: column;
        text-align: center;
    }
    .topbar .col-sm-5, 
    .topbar .col-sm-7 {
        justify-content: center;
        margin-bottom: 5px;
        width: 100%;
    }
    .topbar .social ul {
        justify-content: center;
    }
}

/* Strategic Projects Styling */
.project-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    transition: all 0.4s ease;
    border: 1px solid #f0f0f0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 121, 232, 0.12);
    border-color: rgba(0, 121, 232, 0.2);
}

.project-thumb {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-thumb img {
    transform: scale(1.1);
}

.project-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #0079E8;
    color: #fff;
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.project-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #888;
}

.project-meta span i {
    color: #039004;
    margin-right: 5px;
}

.project-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

.project-content h3 a {
    color: #0D1B2A;
}

.project-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-footer {
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.project-link {
    font-weight: 700;
    font-size: 14px;
    color: #0079E8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-link:hover {
    color: #039004;
}

.project-link i {
    transition: transform 0.3s ease;
}

.project-link:hover i {
    transform: translateX(5px);
}

[dir="rtl"] .project-badge {
    right: auto;
    left: 20px;
}

[dir="rtl"] .project-meta span i {
    margin-right: 0;
    margin-left: 5px;
}

[dir="rtl"] .project-link:hover i {
    transform: translateX(-5px);
}

/* Specialized Focus Areas Design */
.focus-area-section {
    background-color: #f4f8ff;
    padding: 100px 0 70px;
    position: relative;
    overflow: hidden;
}

.focus-area-section::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 121, 232, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.focus-card {
    background: #ffffff;
    padding: 50px 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.focus-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 50px rgba(0, 121, 232, 0.12);
    border-color: rgba(0, 121, 232, 0.2);
}

.focus-icon-box {
    width: 90px;
    height: 90px;
    background: #e8f3ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    transition: all 0.5s ease;
    border: 1px solid rgba(0, 121, 232, 0.08);
}

.focus-card:hover .focus-icon-box {
    background: #0079E8;
    transform: rotateY(360deg);
}

.focus-icon-box img {
    width: 45px;
    transition: all 0.5s ease;
}

.focus-card:hover .focus-icon-box img {
    filter: brightness(0) invert(1);
}

.focus-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #0D1B2A;
}

.focus-card h3 a {
    color: inherit;
    text-decoration: none;
}

.focus-card p {
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 0;
}

/* RTL Adjustments for Arabic */
[dir="rtl"] .focus-area-section::before {
    left: -50px;
    right: auto;
}
/* Hide Topbar on Mobile */
@media (max-width: 991px) {
    .topbar {
        display: none !important;
    }
}

/* Language Toggle Switch */
.lang-switcher {
    margin-left: 20px;
    display: inline-flex;
    align-items: center;
}

.lang-toggle {
    position: relative;
    width: 65px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.lang-toggle a {
    position: relative;
    z-index: 2;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
}

.lang-toggle a.active {
    color: #fff;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: #0079E8;
    border-radius: 18px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
}

/* Slide to Arabic position */
.lang-toggle:has(.lang-ar.active) .toggle-slider {
    left: 50%;
}

/* For browsers that don't support :has yet */
.lang-toggle .lang-ar.active ~ .toggle-slider {
    left: 50%;
}

@media (max-width: 991px) {
    .topbar {
        display: none !important;
    }
}



/* Mobile Submenu Dropdown Icon */
@media (max-width: 991px) {
    .navigation-holder .menu-item-has-children > a {
        position: relative;
        display: block;
    }
    
    .navigation-holder .menu-item-has-children > a:after {
        font-family: "themify";
        content: "\e64b"; /* Arrow Down icon */
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 10px;
        transition: all 0.3s ease;
    }
    
    .navigation-holder .menu-item-has-children.submenu-active > a:after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    [dir="rtl"] .navigation-holder .menu-item-has-children > a:after {
        right: auto;
        left: 15px;
    }
    
    /* Ensure sub-menu links are indented */
    .navigation-holder .sub-menu {
        background: #f9f9f9 !important;
        padding-left: 20px !important;
    }
    
    [dir="rtl"] .navigation-holder .sub-menu {
        padding-left: 0 !important;
        padding-right: 20px !important;
    }
}

/* Mobile Menu Refined Styles */
@media (max-width: 991px) {
    .tp-site-header #navbar {
        background: #fff !important;
        width: 280px !important;
        height: 100vh !important;
        right: -300px !important;
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
        box-shadow: -15px 0 40px rgba(0,0,0,0.1) !important;
        border: none !important;
        padding-top: 80px !important;
        z-index: 9999 !important;
        display: block !important;
    }
    
    .tp-site-header #navbar.slideInn {
        right: 0 !important;
    }

    .tp-site-header #navbar .navbar-nav {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        height: auto !important;
    }

    .tp-site-header #navbar .navbar-nav > li {
        width: 100% !important;
        border-bottom: 1px solid #f4f7fa !important;
        display: block !important;
    }

    .tp-site-header #navbar .navbar-nav > li > a {
        padding: 15px 20px 15px 20px !important; /* Right side padding 20px as specifically requested */
        text-align: right !important; 
        width: 100% !important;
        font-size: 18px !important;
        color: #061738 !important;
        font-weight: 700 !important;
        text-transform: capitalize !important;
        display: flex !important;
        justify-content: flex-end !important; /* Align content to the right */
        align-items: center !important;
        letter-spacing: 0.5px !important;
        transition: all 0.3s ease !important;
    }

    .tp-site-header #navbar .navbar-nav > li > a.active {
        color: #0079E8 !important;
        background: #f8fbff !important;
        border-right: 4px solid #0079E8 !important; /* Visual indicator on the right */
    }

    /* Hover effect */
    .tp-site-header #navbar .navbar-nav > li > a:hover {
        background: #f4f8ff !important;
        padding-right: 25px !important; /* Subtle slide effect */
    }

    /* Fixed Close Button Positioning & Style */
    .tp-site-header #navbar .close-navbar {
        position: absolute !important;
        left: 20px !important;
        top: 20px !important;
        width: 44px !important;
        height: 44px !important;
        background: #039004 !important; /* Green like in the screenshot */
        color: #fff !important;
        border: none !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 16px !important;
        z-index: 50 !important;
        cursor: pointer !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
        transition: transform 0.3s ease !important;
    }

    .tp-site-header #navbar .close-navbar:hover {
        transform: rotate(90deg) scale(1.1) !important;
    }

    /* Submenu Padding */
    .tp-site-header #navbar .sub-menu {
        padding-left: 0 !important;
        background: #fcfdfe !important;
    }

    .tp-site-header #navbar .sub-menu li a {
        padding: 12px 20px !important;
        font-size: 15px !important;
        opacity: 0.8 !important;
    }

    /* RTL Mode Adjustments */
    [dir="rtl"] .tp-site-header #navbar {
        right: auto !important;
        left: -300px !important;
        box-shadow: 15px 0 40px rgba(0,0,0,0.1) !important;
    }

    [dir="rtl"] .tp-site-header #navbar.slideInn {
        left: 0 !important;
    }

    [dir="rtl"] .tp-site-header #navbar .navbar-nav > li > a {
        text-align: right !important;
        justify-content: flex-end !important;
        padding: 15px 20px 15px 15px !important; /* Right side padding 20px for AR */
        border-right: 4px solid transparent !important;
        border-left: none !important;
    }

    [dir="rtl"] .tp-site-header #navbar .navbar-nav > li > a.active {
        border-right-color: #0079E8 !important;
        border-left-color: transparent !important;
    }

    [dir="rtl"] .tp-site-header #navbar .close-navbar {
        left: auto !important;
        right: 20px !important;
    }
}

/* --- ARABIC (RTL) COMPREHENSIVE IMPROVEMENTS --- */

[dir="rtl"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important; /* Better default for Arabic */
}

[dir="rtl"] body {
    text-align: right;
}

/* Mirror Float and Text Alignment */
[dir="rtl"] .text-left { text-align: right !important; }
[dir="rtl"] .text-right { text-align: left !important; }
[dir="rtl"] .pull-left { float: right !important; }
[dir="rtl"] .pull-right { float: left !important; }

/* Section Specific Mirroring */
[dir="rtl"] .section-title {
    text-align: right;
}

[dir="rtl"] .section-title.text-center {
    text-align: center;
}

/* Features Area Mirroring */
[dir="rtl"] .features-item, 
[dir="rtl"] .features-item-2 {
    text-align: right;
}

[dir="rtl"] .features-icon {
    float: right !important;
    margin-right: 0 !important;
    margin-left: 20px !important;
}

/* Volunteer Section Mirroring */
[dir="rtl"] .volunteer-item {
    text-align: right;
}

/* Video Holder Fix */
[dir="rtl"] .video-holder {
    left: auto;
    right: 50%;
    transform: translateX(50%) translateY(-50%);
}

/* Breadcrumb Mirroring */
[dir="rtl"] .breadcrumb li + li:before {
    content: "/\00a0";
    padding: 0 5px;
}

/* Icon Flipping */
[dir="rtl"] .fa-angle-double-right:before {
    content: "\f100"; /* double angle left */
}

[dir="rtl"] .fa-angle-right:before {
    content: "\f104"; /* angle left */
}

[dir="rtl"] .ti-arrow-right:before {
    content: "\e629"; /* arrow left */
}

/* Form Mirroring */
[dir="rtl"] .form-control {
    text-align: right;
}

[dir="rtl"] .submit-area {
    text-align: right;
}

/* Spacing Mirroring */
[dir="rtl"] .m-l-10 { margin-left: 0 !important; margin-right: 10px !important; }
[dir="rtl"] .m-r-10 { margin-right: 0 !important; margin-left: 10px !important; }
[dir="rtl"] .p-l-0 { padding-left: 0 !important; }
[dir="rtl"] .p-r-0 { padding-right: 0 !important; }

/* Custom Adjustments for Arabic Typography */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    line-height: 1.5 !important;
    font-weight: 700;
}

[dir="rtl"] p {
    line-height: 1.8 !important;
    font-size: 17px;
}

/* Footer RTL fixes */
[dir="rtl"] .tp-site-footer {
    text-align: right;
}

[dir="rtl"] .tp-site-footer .widget-title h3:after {
    margin-left: auto;
    margin-right: 0;
}

[dir="rtl"] .tp-site-footer .link-widget ul li a:hover {
    padding-left: 0;
    padding-right: 6px;
}

/* Header/Navbar RTL Tweaks for Desktop */
@media (min-width: 992px) {
    [dir="rtl"] .tp-site-header .navbar-header {
        float: right !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    [dir="rtl"] .header-style-2 #navbar,
    [dir="rtl"] .header-style-3 #navbar {
        margin-left: 0 !important;
        margin-right: 80px !important; /* Space from the right edge for logo */
        float: right !important;
        width: auto !important;
    }

    [dir="rtl"] .navigation-holder {
        float: right !important;
        margin-right: 0 !important;
    }

    [dir="rtl"] .navbar-nav {
        display: flex !important;
        flex-direction: row-reverse !important;
        column-gap: 30px !important;
        margin-right: 0 !important;
        height: auto !important;
    }

    [dir="rtl"] .tp-site-header .cart-search-contact {
        float: left !important;
        right: auto !important;
        left: 30px !important;
        margin-top: 0px !important; /* Align with nav items vertically */
    }
    
    [dir="rtl"] .tp-site-header #navbar > ul .sub-menu {
        left: auto !important;
        right: 0 !important;
        text-align: right !important;
    }

    [dir="rtl"] .tp-site-header #navbar > ul > li .sub-menu .sub-menu {
        left: auto !important;
        right: 100% !important;
    }
    
    /* Active Link for Desktop RTL */
    [dir="rtl"] .tp-site-header #navbar > ul li a.active,
    [dir="rtl"] .tp-site-header #navbar > ul li.current-menu-item > a {
        color: #0079E8 !important;
        position: relative;
    }
}

/* Mobile Toggle & Logo RTL Fix */
@media (max-width: 991px) {
    [dir="rtl"] .tp-site-header .open-btn {
        right: auto !important;
        left: 20px !important;
    }
    
    [dir="rtl"] .tp-site-header .navbar-header .navbar-brand {
        float: right !important;
        margin-right: 15px !important;
        margin-left: 0 !important;
    }
    
    /* Fix Off-Canvas Navigation Collapse sliding from wrong side */
    [dir="rtl"] .tp-site-header #navbar {
        right: auto !important;
        left: -320px !important; 
    }
    
    [dir="rtl"] .tp-site-header #navbar.slideInn {
        left: 0 !important;
        right: auto !important;
    }
    
    [dir="rtl"] .tp-site-header #navbar .close-navbar {
        right: auto !important;
        left: 20px !important;
    }

    [dir="rtl"] .tp-site-header #navbar .navbar-nav > li > a {
        text-align: right !important;
        justify-content: flex-end !important;
        border-right: 4px solid transparent !important;
        border-left: none !important;
    }
    
    [dir="rtl"] .tp-site-header #navbar .navbar-nav > li > a.active {
        border-right-color: #0079E8 !important;
        border-left-color: transparent !important;
    }
}

/* Global RTL Element Fixed */
[dir="rtl"] .section-title {
    text-align: right;
}

[dir="rtl"] .section-title.text-center {
    text-align: center;
}

[dir="rtl"] .text-left { text-align: right !important; }
[dir="rtl"] .text-right { text-align: left !important; }
[dir="rtl"] .btn i {
    margin-right: 10px;
    margin-left: 0;
    transform: rotate(180deg);
}


/* Mobile Specific Arabic Adjustments */
@media (max-width: 991px) {
    [dir="rtl"] .section-title h2 {
        font-size: 26px !important;
    }
    
    [dir="rtl"] .features-text {
        text-align: right;
        margin-bottom: 30px;
    }
}

/* RTL Image Border/Shape mirroring */
[dir="rtl"] [class*="shape"] {
    right: 0;
}
[dir="rtl"] .tp-site-header .navigation>.container{
        display: flex;
    align-items: center;
}

[dir="rtl"] .about-img-v2 .ab-shape-1 {
    right: -20px;
    left: auto;
}

[dir="rtl"] .about-img-v2 .ab-shape-2 {
    left: -20px;
    right: auto;
}

/* Fix for slick slider arrows in RTL */
[dir="rtl"] .slick-prev {
    left: auto;
    right: -25px;
}

[dir="rtl"] .slick-next {
    right: auto;
    left: -25px;
}

@media (max-width: 1300px) {
    [dir="rtl"] .slick-prev {
        left: auto !important;
        right: 10px !important;
    }
    [dir="rtl"] .slick-next {
        right: auto !important;
        left: 10px !important;
    }
}

/* Mirror icons for RTL */
[dir="rtl"] .slick-prev i, 
[dir="rtl"] .slick-next i {
    display: inline-block;
    transform: rotate(180deg);
    margin: 0 !important;
}
/* --- GLOBAL RESPONSIVENESS PATCH --- */

/* Basic horizontal containment */
html, body {
    overflow-x: hidden;
    width: 100%;
}

.page-wrapper {
    overflow-x: hidden;
}

/* Fix for large headings and elements on mobile */
@media (max-width: 991px) {
    .section-title h2 {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    
    .page-title h2 {
        font-size: 32px !important;
    }

    /* Force all flex containers added with inline styles to stack */
    [style*="display: flex"] {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    /* Reset width for columns in flex containers */
    [style*="display: flex"] > div {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 20px;
    }

    /* Fix image heights that were hardcoded */
    img[style*="height"] {
        height: auto !important;
        max-height: 400px;
        width: 100% !important;
        object-fit: contain !important;
    }

    /* Specific fixes for recently added sections */
    .support-card {
        margin-bottom: 30px;
    }
    
    .impact-stats h2, 
    .monthly-giving h2, 
    .specific-funds h2, 
    .faq-section h2 {
        font-size: 28px !important;
    }

    .tp-counter-grids {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .section-title {
        text-align: center;
    }
    
    .tp-counter-grids {
        grid-template-columns: 1fr !important;
    }
    
    .volunteer-item-v2 {
        flex-direction: column;
        text-align: center;
    }
    
    .volunteer-action {
        margin-top: 20px;
    }

    .cta-btns a, .btns a {
        display: block;
        margin-bottom: 10px;
        width: 100%;
    }
}

/* Fix for potential horizontal scroll on mobile */
.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.col-12, .col-sm-12, .col-md-12, .col-lg-12 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

