/* Mobile dropdown fixes */
@media screen and (max-width: 768px) {
    /* Faster scroll for opened options */
    .opened_options-container {
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
    }
    
    /* Increase scroll momentum on iOS */
    #options_block .tab_content,
    #options_block .scroll,
    .opened_options-container {
        -webkit-transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        -webkit-perspective: 1000;
    }
    
    /* Make scrolling feel faster */
    .opened_options-container,
    #options_block .tab_content {
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch !important;
        overflow-y: scroll !important;
        overflow-x: hidden !important;
    }
    
    /* Remove scroll resistance */
    .opened_options-container::-webkit-scrollbar {
        display: none;
    }
    /* Position dropdown properly on mobile */
    #user_menu.active #user_menu_dropdown {
        display: block !important;
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
        margin-right: 10px !important;
        margin-top: 10px !important;
        width: 250px !important;
        z-index: 999999 !important;
    }
    
    /* ZW-333: Ensure chart header dropdowns appear above zoom controls on mobile */
    #chart_header .select.active .dropdown {
        z-index: 101;
    }

    /* Force chart animations to lower z-index on mobile */
    /* Note: z-index: 3 keeps float_rate above y-axis labels (z-index: 2) but below dropdown (z-index: 999999) */
    #float_rate,
    #float_rate.pulse-effect,
    .chart-point-pulse-circle,
    .pulse-effect,
    [class*="pulse"] {
        z-index: 3 !important;
    }
    
    /* Dark overlay when dropdown is open */
    #user_menu.active::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999998;
    }
}