/* =====================================================================
   FXIFY Markets header — ported to match fxify.com .site-header visual.
   Structure mirrors fxify.com (.site-header > .main-header > .main-navigation),
   driven by the existing Statamic navigation + dropdown content.
   Loaded after main.css so it overrides the legacy Bootstrap navbar styles.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --fxm-bg: #0E1017;
    --fxm-panel: #0c0d11;
    --fxm-accent: #1DAA91;
    --fxm-accent-soft: #D4F7F1;
    --fxm-border: rgba(194, 208, 228, 0.15);
    --fxm-font: "Plus Jakarta Sans", sans-serif;
}

/* ---- hide the legacy bootstrap navbar / mobile_nav, we replace them ---- */
.navigation_wrapper .navbar,
.navigation_wrapper .mobile_nav { display: none !important; }

/* The disclaimer top-bar lives in normal flow inside the wrapper, so it scrolls
   away with the page (never sticky). Interior pages are light, so the wrapper is
   a solid dark band that keeps the (white-text) disclaimer bar readable. */
.navigation_wrapper {
    position: relative;
    width: 100%;
    background: var(--fxm-bg);
    z-index: 1000;
}

/* Homepage: the whole nav overlays the dark hero, so no band — the disclaimer
   bar sits transparently over the hero and scrolls away as the page moves. */
.homepage .navigation_wrapper {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
}

/* ---- the bar: only the header sticks ----------------------------------- */
/* Interior pages have light backgrounds, so the header sticks on a solid dark
   band (the bg lives on the header itself so it stays when pinned). */
.fxm-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: var(--fxm-bg);
    font-family: var(--fxm-font);
}

/* Homepage has a dark hero, so — exactly like fxify.com — the header floats
   transparently over the hero (JS keeps it below the disclaimer bar until that
   scrolls away, then pins it to the top and fades in the glass background). */
.homepage .fxm-site-header {
    position: fixed;
    top: 0;
    left: 0;
    background: transparent;
}

.fxm-site-header .main-header {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    max-width: calc(100% - 100px);
    margin: 14px auto 0;
    padding: 22px 30px;
    /* transparent in the inactive state — the glass panel appears once scrolled */
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
    transition: background 0.45s ease, backdrop-filter 0.45s ease, border-color 0.45s ease;
}

/* Glass background fades in once scrolled (homepage only — interior pages
   already sit on a solid dark band). */
.homepage .fxm-site-header.scrolled .main-header {
    background: rgba(12, 13, 17, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1350px) {
    .fxm-site-header .main-header {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 16px;
    }
}

/* ---- logo (render the black FXIFY wordmark in white) ------------------- */
.fxm-site-header .main-header .logo {
    position: relative;
    z-index: 998;
    flex-shrink: 0;
    margin: 0;
    line-height: 0;
}

.fxm-site-header .main-header .logo a {
    display: flex;
    align-items: center;
}

.fxm-site-header .main-header .logo a img {
    width: auto;
    height: 25px;
    /* the asset is a black wordmark; invert it to white for the dark bar */
    filter: brightness(0) invert(1);
}

@media (min-width: 992px) and (max-width: 1560px) {
    .fxm-site-header .main-header { gap: 10px; }
    .fxm-site-header .main-header .logo a img { height: 21px; }
}

/* ---- primary navigation ----------------------------------------------- */
.fxm-site-header .main-header .main-navigation {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.fxm-site-header .main-header .main-navigation ul#primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.fxm-site-header .main-header .main-navigation ul#primary-menu > li {
    margin: 0 18px;
    font-family: var(--fxm-font);
    letter-spacing: 0.2px;
    transition: all 0.5s ease-in-out;
    position: relative;
}

.fxm-site-header .main-header .main-navigation ul#primary-menu > li > a {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    transition: color 0.4s ease-in-out;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    white-space: nowrap;
}

.fxm-site-header .main-header .main-navigation ul#primary-menu > li.current-menu-item > a,
.fxm-site-header .main-header .main-navigation ul#primary-menu > li:hover > a {
    color: var(--fxm-accent);
}

/* caret on items that have a dropdown */
.fxm-site-header .main-navigation .menu-item-has-children > a::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transform-origin: center;
    margin-left: 2px;
    margin-top: -3px;
    transition: transform 0.4s ease;
    opacity: 0.8;
}
.fxm-site-header .main-navigation .menu-item-has-children:hover > a::after {
    transform: rotate(225deg);
    margin-top: 2px;
}

/* ---- dropdown panel (fxify dark-glass aesthetic) ---------------------- */
.fxm-site-header .main-navigation .fxm-dropdown {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    top: 100%;
    margin-top: 18px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* bridge the gap so hover doesn't drop while moving to the panel */
.fxm-site-header .main-navigation .menu-item-has-children::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 24px;
}

