/* Header Styles */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    z-index: 998; /* Set z-index lower than crypto ticker */
    position: relative; /* Changed from fixed to relative */
    margin-top: 0; /* Ensure no top margin on header */
    padding-top: 0; /* Ensure no top padding on header */
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 20px;
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo img {
    max-height: 32px;
    width: auto;
    margin-right: 100px;
}

/* Navigation */
.main-navigation {
    display: flex;
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu li {
    position: relative;
    margin: 0 12px;
}

.primary-menu a {
    display: block;
    color: #111111;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0;
    text-transform: uppercase;
    position: relative;
}

.primary-menu a:hover {
    color: #3861fb;
}

.primary-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3861fb;
    transition: width 0.2s ease;
}

.primary-menu a:hover::after,
.primary-menu .current-menu-item a::after {
    width: 100%;
}

/* Dropdown Menu */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: -10px;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px 0;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu li {
    margin: 0;
    width: 100%;
}

.primary-menu .sub-menu a {
    padding: 8px 20px;
    font-size: 13px;
    text-transform: none;
}

.primary-menu .sub-menu a::after {
    display: none;
}

/* Header Right Area */
.header-right {
    display: flex;
    align-items: center;
}

.search-toggle {
    background: none;
    border: none;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.search-toggle:hover {
    color: #3861fb;
}

.social-icons {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.social-icons a {
    color: #111111;
    font-size: 16px;
    margin-left: 12px;
}

.social-icons a:hover {
    color: #3861fb;
}

/* Search Form Container */
.search-form-container {
    position: relative;
    display: inline-block;
}

/* Search Form - Modified to open horizontally to the right */
.search-form {
    position: absolute;
    top: 0;
    right: 100%; /* Position to the left of the toggle button */
    width: 0; /* Start with width 0 */
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* When active, expand to the left */
.search-form.active {
    width: 200px; /* Expanded width */
    opacity: 1;
}

.search-field {
    width: 100%;
    padding: 8px 40px 8px 12px;
    border: none;
    font-size: 14px;
    background: transparent;
}

.search-field:focus {
    outline: none;
}

.search-submit {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: none;
    border: none;
    color: #666;
    padding: 0 10px;
    font-size: 14px;
    cursor: pointer;
}

.search-submit:hover {
    color: #3861fb;
}

/* Mobile Menu Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #111111;
    cursor: pointer;
    font-size: 24px;
    padding: 5px;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: #ffffff;
        padding: 20px;
        box-sizing: border-box;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
    }

    .main-navigation.active {
        transform: translateX(0);
    }

    .primary-menu {
        flex-direction: column;
    }

    .primary-menu li {
        margin: 0;
        width: 100%;
    }

    .primary-menu a {
        padding: 12px 0;
        border-bottom: 1px solid #eaeaea;
    }

    .primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 20px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .primary-menu li.active > .sub-menu {
        max-height: 500px;
    }

    .dropdown-toggle {
        display: block;
        position: absolute;
        right: 0;
        top: 5px;
        background: none;
        border: none;
        color: #111111;
        font-size: 20px;
        padding: 5px;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 20px; /* Add spacing between social icons and burger menu */
    }
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 50px; /* Shifted down slightly to avoid overlap */
    left: 0;
    width: 100%;
    height: calc(100% - 50px); /* Adjust height to account for the shift */
    background-color: #074799;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-close:hover {
    color: #39ff14;
}

/* Adjusted menu list position */
.mobile-menu-list {
    margin-top: 40px; /* Add margin to push items further down */
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-menu-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); /* Add subtle dividers */
    padding-bottom: 10px;
}

.mobile-menu-list li:last-child {
    border-bottom: none; /* Remove divider for the last item */
}

.mobile-menu-list li a {
    color: #ffffff; /* White text */
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-menu-list li a:hover {
    color: #39ff14; /* Neon green on hover */
}

.mobile-menu-toggle {
    background: none;
    border: none;
    color: #333;
    font-size: 24px;
    cursor: pointer;
    display: none;
}

.mobile-menu-toggle.active {
    color: #074799;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
    }
}

/* Show mobile menu when active */
.mobile-menu.active {
    display: block;
}

/* Slide-in animation for mobile menu */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}
