/* Workout Builder Header Fix - Force proper alignment */

/* Reset any transforms or positioning that might affect the page */
html, body {
    overflow-x: visible !important; /* Override the inline overflow-x: hidden */
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure body has proper padding for fixed header */
body.workout-builder-page {
    padding-top: 120px !important; /* Increased to accommodate larger header with 100px logo */
    position: relative !important;
    overflow-x: hidden !important; /* Re-apply after ensuring proper width */
}

/* Force header to display properly */
.workout-builder-page .site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 1000 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Force container to standard width and center it */
.workout-builder-page .site-header .container {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important; /* This centers the container */
    padding: 0 20px !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure header flex displays properly */
.workout-builder-page .header-flex {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100% !important;
}

/* Fix logo size - match other pages */
.workout-builder-page .site-header .logo {
    display: flex !important;
    align-items: center !important;
    height: auto !important; /* Let logo image determine height */
}

.workout-builder-page .site-header .logo-image {
    height: 100px !important; /* Match desktop size from navigation.css */
    width: auto !important;
    object-fit: contain !important;
}

/* Adjust header height to accommodate larger logo */
.workout-builder-page .site-header {
    height: auto !important;
    min-height: 110px !important; /* Increased to properly contain 100px logo */
    padding: 10px 0 !important;
}

/* Mobile logo size */
@media (max-width: 991px) {
    .workout-builder-page .site-header .logo-image {
        height: 90px !important; /* Match mobile size from navigation.css */
    }
}

@media (max-width: 576px) {
    .workout-builder-page .site-header .logo-image {
        height: 80px !important; /* Match small mobile size */
    }
}

/* Fix footer logo size to match other pages */
.workout-builder-page .footer-logo-image {
    max-width: 150px !important;
    height: auto !important;
    width: auto !important;
    max-height: none !important;
}

/* Fix rep range input positioning on desktop */
@media (min-width: 992px) {
    #exerciseModal .reps-input {
        margin-right: 20px !important; /* Add right margin to prevent cutoff */
    }
    
    #exerciseModal .modal-content {
        padding-right: 30px !important; /* Ensure content has enough right padding */
    }
}

/* Fix dropdown alignment on page load */
.workout-builder-page .nav-list {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    gap: 0.5rem !important; /* Standard gap between items */
}

.workout-builder-page .nav-item {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    position: relative !important;
}

.workout-builder-page .nav-item.dropdown {
    display: flex !important;
    align-items: center !important;
}

/* Fix voice controls taking too much space */
.workout-builder-page .ai-voice-controls {
    max-width: 150px !important; /* Limit voice controls width */
    margin-right: 0 !important; /* Remove extra margin */
}

.workout-builder-page .ai-voice-controls #voiceStatus {
    max-width: 80px !important; /* Limit status text width */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.workout-builder-page .dropdown-toggle {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

/* Fix hover glitching by removing conflicting transitions/transforms */
.workout-builder-page .nav-item a,
.workout-builder-page .dropdown-toggle {
    transition: background-color 0.2s ease, color 0.2s ease !important; /* Only transition colors, not transforms */
    transform: none !important;
}

.workout-builder-page .nav-item a:hover,
.workout-builder-page .dropdown-toggle:hover {
    transform: none !important; /* Prevent any transform on hover */
}

/* Ensure dropdown menus don't cause layout shifts */
.workout-builder-page .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    transform: none !important;
}

/* Fix main content container */
.workout-builder-main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: auto !important; /* Ensure content is clickable */
}

/* Ensure mobile hamburger is visible */
@media (max-width: 991px) {
    .workout-builder-page .mobile-nav-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 1001 !important;
    }
    
    /* Fix hamburger menu 3-line display */
    .workout-builder-page .toggle-icon {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 30px !important;
        height: 3px !important;
        background-color: #333 !important;
        display: block !important;
    }
    
    .workout-builder-page .toggle-icon:before,
    .workout-builder-page .toggle-icon:after {
        content: '' !important;
        position: absolute !important;
        width: 30px !important;
        height: 3px !important;
        background-color: #333 !important;
        left: 0 !important;
        display: block !important;
    }
    
    .workout-builder-page .toggle-icon:before {
        top: -10px !important;
    }
    
    .workout-builder-page .toggle-icon:after {
        bottom: -10px !important;
    }
    
    .workout-builder-page .desktop-nav {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .workout-builder-page .mobile-nav-toggle {
        display: none !important;
    }
    
    .workout-builder-page .desktop-nav {
        display: flex !important;
    }
}