/**
 * BNBInfinity Navbar Button Fix
 * Fixes issues with the navbar buttons on mobile
 */

/* Fix navbar button display on mobile */
@media (max-width: 768px) {
    /* Improve button layout */
    .navbar-links .nav-link.invest-btn {
        width: 100%;
        text-align: center;
        margin: 8px 0;
        padding: 12px 15px;
    }
    
    /* Make sure connect button doesn't break navbar layout */
    .navbar-links button {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix language selector placement */
    .language-selector {
        width: 100%;
        margin-top: 10px;
    }
    
    /* Ensure navbar container maintains proper size */
    .navbar-container {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    /* Fix navbar display when multiple items in row */
    .navbar {
        height: auto;
        min-height: 60px;
    }
    
    /* Fixed height for navbar logo */
    .navbar-logo img {
        height: 40px;
        width: auto;
    }
    
    /* Ensure toggle button is properly positioned */
    .mobile-menu-toggle {
        margin-left: auto;
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Fix button overflow issues on larger screens */
@media (min-width: 769px) {
    .nav-link.invest-btn {
        white-space: nowrap;
    }
    
    /* Ensure consistent button width */
    #connectBtn {
        min-width: 160px;
    }
}

/* Fix button sizing for all screens */
.nav-link.invest-btn {
    box-sizing: border-box;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix for multi-level container issues */
.navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
}

.navbar-links {
    transition: all 0.3s ease-in-out;
}

/* Fix dropdown position */
@media (max-width: 768px) {
    .navbar-links.active {
        margin-top: 60px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Mobile menu enhancement */
.mobile-menu-toggle:focus {
    outline: none;
}

.mobile-menu-toggle i {
    transition: transform 0.3s ease;
}

.navbar-links.active ~ .mobile-menu-toggle i.fa-bars,
.navbar-links:not(.active) ~ .mobile-menu-toggle i.fa-times {
    display: none;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    .nav-link, .mobile-menu-toggle, .language-selector select {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
    }
    
    .nav-link:not(.invest-btn) {
        justify-content: center;
    }
}

/* Fix for nested language selector */
.language-selector {
    position: relative;
    z-index: 1000;
}

/* Ensure mobile menu toggle is always on top */
.mobile-menu-toggle {
    position: relative;
    z-index: 1001;
}
