/* ==============================================
   LAYOUT SHIFT (CLS) PREVENTION
   ============================================== */

/* Main container - reserve minimum viewport height */
main {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    display: block;
    contain: layout style;
}

/* Hero section - reserve space for video/background content */

/* Ensure hero video/poster doesn't cause reflow */
.section-hero video,
.section-hero > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home .section-hero {
    min-height: 457px;
    contain: layout style;
}

.home .section-hero .hero-content {
    min-height: 456px;
}

.home .section-hero .hero-inner-content {
    min-height: 312px;
}

/* Hero stats container - reserve space on desktop to prevent CLS */
@media (min-width: 768px) {
    .home .section-hero {
        min-height: 635px;
        contain: layout style;
    }

    .home .section-hero .hero-content {
        min-height: 634px;
    }

    .home .section-hero .hero-inner-content {
        min-height: 442px;
    }

    .home .hero-stats-container {
        min-height: 104.5px;
        contain: style;
    }
}

/* @media (min-width: 768px) {
    .section-hero {
        min-height: 600px;
    }
} */

/* Header container - prevent layout recalculation affecting main */
#header {
    contain: layout style;
}

#main-container {
    contain: style;
}

/* Mega menu - prevent CLS from menu items loading */
/* Note: Using contain: style only (not layout) to allow nav-submenu-container full viewport width */
#mega-menu-full {
    contain: style;
    min-height: 48px;
}

/* Navigation menu list - ensure visibility on initial paint */
/* .nav-menu-list {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu-list .nav-list-item {
    display: flex;
    align-items: center;
    position: relative;
} */

/* Navigation submenu - initially hidden */
.nav-menu-dropdown {
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Help center container - reserve space to prevent CLS */
.help-center-container {
    min-height: 20px;
    contain: style;
}

/* Device images - add aspect-ratio to prevent CLS "unsized image" warning */
/* aspect-ratio allows browser to reserve space even with width/height: auto */
/* #device-laptop {
    aspect-ratio: 1080 / 958;
}

#device-tablet,
#device-tablet-2 {
    aspect-ratio: 947 / 786;
}

#device-mobile,
#device-mobile-2 {
    aspect-ratio: 642 / 728;
} */

/* ==============================================
   END LAYOUT SHIFT PREVENTION
   ============================================== */

/* ==============================================
   FORCED REFLOW PREVENTION - Navigation Animations
   Use will-change to hint browser about upcoming transforms
   ============================================== */

/* Desktop submenu - prepare for opacity/transform animations */
.nav-menu-dropdown {
    will-change: opacity, visibility;
    backface-visibility: hidden;
    transform: translateZ(0); /* Force GPU layer */
}

.nav-menu-dropdown .submenu-list li {
    will-change: opacity, transform;
    backface-visibility: hidden;
}

/* Mobile navigation - prepare for animations */
.mobile-nav-sheet {
    will-change: opacity, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.mobile-nav-item {
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.mobile-submenu-panel {
    will-change: opacity, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.mobile-submenu-item,
.mobile-submenu-category,
.mobile-submenu-links li {
    will-change: opacity, transform;
    backface-visibility: hidden;
}

/* ==============================================
   END FORCED REFLOW PREVENTION
   ============================================== */

strong {
    color: var(--color-gray-900);
}

.mark-t-code {
    background-color: yellow !important;
    color: red !important;
    -webkit-text-fill-color: red !important;
}


/* MENU */

/* LANGUAGE DROPDOWN */

[id^="dropdown-language-button-"] {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    padding-left: 10px;
    padding-right: 10px;
}

[id^="dropdown-language-button-"]:hover {
    background-color: #f3f4f6;
}

[id^="dropdown-language-"] {
    max-height: 350px;
    overflow-y: auto;
}

[id^="dropdown-language-"] ul {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

[id^="dropdown-language-"] li {
    margin: 0;
    padding: 0px 5px;
}

[id^="dropdown-language-"] li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    border-radius: 6px;
}

[id^="dropdown-language-"] li a:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

[id^="dropdown-language-"].hidden {
    display: none;
}

#dropdown-language-mobile {
    max-height: 130px;
    left: 0;
}

/* Ensure dropdown container has relative positioning */
/* Reserve explicit width to prevent CLS */
.language-dropdown-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 100px;
    min-height: 40px;
}

/* Language dropdown button - reserve consistent width to prevent CLS */
[id^="dropdown-language-button-"] {
    min-width: 126px;
    min-height: 40px;
    justify-content: flex-start;
    contain: layout style;
}

/* Language text span - ensure consistent width */
[id^="dropdown-language-button-"] > span:not(.flag-icon) {
    min-width: 56px;
    display: inline-block;
    text-align: left;
}

/* Flag icon styling */
.language-dropdown-container .flag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.language-dropdown-container .flag-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Button text styling */
[id^="dropdown-language-button-"] span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.language-select-block {
    position: relative;
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
}

.language-selector {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.language-select-block .block-opener {
    padding: 0 5px 0 9px;
    border-radius: 4px;
    min-height: 30px;
    border: 1px solid var(--white);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex
;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: var(--white);
}

.language-select-block .block-opener .btn-icon {
    width: 16px;
    height: 16px;
    margin-right: 3px;
    fill: currentcolor;
    display: block;
    -webkit-box-flex: 0;
    -ms-flex: none;
    flex: none;
}

.language-select-block .block-opener .btn-text {
    font-size: 14px;
    line-height: 2;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
    color: var(--white);
}

.language-select-block .block-list {
    width: auto;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    border-radius: 4px;
    background: var(--white);
    z-index: 10;
    -webkit-transition: all var(--t);
    -o-transition: all var(--t);
    transition: all var(--t);
    -webkit-transform: translateY(16px);
    -ms-transform: translateY(16px);
    transform: translateY(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    -webkit-box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
}

.language-select-block .block-list:before {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    position: absolute;
    left: 0;
    bottom: 100%;
}

.lang-item {
    white-space: nowrap;
}

.language-select-block .block-list li a {
    font-size: 14px;
    line-height: 2;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
    color: var(--white);
    color: var(--text-dark);
    padding: 0 10px;
    text-align: center;
    display: block;
}

.language-selector svg {
    vertical-align: middle;
    max-width: 20px;
}


/* SWIPER */
.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet, .swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet {
    margin: 0 10px;
}


/* HOME */

.easy-access-col-img {
    position: relative;
}

.easy-access-col-img img {
    height: auto;
    margin: auto;
    position: relative;
    max-width: 300px;
}

.easy-access-col-img {
    /* height: 320px; */
    /* overflow: hidden; */
}

@media (min-width: 576px) and (max-width: 1024px) {

    .easy-access-col-img {
        -webkit-order: -1;
        -ms-flex-order: -1;
        order: -1;
        grid-column: span 2;
        position: relative;
    }

    .easy-access-col-img img {
        margin: auto;
        position: relative;
    }

}

@media (min-width: 1024px) {

    .easy-access-col-img {
        height: auto;
    }

    .easy-access-col-img img {
        /* position: absolute;
        bottom: 0; */
        max-width: 100%;
        width: 100%;
    }

}

@media (max-width: 576px) {

    .easy-access-col-img img {
        max-width: 180px;
    }

}


/* FOOTER */

#footer .language-selector {
    justify-content: left;
}

@media (min-width: 768px) {

    #footer .footer-content-right {
        text-align: right;
    }

    #footer .language-selector {
        justify-content: right;
    }

}



/* FAQ */
#section-faqs button[aria-expanded="true"] svg.icon-question {
    color: var(--color-primary-600);
}

