/* ========================================
   MOBILE FIX - FLOATING BUTTONS & VIEWPORT
   Fixes for icon centering and mobile fit
   ======================================== */

/* Fix 1: Back to Top Button - Perfect Icon Centering */
.back-to-top {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.back-to-top i {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
}

/* Fix 2: Quick Add Button - Perfect Icon Centering */
.quick-add-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.quick-add-btn i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

/* Fix 3: Floating Tracker Toggle - Perfect Centering */
.floating-tracker-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.floating-tracker-toggle i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fix 4: Floating Tracker - Close functionality */
.floating-tracker-details.expanded {
    position: relative;
}

/* Make the arrow rotate when expanded */
.floating-tracker-toggle.expanded #floatingTrackerArrow {
    transform: rotate(180deg);
}

/* Fix 5: Prevent horizontal scroll and zoom on mobile */
html {
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
}

body {
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    touch-action: pan-y !important;
}

/* Fix 6: Make floating tracker close when clicking toggle while expanded */
@media (max-width: 768px) {
    .back-to-top {
        width: 56px !important;
        height: 56px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .quick-add-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 16px 24px !important;
    }
    
    .quick-add-btn i {
        font-size: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .floating-tracker-toggle {
        display: flex !important;
        align-items: center !important;
    }
}

/* Fix 7: Ensure icons are perfectly centered vertically and horizontally */
.fas, .far, .fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Fix 8: Override any line-height issues */
button i, 
a i,
.back-to-top i,
.quick-add-btn i,
.floating-tracker-toggle i {
    line-height: 1 !important;
    vertical-align: middle !important;
}