.fxm-site-header .main-navigation .menu-item-has-children:hover .fxm-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.fxm-site-header .main-navigation .fxm-dropdown .bg-wrapper {
    position: relative;
    padding: 1.5rem;
    border: 1px solid var(--fxm-border);
    border-radius: 15px;
    background-color: var(--fxm-panel);
    display: flex;
    flex-flow: row nowrap;
    gap: 2.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* little triangle pointer, like fxify */
.fxm-site-header .main-navigation .fxm-dropdown .bg-wrapper::before {
    content: "";
    display: block;
    height: 18px;
    width: 18px;
    background-color: var(--fxm-panel);
    border-top: 1px solid var(--fxm-border);
    border-left: 1px solid var(--fxm-border);
    position: absolute;
    top: -10px;
    left: calc(50% - 9px);
    transform: rotate(45deg);
    border-radius: 4px 0 0 0;
}

.fxm-site-header .main-navigation .fxm-dropdown .section {
    display: flex;
    flex-flow: column nowrap;
    min-width: 170px;
}

.fxm-site-header .main-navigation .fxm-dropdown .section .heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--fxm-accent-soft);
    opacity: 0.7;
    margin: 0 0 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fxm-site-header .main-navigation .fxm-dropdown .section .icon_wrapper img {
    height: 18px;
    width: auto;
}

.fxm-site-header .main-navigation .fxm-dropdown .section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-flow: column nowrap;
    gap: 2px;
}

.fxm-site-header .main-navigation .fxm-dropdown .section ul li { margin: 0; }

.fxm-site-header .main-navigation .fxm-dropdown .section ul li a {
    display: block;
    padding: 9px 12px;
    margin: 0 -12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.fxm-site-header .main-navigation .fxm-dropdown .section ul li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(3px);
}

/* ---- primary CTA ------------------------------------------------------- */
.fxm-site-header .main-header .login-cta-normal {
    display: flex;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    font-family: var(--fxm-font);
    transition: all 0.7s ease-in-out;
}

.fxm-site-header .main-header .login-cta-normal a {
    padding: 12px 24px;
    gap: 10px;
    background: var(--fxm-accent);
    border-radius: 10px;
    letter-spacing: 0.3px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b0c10;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.5s ease, transform 0.3s ease;
}
.fxm-site-header .main-header .login-cta-normal:hover a { opacity: 0.85; }

@media (max-width: 992px) {
    .fxm-site-header .main-header .login-cta-normal { display: none; }
    /* hide the desktop nav on mobile — the hamburger + slide-down menu replace it */
    .fxm-site-header .main-header .main-navigation { display: none; }
}

/* ---- hamburger (mobile) ----------------------------------------------- */
.fxm-site-header .mobile-menu-btn-wrapper {
    display: none;
    width: 28px;
    height: 22px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .fxm-site-header .mobile-menu-btn-wrapper { display: block; }
}

.fxm-site-header .mobile-menu-btn-wrapper .menu-line,
.fxm-site-header .mobile-menu-btn-wrapper .menu-line::before,
.fxm-site-header .mobile-menu-btn-wrapper .menu-line::after {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.35s ease;
}
.fxm-site-header .mobile-menu-btn-wrapper .menu-line { top: 50%; transform: translateY(-50%); }
.fxm-site-header .mobile-menu-btn-wrapper .menu-line::before { content: ""; top: -8px; }
.fxm-site-header .mobile-menu-btn-wrapper .menu-line::after { content: ""; top: 8px; }

.fxm-site-header .mobile-menu-btn-wrapper.active .menu-line { background: transparent; }
.fxm-site-header .mobile-menu-btn-wrapper.active .menu-line::before { top: 0; transform: rotate(45deg); }
.fxm-site-header .mobile-menu-btn-wrapper.active .menu-line::after { top: 0; transform: rotate(-45deg); }

/* ---- mobile slide-down menu ------------------------------------------- */
.fxm-mobile-menu {
    display: none;
    font-family: var(--fxm-font);
}

@media (max-width: 992px) {
    .fxm-mobile-menu {
        display: block;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.45s ease;
        background: var(--fxm-panel);
        margin: 0 0 0;
    }
    .fxm-mobile-menu.open { max-height: 85vh; overflow-y: auto; }

    .fxm-mobile-menu .mm__inner { padding: 8px 20px 28px; }

    .fxm-mobile-menu .mm__group { border-bottom: 1px solid var(--fxm-border); padding: 14px 0; }
    .fxm-mobile-menu .mm__group > a,
    .fxm-mobile-menu .mm__group > span {
        color: #fff; font-size: 17px; font-weight: 600; text-decoration: none; display: block;
    }
    .fxm-mobile-menu .mm__group .heading {
        color: var(--fxm-accent-soft); opacity: 0.6; text-transform: uppercase;
        font-size: 11px; letter-spacing: 1px; margin: 14px 0 6px;
    }
    .fxm-mobile-menu .mm__group ul { list-style: none; margin: 0; padding: 0; }
    .fxm-mobile-menu .mm__group ul li a {
        color: rgba(255,255,255,0.75); font-size: 15px; text-decoration: none;
        display: block; padding: 8px 0;
    }
    .fxm-mobile-menu .mm__cta {
        display: block; text-align: center; margin: 20px 0 4px; padding: 14px 24px;
        background: var(--fxm-accent); color: #fff; border-radius: 10px;
        font-weight: 600; text-decoration: none;
    }
}

/* hide the icons to the left of dropdown section titles (e.g. Platforms MT5 / FIX API) */
.fxm-site-header .main-navigation .fxm-dropdown .section .heading .icon_wrapper { display: none !important; }