#section-faqs button[aria-expanded="false"] svg.icon-question {
    color: var(--color-primary-500);
}



/* PAYMENT PARTNERS */
.container-payment-partners-logos {
    display:flex;
    flex-wrap:wrap;
    justify-content:space-around;
}

/* Container for both rows */
.payment-partners-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* First row: 5 columns */
.payment-partners-row-1 {
    justify-self: center;
    max-width: 100%;
}

/* Second row: 4 columns */
.payment-partners-row-2 {
    justify-self: center;
    /* max-width: 80%;  */
    /* Slightly narrower to center the 4 items */
    margin: 0 auto;
}

/* Payment partner items */
.payment-partners-item {
    width: 100%;
    max-width: 140px;
    height: 60px;
    transition: all 0.3s ease;
}

.payment-partners-row-3 .payment-partners-item {
    background: none;
}

/* Tablet styles */
@media (min-width: 640px) {
    .payment-partners-item {
        max-width: 160px;
        height: 70px;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .payment-partners-container {
        /* gap: 3rem;  */
        /* Larger gap between rows on desktop */
    }
    
    .payment-partners-row-1,
    .payment-partners-row-2 {
        /* gap: 2rem;  */
        /* Consistent gap between items */
    }
    
    .payment-partners-row-2 {
        /* max-width: 75%;  */
        /* Adjust width for better centering */
    }
    
    .payment-partners-item {
        max-width: 180px;
        height: 80px;
    }
    
    .payment-partners-item img {
        max-height: 70px;
    }
}

/* Tablet improvements */
@media (min-width: 640px) and (max-width: 1023px) {
    .container-payment-partners-logos {
        max-width: 600px;
        margin: 0 auto;
        /* gap: 1.5rem; */
    }
    
    .payment-partners-item img {
        max-height: 60px;
    }
}

@media (max-width: 768px) {
    .payment-partners-item {
        padding: 10px;
    }
}

/* Mobile improvements */
@media (max-width: 639px) {
    .container-payment-partners-logos {
        max-width: 400px;
        margin: 0 auto;
        /* gap: 1rem; */
    }
    
    .payment-partners-item {
        max-width: 140px !important;
        height: 60px !important;
    }
    
    .payment-partners-item img {
        max-height: 50px;
    }

    .payment-partners-row-3 {
        justify-self: center;
        max-width: 50%; 
        /* Slightly narrower to center the 4 items */
        margin: 0 auto;
    }
}

@media (max-width: 425px) {
    .payment-partners-item {
        padding: 0px;
    }
}


/* NEWSLETTER */
#newsletter-message {
    display: none;
}

