/* AfrikData Custom Branding Styles */

:root {
    /* AfrikData Official Palette */
    --af-blue-deep: #0D3B66;
    --af-blue-deep-rgb: 13, 59, 102;
    --af-green-crescent: #2A9D8F;
    --af-green-crescent-rgb: 42, 157, 143;
    --af-green-rgb: 42, 157, 143;
    /* Added for badge background */
    --af-yellow-gold: #F4A261;
    --af-yellow-gold-rgb: 244, 162, 97;
    --af-white: #FFFFFF;
    --af-green-light: #7BC67E;
    --af-green-light-rgb: 123, 198, 126;
    --af-blue-light: #4EA8DE;
    --af-blue-light-rgb: 78, 168, 222;
    --af-gray-neutral: #6C757D;
    --af-gray-neutral-rgb: 108, 117, 125;

    /* Semantic Mappings */
    --af-green: var(--af-green-crescent);
    --af-orange: var(--af-yellow-gold);
    --af-blue-dark: var(--af-blue-deep);
    --af-blue-dark-rgb: var(--af-blue-deep-rgb);

    /* Override Corpox Global Variables */
    --color-primary: var(--af-green-crescent);
    --color-primary-alt: #238b7f;
    --color-secondary: var(--af-yellow-gold);
    --color-secondary-alt: #e6914d;
    --color-tertiary: var(--af-blue-deep);
    --color-tertiary-alt: var(--af-blue-light);

    /* Gradients Override - Harmonized with official colors */
    --gradient-1: linear-gradient(90deg, var(--af-green-crescent), var(--af-blue-deep));
    --gradient-7: linear-gradient(218.15deg, var(--af-yellow-gold) 0%, var(--af-blue-deep) 100%);
    --theme-gradient: linear-gradient(90deg, var(--af-green-crescent) 0%, var(--af-blue-deep) 100%);
}

/* Base Light Mode Overrides for AfrikData */
body.active-light-mode {
    background-color: var(--af-white) !important;
}

.active-light-mode {
    --color-heading: var(--af-blue-deep);
    --color-body: var(--af-gray-neutral);
    /* Secondary text in Gray */
    --color-primary: var(--af-green-crescent);
    --color-secondary: var(--af-yellow-gold);
    --color-white: #ffffff;
    --color-card: #ffffff;
    --color-border: rgba(var(--af-blue-deep-rgb), 0.1);
    --shadow-1: 0px 6px 34px rgba(var(--af-blue-deep-rgb), 0.1);
}

.text-green-accent {
    color: var(--af-green-crescent) !important;
}

.bg-primary-opacity {
    background: rgba(var(--af-green-crescent-rgb), 0.1) !important;
    color: var(--af-green-crescent) !important;
}

/* Specific Component Fixes */

.theme-gradient {
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Breadcrumb Styling */
.breadcrumb-area {
    background: linear-gradient(135deg, var(--af-blue-dark) 0%, #001f3f 100%);
    position: relative;
    overflow: hidden;
}

.breadcrumb-area::after {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(36, 113, 68, 0.05) 0%, transparent 70%);
    z-index: 1;
}

.breadcrumb-area * {
    position: relative;
    z-index: 2;
}

.breadcrumb-area .subtitle .number {
    color: var(--af-orange) !important;
}

.breadcrumb-area h1.title {
    color: #ffffff !important;
    font-size: 54px;
    line-height: 1.2;
}

/* Section Refinement */
.tmp-section-gap {
    padding: 100px 0;
}

.tmp-section-gapTop {
    padding-top: 100px;
}

.tmp-section-gapBottom {
    padding-bottom: 100px;
}

/* Specific override for brand section spacing */
.tmp-brand-area.tmp-section-gapBottom {
    padding-bottom: 20px !important;
}

.service-inner.service-style-two,
.tmp-card.portfolio,
.tmp-address,
.appoinment-form-wrapper {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Base for stretched-link */
    opacity: 1 !important;
    visibility: visible !important;
}

.service-inner.service-style-two .content,
.tmp-card.portfolio .content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.tmp-card.portfolio .inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-inner.service-style-two .content .title,
.tmp-card.portfolio .content .title {
    color: var(--af-blue-dark) !important;
    font-weight: 700 !important;
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.tmp-card.portfolio .thumbnail {
    position: relative;
    overflow: hidden;
    height: 280px;
    opacity: 1 !important;
    visibility: visible !important;
}

.tmp-card.portfolio .thumbnail img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease;
}

.tmp-card.portfolio:hover .thumbnail img {
    transform: scale(1.1);
}

.service-inner.service-style-two .content .description,
.tmp-card.portfolio .content .description {
    color: var(--af-gray-neutral);
    font-size: 15px;
    line-height: 24px;
    margin-bottom: 25px;
}

/* Stretched Link for Full Card Clickability */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    content: "";
}

