/* --- Dynamic Header Styles --- */
#dynamic-header {
    width: 100%;
    transition: all 0.3s ease;
    padding: 0;
}

#dynamic-header.transparent-header {
    background: transparent;
    color: white;
}

#dynamic-header.sticky-header {
    background: white;
    color: #1a1a1a;

}

.btc-header-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 48px;
    gap: 40px;
}

/* Menu Section */
.btc-header-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.btc-menu-item {
    position: relative;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    color: inherit;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
}

.btc-menu-item:hover:not(.btc-menu-item-dropdown) {
    opacity: 0.8;
}

.btc-menu-item i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.btc-menu-item-dropdown:hover i {
    transform: rotate(180deg);
}

/* Header State Specific Hover Colors */
#dynamic-header.transparent-header .btc-menu-item:hover {
    color: #e1e1e1;
    opacity: 1;
}

#dynamic-header.sticky-header .btc-menu-item:hover {
    color: var(--btc-blue, #006CE4);
    opacity: 1;
}

/* Mega Menu Dropdown */
.btc-menu-item-dropdown {
    cursor: pointer;
    position: relative;
}

.btc-mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    margin-top: 0;
    padding-top: 8px;
    background: rgba(11, 29, 38, 0.75) !important;
    background-color: rgba(11, 29, 38, 0.75) !important;
    background-image: none !important;
    border-radius: 16px;
    padding: 16px;
    min-width: 480px;
    opacity: 1 !important;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 999;
    /* Frosted glass effect */
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    /* Ensure no parent opacity affects this */
    isolation: isolate;
}

/* Removed solid overlay to allow frosted glass effect */

/* Ensure mega menu content area is also opaque */
.btc-mega-menu-grid {
    background: transparent;
    position: relative;
    z-index: 1;
}

.btc-mega-menu-list {
    background: transparent;
    position: relative;
    z-index: 1;
}

/* Invisible hover bridge area at top of mega menu */
.btc-mega-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
    pointer-events: auto;
    z-index: 2;
}

.btc-mega-menu-grid,
.btc-mega-menu-list {
    background-color: transparent !important;
}

/* Keep menu open when hovering over dropdown or menu */
.btc-menu-item-dropdown:hover .btc-mega-menu {
    transform: translateX(-50%) translateY(0);
    visibility: visible;
    pointer-events: all;
    opacity: 1 !important;
}

.btc-mega-menu:hover {
    transform: translateX(-50%) translateY(0);
    visibility: visible;
    pointer-events: all;
    opacity: 1 !important;
}

.btc-mega-menu-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px;
}

.btc-mega-menu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
}

.btc-mega-menu-item {
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #b0b7bb;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: block;
}

.btc-mega-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.btc-mega-menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
}

.btc-mega-menu-image {
    width: 200px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(4deg);
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    margin: 16px;
    align-self: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.btc-mega-menu-image:hover {
    transform: rotate(2deg) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.btc-mega-menu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
    opacity: 1;
}

/* Right Section */
.btc-header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.btc-header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.btc-lang-toggle,
.btc-auth-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    color: inherit;
    transition: opacity 0.2s ease;
    padding: 8px 0;
}

.btc-lang-toggle:hover,
.btc-auth-link:hover {
    opacity: 0.8;
}

.btc-lang-toggle i,
.btc-auth-link i {
    font-size: 18px;
}

.btc-cta-button {
    background: #006CE4;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btc-cta-button:hover {
    background: #005bb5;
    color: white;
    text-decoration: none;
}

/* Sticky Header State Changes */
#dynamic-header.sticky-header .btc-mega-menu {
    /* Background stays dark due to !important declarations above */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#dynamic-header.sticky-header .btc-mega-menu-item {
    color: #b0b7bb;
}

#dynamic-header.sticky-header .btc-mega-menu-item:hover,
#dynamic-header.sticky-header .btc-mega-menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .btc-header-container {
        padding: 16px 24px;
        gap: 24px;
    }

    .btc-header-menu {
        gap: 20px;
    }

    .btc-mega-menu {
        min-width: 500px;
    }
}

@media (max-width: 768px) {
    .btc-header-container {
        padding: 12px 20px;
        gap: 16px;
    }

    .btc-header-menu {
        display: none;
    }

    .btc-header-actions {
        gap: 12px;
    }

    .btc-lang-toggle span,
    .btc-auth-link span {
        display: none;
    }

    .btc-cta-button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .btc-mega-menu {
        min-width: 90vw;
        left: 0;
        transform: none;
    }
}

@media (max-width: 480px) {
    .btc-header-container {
        padding: 10px 16px;
    }

    .btc-cta-button {
        display: none;
    }
}

/* ==========================================
   Membership Hover Dropdown (Login)
   ========================================== */
.btc-login-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.btc-membership-dropdown {
    position: absolute;
    top: 60px;
    right: -50px;
    margin-top: 8px;
    width: 500px;
    padding: 24px;
    background: rgba(11, 29, 38, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease-in-out;
    z-index: 1000;
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
}

/* Triangle pointer at top */
.btc-membership-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 80px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 8px solid rgb(121 129 133 / 95%);
}

/* Show on hover */
.btc-login-wrapper:hover .btc-membership-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Content layout */
.btc-mem-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;

}

.btc-mem-badge {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

.btc-mem-info-text {
    font-size: 14px;
    line-height: 1.3;
    color: #ced4da;
}

.btc-mem-info-text strong {
    color: rgba(255, 255, 255, 0.834);
    font-weight: 500;
}

/* Buttons row */
.btc-mem-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.btc-mem-signup-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white;
    color: #06141d;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid white;
    max-width: 180px;
}

.btc-mem-signup-btn:hover {
    background: transparent;
    color: white;
    text-decoration: none;
}

.btc-mem-signup-btn i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.btc-mem-signup-btn:hover i {
    transform: translateX(4px);
}

.btc-mem-learn-more {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #868e96;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.btc-mem-learn-more:hover {
    color: white;
    text-decoration: none;
}

.btc-mem-learn-more i {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .btc-membership-dropdown {
        display: none;
    }
}

/* ==========================================
   Logged-in User Dropdown
   ========================================== */
.btc-user-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.btc-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
}

.btc-user-badge {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.btc-user-trigger i {
    font-size: 12px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.btc-user-wrapper:hover .btc-user-trigger i {
    transform: rotate(180deg);
}

.btc-user-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 280px;
    padding: 12px 8px;
    background: rgba(0, 8, 12, 0.669);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.335);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease-in-out;
    z-index: 1000;
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
}

/* Triangle pointer at top */
.btc-user-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 8px solid rgb(121 129 133 / 95%);
}

/* Show on hover */
.btc-user-wrapper:hover .btc-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Menu items */
.btc-user-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #ced4da;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btc-user-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
}

.btc-user-menu-item i {
    font-size: 20px;
    opacity: 0.8;
}

.btc-user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 16px;
}

.btc-user-logout {
    color: #f87171;
}

.btc-user-logout:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
    .btc-user-dropdown {
        display: none;
    }
}