#newsletter-message.success {
    display: block;
    color: var(--color-green-700);
}

#newsletter-message.error {
    display: block;
    color: var(--color-red-700);
}


.bg-top {
    background-position: top !important;
}


/* MARKETS DATA */
.section-datatable-markets-data iframe {
    width: 100%;
    height: 800px;
}

.section-datatable-markets-data-featured iframe {
    height: 600px;
}

.section-datatable-markets-data-indices iframe {
    height: 700px;
}

.section-datatable-markets-data-crypto-cfds iframe {
    height: 450px;
}

.section-datatable-markets-data-spot-metals iframe,
.section-datatable-markets-data-energies iframe {
    height: 400px;
}

@media (max-width: 768px) {
    .section-datatable-markets-data-featured iframe {
        height: 720px;
    }

    .section-datatable-markets-data-forex iframe,
    .section-datatable-markets-data-share-cfds iframe {
        height: 1100px;
    }

    .section-datatable-markets-data-indices iframe {
        height: 860px;
    }

    .section-datatable-markets-data-crypto-cfds iframe {
        height: 550px;
    }

    .section-datatable-markets-data-spot-metals iframe,
    .section-datatable-markets-data-energies iframe {
        height: 400px;
    }
}

.single-post article ul,
.single-post article li,
.single-post .list-disc ul,
.single-post .list-disc li,
.single-post ul.list-bullet,
.single-post ul.list-bullet li,
.single-post ul.list-bullet1,
.single-post ul.list-bullet1 li {
    list-style-type: disc;
}

.single-post article h2,
.single-post article h3,
.single-post article h4,
.single-post article h5,
.single-post article h6 {
    color: var(--color-gray-900);
}

body.wp-singular {
    overflow-y: auto !important;
}

.popup-modal {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Fix Flowbite modal backdrop blocking clicks */
[class*="bg-dark-backdrop"] {
    pointer-events: none !important;
    z-index: 9998 !important;
}

.popup-modal:not(.hidden) {
    z-index: 9999 !important;
    pointer-events: auto !important;
}

.popup-modal:not(.hidden) [data-modal-content] {
    pointer-events: auto !important;
    opacity: 1 !important;
    transform: scale(1) !important;
}

.popup-modal [data-modal-content] * {
    pointer-events: auto !important;
}

/* Lower header/footer z-index when modal is open */
body:has([class*="bg-dark-backdrop"]) .nav-container,
body:has([class*="bg-dark-backdrop"]) header,
body:has([class*="bg-dark-backdrop"]) footer,
body.overflow-hidden .nav-container,
body.overflow-hidden header,
body.overflow-hidden footer {
    z-index: 1 !important;
}

.tabs-header-container ul {
    border-radius: 8px;
}

.tabs-header-container button[aria-selected="true"] {
    background-color: var(--color-primary-600);
    color: var(--color-white);
}

.tabs-header-container button[aria-selected="false"] {
    background-color: var(--color-gray-100);
    color: var(--color-gray-900);
}

.tabs-header-container button:last-child {
    border-right: 1px solid var(--color-gray-200);
}

.tabs-header-container button[aria-selected="false"]:hover {
    background-color: var(--color-gray-200);
}

.table-content-container {
    padding: 0 20px 0 20px;
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
}

.table-content-container table tr:last-child {
    border-bottom: none;
}

/* ==============================================
   TABLE OF CONTENTS (TOC) SHORTCODE
   ============================================== */

.post-content .fxt-toc,
.fxt-toc {
    background-color: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    margin-bottom: 1.5rem !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.fxt-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
}

.fxt-toc-header:hover {
    background-color: #f3f4f6;
}

.fxt-toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.fxt-toc-toggle {
    color: #6b7280;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.fxt-toc-toggle.rotate-180 {
    transform: rotate(180deg);
}

.fxt-toc-nav {
    display: block;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    padding: 0 1.25rem 1rem;
    opacity: 1;
}

.fxt-toc.collapsed .fxt-toc-nav {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    visibility: hidden;
}

.fxt-toc-list {
    list-style: decimal;
    margin: 0;
    padding-left: 1.25rem;
}

.fxt-toc-item {
    margin-bottom: 0.5rem;
}

.fxt-toc-item:last-child {
    margin-bottom: 0;
}

.fxt-toc-link {
    color: #1a56db;
    text-decoration: none;
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.fxt-toc-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* Dark mode support */
.dark .fxt-toc {
    background-color: #1f2937;
    border-color: #374151;
}

.dark .fxt-toc-header:hover {
    background-color: #374151;
}

.dark .fxt-toc-title {
    color: #f9fafb;
}

.dark .fxt-toc-toggle {
    color: #9ca3af;
}

.dark .fxt-toc-link {
    color: #60a5fa;
}

.dark .fxt-toc-link:hover {
    color: #93c5fd;
}

/* Scroll margin for TOC anchor targets - ensures headings appear below sticky header */
[id^="toc-heading-"] {
    scroll-margin-top: 150px;
}