.service-inner.service-style-two:hover,
.tmp-card.portfolio:hover,
.service-inner.service-style-horizontal:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
}

.tmp-address {
    background: var(--af-blue-dark) !important;
    padding: 40px !important;
    text-align: center;
    height: 100%;
}

/* Button Refinement */
.tmp-btn.tmp-btn-primary {
    background: var(--af-green) !important;
    border-color: var(--af-green) !important;
    color: #fff !important;
}

.tmp-btn.tmp-btn-primary:hover {
    background: var(--af-orange) !important;
    border-color: var(--af-orange) !important;
}

.cta-style-one.bg-cta-gradient {
    background: linear-gradient(135deg, var(--af-blue-deep) 0%, var(--af-green-crescent) 100%) !important;
}

.cta-style-one .tmp-btn.btn-white {
    background-color: var(--af-yellow-gold) !important;
    color: #fff !important;
    border-color: var(--af-yellow-gold) !important;
    font-weight: 600;
}

.cta-style-one .tmp-btn.btn-white:hover {
    background-color: var(--af-white) !important;
    color: var(--af-green-crescent) !important;
    border-color: var(--af-white) !important;
}

.tmp-btn.btn-border {
    border-color: var(--af-green) !important;
    color: var(--af-green) !important;
}

.tmp-btn.btn-border:hover {
    background: var(--af-green) !important;
    color: #fff !important;
}

/* Portfolio Filter */
.tmp-portfolio-filter {
    background: rgba(var(--af-blue-dark-rgb), 0.03);
    padding: 15px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 50px !important;
}

