/* Mobile Menu Fixes - Enhanced for better mobile touch */

@media (max-width: 768px) {
    /* Force display property handling */
    .navbar-links {
        display: none !important;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background-color: rgba(13, 13, 26, 0.98); /* Darker for better contrast */
        padding: 20px;
        z-index: 1000;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5); /* Enhanced shadow */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: opacity 0.3s ease; /* Smooth transition */
        opacity: 0;
    }
    
    .navbar-links.active {
        display: flex !important;
        opacity: 1;
    }
    
    /* Make sure mobile toggle is always visible and easy to touch */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 50px; /* Larger touch target */
        height: 50px; /* Larger touch target */
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        position: relative;
        z-index: 1001;
        margin-left: auto;
        padding: 0;
    }
    
    /* Visible tap state for mobile */
    .mobile-menu-toggle:active {
        opacity: 0.7;
        transform: scale(0.95);
    }
    
    /* Language selector adjustments */
    .language-selector {
        width: 100%;
        margin-top: 15px;
    }
    
    .language-selector select {
        width: 100%;
        padding: 12px; /* Larger touch target */
        height: 44px; /* Minimum height for touch targets */
        font-size: 16px; /* Prevent iOS zoom on focus */
        background-color: rgba(32, 193, 178, 0.1);
        border: 1px solid rgba(32, 193, 178, 0.3);
        border-radius: 5px;
        color: white;
    }
    
    /* Nav links adjustments for better touch */
    .navbar-links .nav-link {
        width: 100%;
        text-align: center;
        padding: 15px; /* Larger touch target */
        margin: 4px 0;
        border-radius: 5px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px; /* Larger for better readability */
        transition: background-color 0.2s ease;
    }
    
    /* Highlight touch state */
    .navbar-links .nav-link:active {
        background-color: rgba(32, 193, 178, 0.2);
    }
    
    /* Special styling for active link */
    .navbar-links .nav-link.active {
        background-color: rgba(32, 193, 178, 0.15);
        font-weight: bold;
    }
    
    /* Connect button enhanced */
    .navbar-links .nav-link.invest-btn {
        background: linear-gradient(270deg, #20c1b2 0%, #078093 96.85%);
        min-height: 50px; /* Even larger touch target for primary action */
        margin: 8px 0;
    }
    
    /* Ensure dropdown stays within viewport */
    .navbar-container {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    /* Fix for nested nav elements in mobile */
    .navbar-logo {
        display: flex;
        align-items: center;
        padding: 5px 0;
    }
}

/* Fixed mobile navbar container */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: rgba(13, 13, 26, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* Accessibility improvements */
.mobile-menu-toggle:focus {
    outline: 2px solid var(--primary-color, #20c1b2);
}

/* Ensure consistent spacing */
.navbar-container {
    padding: 10px 15px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Fix navbar logo size */
.navbar-logo img {
    height: 40px;
    width: auto;
    max-width: 100%;
}

/* Prevent text selection on taps */
.mobile-menu-toggle, .navbar-links .nav-link {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Fix any overflow issues */
body {
    overflow-x: hidden;
}

/* Enhanced tap highlights for mobile */
@media (hover: none) {
    .navbar-links .nav-link:hover {
        background-color: transparent; /* Disable hover effects on touch devices */
    }
    
    .navbar-links .nav-link.invest-btn:active {
        opacity: 0.9;
    }
}

/* Ensure button looks like a button */
.mobile-menu-toggle {
    appearance: none;
    -webkit-appearance: none;
}
