/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    color: #000;
    background-color: #fff;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ------------------------------------------------------------ */
/* Custom styles for smooth transitions and mega menu */
.head-mega-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.head-mega-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.head-mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.head-mobile-menu.active {
    transform: translateX(0);
}

.head-mobile-submenu {
    max-height: 0;
    overflow: hidden;
    /* transition is handled by Motion One */
}

/* JavaScript will dynamically set max-height */
/* Plus to minus effect - only affects icons at current level */
.head-mobile-nav-toggle svg {
    transition: transform 0.3s ease;
}

/* When expanded: hide vertical line (second path), keep horizontal line (first path) */
.head-mobile-nav-item.active>div>.head-mobile-nav-toggle svg path:last-child {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.head-mobile-nav-toggle svg path {
    transition: opacity 0.2s ease;
}

/* Desktop nav dropdown arrow rotation */
.head-nav-item:hover .head-dropdown-arrow,
.head-nav-item.active .head-dropdown-arrow {
    transform: rotate(180deg);
}

/* header end */

/* custom animations for smooth transitions */
.section2-transition {
    transition: background-color 0.5s ease;
}

/* svg animation styles */
#transform-gpu path {
    stroke-dasharray: 400;
    stroke-dashoffset: 0;
}

/* add inertial transition effect */
#desktopTitle {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#desktopTitleLine1,
#desktopTitleLine2 {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        color 0.5s ease;
}

#desktopImageContainer {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.6s ease;
}

#desktopCardsContainer {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#desktopCard1,
#desktopCard2,
#desktopCard3,
#desktopCard4 {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* hide scrollbar but keep functionality */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tab-header {
    transition: background-color 0.3s ease;
}

/* when a tab is hovered, all active tabs (except the hovered one) revert to their original color */
.group:has(.tab-header:hover) #tab-fx.tab-active:not(:hover) {
    background-color: #525252 !important;
}

.group:has(.tab-header:hover) #tab-metals.tab-active:not(:hover) {
    background-color: #212121 !important;
}

.group:has(.tab-header:hover) #tab-energy.tab-active:not(:hover) {
    background-color: #525252 !important;
}

.group:has(.tab-header:hover) #tab-stocks.tab-active:not(:hover) {
    background-color: #212121 !important;
}

.group:has(.tab-header:hover) #tab-indices.tab-active:not(:hover) {
    background-color: #525252 !important;
}

.group:has(.tab-header:hover) #tab-crypto.tab-active:not(:hover) {
    background-color: #212121 !important;
}

/* hover tab show active color */
.tab-header:hover {
    background-color: #3660fd !important;
}

/* mobile display/hide control */
@media (max-width: 768px) {
    .desktop-tabs {
        display: none !important;
    }

    .mobile-select-header {
        display: flex !important;
    }

    .desktop-table {
        display: none !important;
    }

    .mobile-table {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .desktop-tabs {
        display: table-row !important;
    }

    .mobile-select-header {
        display: none !important;
    }

    .desktop-table {
        display: table !important;
    }

    .mobile-table {
        display: none !important;
    }
}

/* mobile select style reset */
.mobile-category-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

.mobile-category-select:focus {
    outline: none;
    border: none;
}

.mobile-category-select option {
    background: #212121;
    color: white;
}

/* scrollbar optimization */
.mobile-table-scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mobile-table-scroll::-webkit-scrollbar {
    display: none;
}

/* Live Chat Widget */
@media (max-width: 768px) {
    #chat-widget-minimized {
        scale: 0.75 !important;
        transform-origin: bottom right !important;
    }
}

/* Trading Products Page start */
.tab-button {
    transition: all 0.3s ease;
}

.tab-button.active {
    background-color: #3660fd;
    color: white;
}

.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.tooltip-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border: 1px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-trigger:hover~.tooltip-text,
.tooltip-trigger:focus~.tooltip-text {
    opacity: 1;
    visibility: visible;
}

.tooltip:hover .tooltip-text,.tooltip:hover~.tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 200px;
    background-color: #3660fd;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 6px 12px;
    position: absolute;
    z-index: 50;
    top: 100%;
    margin-top: 8px;
    transition: opacity 0.2s, visibility 0.2s;
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    white-space: nowrap;
    width: fit-content;
}

.tooltip-text::before {
    content: '';
    position: absolute;
    top: -5px;
    
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #3660fd;
}

/* Ensure tooltip stays within viewport on small screens */
@media (min-width: 1900.1px) {
    .tooltip-text,
    .tooltip-text::before
    {
        left: 50% !important;
        transform: translateX(-50%);
    }
}
@media (max-width: 1900px) {
    .tooltip-text
    {
        right: 0px !important;
    }
    .tooltip-text::before{
        right: 6px !important;
    }
}

[style*="transform-style: preserve-3d"] {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

/* Active state styles for accordion */
.accordion-item.active .accordion-question {
    color: #3660fd;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-item.active .accordion-content {
    opacity: 1;
}

/* Trading Products Page end */


/* Underline highlight style start */
.under-yellow{
    position: relative;
    display: inline-block;
}
.under-yellow::after{
    content: '';
    position: absolute;
    left: 0;
    bottom: 1px;
    width: 100%;
    height: 7px;
    background-color: yellow;
    z-index: -1;
}
/* Underline highlight style end */