/* Visibility and Animation Safety */
[data-sal] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.service-inner.service-style-two,
.tmp-card.portfolio,
.tmp-why-choose-area,
.tmp-cta-area {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Portfolio Filters - Active State */
.tmp-portfolio-filter button.active {
    background: var(--af-green) !important;
    color: #ffffff !important;
    border-color: var(--af-green) !important;
}

.tmp-portfolio-filter button {
    border: none !important;
    background: transparent !important;
    padding: 10px 25px !important;
    border-radius: 30px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    color: var(--af-blue-dark) !important;
}

.tmp-portfolio-filter button.is-checked {
    background: var(--af-green) !important;
    color: #fff !important;
    box-shadow: 0 5px 15px rgba(36, 113, 68, 0.3);
}

.tmp-portfolio-filter button:hover:not(.is-checked) {
    background: rgba(36, 113, 68, 0.1) !important;
    color: var(--af-green) !important;
}

/* Badge Grouping */
.tmp-badge-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tmp-badge-2 {
    background: rgba(var(--af-green-rgb), 0.2) !important;
    color: var(--af-blue-deep) !important;
    padding: 2px 10px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.tmp-badge-2:hover {
    background: var(--af-green) !important;
    color: #fff !important;
}

/* Contact & Address Icons */
.tmp-address .icon {
    font-size: 40px;
    color: var(--af-orange) !important;
    background: transparent !important;
    margin-bottom: 20px;
}

/* Header & Typography */
.header-top-bar {
    background: var(--af-blue-dark) !important;
}

.tmp-footer {
    background-color: var(--af-blue-deep) !important;
    color: #ffffff !important;
}

.tmp-footer .tmp-footer-widget .title {
    color: #ffffff !important;
}

.tmp-footer .description,
.tmp-footer .footer-link a,
.tmp-footer .copyright-text {
    color: rgba(255, 255, 255, 0.8) !important;
}

.tmp-footer .footer-link a:hover {
    color: var(--af-green-crescent) !important;
}

.tmp-footer .copyright-area {
    background-color: rgba(0, 0, 0, 0.1) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Form Styling */
.appoinment-form-wrapper {
    padding: 50px;
    background: #ffffff;
}

.appoinment-form-wrapper input,
.appoinment-form-wrapper textarea {
    border-radius: 10px !important;
    border: 1px solid #eee !important;
    padding: 15px 20px !important;
    background: #f9f9f9 !important;
    color: var(--af-blue-dark) !important;
}

.appoinment-form-wrapper input:focus,
.appoinment-form-wrapper textarea:focus {
    border-color: var(--af-green) !important;
}

/* Process Section */
.single-process {
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.single-process .number-bg {
    font-size: 30px;
    font-weight: 800;
    color: var(--af-orange);
    opacity: 0.3;
}

/* Grid & Layout Fixes */
.portfolio-items.grid-metro3,
.masonry-list {
    width: 100% !important;
    display: block !important;
    margin: 0 auto !important;
    position: relative !important;
    clear: both;
}

.grid-metro3 .portfolio-3 {
    margin-bottom: 30px;
    float: left;
    /* Sécurité pour Isotope */
    display: flex !important;
    flex-direction: column;
    opacity: 1 !important;
    visibility: visible !important;
}

.grid-metro3 {
    margin-left: -15px !important;
    margin-right: -15px !important;
    width: calc(100% + 30px) !important;
    display: block !important;
}

.grid-metro3 .resizer {
    width: 33.33%;
}

@media (max-width: 991px) {
    .grid-metro3 .resizer {
        width: 50%;
    }
}

@media (max-width: 575px) {
    .grid-metro3 .resizer {
        width: 100%;
    }
}

/* Header & Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--af-blue-deep);
}

.color-primary,
.text-green-accent {
    color: var(--af-green-crescent) !important;
}

.bg-primary {
    background-color: var(--af-green-crescent) !important;
}

/* Banner Buttons - Image Style */
.ai-agency-demo-banner .tmp-btn.round {
    background-color: var(--af-green-crescent) !important;
    border-color: var(--af-green-crescent) !important;
}

.ai-agency-demo-banner .tmp-btn.btn-border {
    background: transparent !important;
    border: none !important;
    color: var(--af-blue-deep) !important;
    padding-left: 10px;
}

.ai-agency-demo-banner .tmp-btn.btn-border:hover {
    color: var(--af-green-crescent) !important;
}

/* AI Agency Specifics */
.ai-agency-demo-banner .banner-top-style {
    background: rgba(36, 113, 68, 0.1) !important;
    /* Transparent AF Green */
    border: 1px solid var(--af-green) !important;
}

.ai-agency-demo-banner .banner-top-style span {
    color: var(--af-green) !important;
}

/* Mobile Menu Fixes */
.popup-mobile-menu .inner .header-top {
    border-bottom: 2px solid var(--af-green);
}

/* Enhanced Mobile Menu Styles */
.popup-mobile-menu {
    z-index: 99999 !important;
}

.popup-mobile-menu .inner {
    background-color: var(--af-white) !important;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
}

.popup-mobile-menu .mainmenu li a {
    color: var(--af-blue-deep) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.popup-mobile-menu .mainmenu li a:hover,
.popup-mobile-menu .mainmenu li a.active {
    color: var(--af-green) !important;
    padding-left: 10px;
}

.popup-mobile-menu .mainmenu li+li {
    border-top: 1px solid rgba(var(--af-blue-deep-rgb), 0.1);
}

/* Mobile Menu Button - Ensure Visibility */
.mobile-menu-bar {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Hide hamburger button on desktop (large screens) */
@media only screen and (min-width: 992px) {
    .mobile-menu-bar {
        display: none !important;
    }
}

.hamberger-button {
    background: transparent !important;
    border: 2px solid var(--af-green) !important;
    color: var(--af-green) !important;
    width: 45px !important;
    height: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
}

.hamberger-button:hover {
    background: var(--af-green) !important;
    color: white !important;
}

.hamberger-button i {
    font-size: 24px !important;
}

/* Icône hamburger en pur CSS (fonctionne partout) */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    transition: all 0.3s ease;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animation au hover */
.hamberger-button:hover .hamburger-icon span:nth-child(1) {
    transform: translateY(-2px);
}

.hamberger-button:hover .hamburger-icon span:nth-child(3) {
    transform: translateY(2px);
}


/* Brand Carousel & Slick Dots */
.brand-list.brand-carousel-activation-ai {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body:not(.active-light-mode) .brand-list.brand-carousel-activation-ai li img {
    filter: brightness(0) invert(1);
}

.brand-list.brand-carousel-activation-ai li img {
    opacity: 0.7;
    transition: opacity 0.3s ease;
    max-height: 50px;
    width: auto !important;
    margin: 0 auto;
}

.brand-list.brand-carousel-activation-ai li img:hover {
    opacity: 1;
}

/* Slick Dots Styling */
.tmp-slick-dot .slick-dots {
    bottom: -40px;
    display: flex !important;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.tmp-slick-dot .slick-dots li {
    margin: 0 5px;
}

.tmp-slick-dot .slick-dots li button {
    font-size: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    transition: all 0.3s ease;
    padding: 0;
}

.tmp-slick-dot .slick-dots li.slick-active button {
    background: var(--af-orange);
    transform: scale(1.2);
}

/* Slick Arrows Styling */
.tmp-slick-arrow .slide-arrow {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.tmp-slick-arrow .slide-arrow:hover {
    background: var(--af-orange);
    color: #fff;
    border-color: var(--af-orange);
}

/* Responsive Fixes for Project Cards */
@media (max-width: 767px) {
    .single-modern-case-studies .inner-content-area {
        left: 20px !important;
        right: 20px !important;
        bottom: 20px !important;
        width: calc(100% - 40px) !important;
    }

    .single-modern-case-studies .inner-content-area a {
        min-width: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 10px 15px !important;
    }

    .single-modern-case-studies .inner-content-area a .title {
        font-size: 16px !important;
    }
}

@media (max-width: 575px) {
    .single-modern-case-studies {
        height: 350px !important;
    }

    .single-modern-case-studies .thumbnail {
        height: 100% !important;
    }

    .single-modern-case-studies .thumbnail img {
        height: 100% !important;
        object-fit: cover !important;
    }
}

/* ==========================================================================
   Fixed Header Implementation
   ========================================================================== */

/* Force header to be fixed at the top */
.tmp-header.header-sticky {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000 !important;
    transition: all 0.3s ease;
    background-color: var(--af-white) !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.tmp-header .logo-light,
.tmp-header .logo-dark {
    max-height: 300px !important;
    width: auto !important;
    transition: all 0.3s ease;
}

/* Align navigation in the center */
.mainmenu-nav {
    display: flex;
    justify-content: center;
}

.mainmenu-nav .mainmenu {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Ensure the header content is vertically centered */
.tmp-header .row {
    display: flex;
    align-items: center;
}

/* Precise alignment for header actions */
.header-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    /* Prevent vertical stack in French */
    gap: 10px !important;
    /* Reduced for better fit */
    height: 100% !important;
}

/* Force same height for both buttons and center them */
.header-right .tmp-btn {
    height: 40px !important;
    line-height: 1 !important;
    /* Reset line-height to let flexbox handle centering */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 12px !important;
    /* Slightly reduced padding */
    white-space: nowrap !important;
    /* Prevent text wrapping inside button */
}

/* Reduce navigation menu padding to give more room for buttons */
.mainmenu-nav .mainmenu>li>a {
    padding: 0 12px !important;
}

/* Ensure parents don't add unwanted height or padding */
.header-right .language-switcher,
.header-right .header-btn {
    display: flex !important;
    align-items: center !important;
    height: 40px !important;
    white-space: nowrap !important;
}

/* Responsive Header Adjustments */
@media only screen and (max-width: 991px) {
    .header-right .header-btn {
        display: none !important;
        /* Hide CTA button on mobile */
    }

    .mainmenu-nav {
        display: none !important;
        /* Hide desktop nav precisely at 991px */
    }

    .tmp-header .col-xl-3.col-lg-3 {
        width: auto !important;
        flex: 1;
        justify-content: flex-end;
    }
}

/* ==========================================================================
   Home Page Layout Refinement
   ========================================================================== */

/* Banner content positioning - Expert Architecture */
.ai-agency-demo-banner {
    display: flex !important;
    align-items: flex-start !important;
    /* Keep content high */
    height: auto !important;
    /* Let content determine height */
    min-height: 500px !important;
    /* Minimum visibility */
    padding-top: 100px !important;
    /* Header space + gap */
    padding-bottom: 0px !important;
    /* Space before next section */
}

/* Tablet & Laptop Ranges (Ensuring no overlap at 1016px) */
@media only screen and (max-width: 1199px) {
    .ai-agency-demo-banner {
        min-height: 550px !important;
        padding-top: 110px !important;
        padding-bottom: 40px !important;
    }
}

/* Mobile Banner Adjustments */
@media only screen and (max-width: 991px) {
    .ai-agency-demo-banner {
        padding-top: 0 !important;
        /* Flow behind navbar */
        min-height: 450px !important;
        padding-bottom: 30px !important;
    }

    .ai-agency-demo-banner .inner-content {
        margin-top: 100px !important;
        /* Visible below navbar */
    }
}

/* Services section - Expert spacing (Zero overlap) */
.tmp-cta-area.tmp-section-gapBottom {
    margin-top: 0 !important;
    /* Reset fragile negative margin */
    padding-top: 0 !important;
    padding-bottom: 5px !important;
    position: relative;
    z-index: 2;
}

@media only screen and (min-width: 992px) {
    .tmp-cta-area.tmp-section-gapBottom {
        margin-top: -30px !important;
        /* Very slight, safe overlap for aesthetic link */
    }
}

.header-right {
    gap: 15px !important;
}

@media only screen and (max-width: 575px) {
    .header-right {
        gap: 8px !important;
    }

}

/* Ensure mobile menu popup is hidden by default if theme depends on it */
.popup-mobile-menu {
    transition: all 0.4s ease-in-out;
    display: block !important;
    /* Ensure it's not display: none */
    visibility: hidden;
    opacity: 0;
    z-index: 99999 !important;
}

.popup-mobile-menu.active {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure menu is scrollable if content is too long */
.popup-mobile-menu .inner {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Overriding any bootstrap or theme margins */
.header-right .ml--20 {
    margin-left: 0 !important;
}

/* Fix for language switcher dropdown alignment */
.language-switcher .dropdown-toggle {
    margin-bottom: 0 !important;
}

/* Push page content down */
.page-wrapper {
    padding-top: 80px !important;
}

/* Adjust for mobile */
@media only screen and (max-width: 991px) {
    .tmp-header.header-sticky .container {
        height: auto;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .page-wrapper {
        padding-top: 70px !important;
    }
}