/* Custom styles for CV viewer - hide unnecessary UI elements */

/* Secondary toolbar will be controlled by media queries below */

/* Default desktop behavior - allow secondary toolbar to work normally */
@media (min-width: 769px) {
    #secondaryToolbarToggle {
        display: block !important;
    }
    
    /* Allow secondary toolbar to show/hide normally on desktop */
    #secondaryToolbar {
        /* Let PDF.js handle the display state */
    }
}

/* Show save button on mobile devices */
@media (max-width: 768px) {
    /* Show the main toolbar download button on mobile */
    #download {
        display: block !important;
    }
    
    /* Completely hide the secondary toolbar on mobile */
    #secondaryToolbar,
    #secondaryToolbar.doorHangerRight,
    #secondaryToolbar.doorHangerLeft,
    #secondaryToolbar.visible {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateX(100%) !important;
        pointer-events: none !important;
    }
    
    /* Hide the secondary toolbar container completely */
    #secondaryToolbarContainer {
        display: none !important;
    }
    
    /* Hide the secondary toolbar toggle button on mobile only */
    #secondaryToolbarToggle {
        display: none !important;
    }
}

/* Ensure save button is always visible on larger screens */
@media (min-width: 769px) {
    #secondaryDownload {
        display: block !important;
    }
}

/* Additional mobile-specific fixes to prevent auto-showing */
@media (max-width: 768px) {
    /* Prevent any secondary toolbar animations or transitions */
    #secondaryToolbar * {
        transition: none !important;
        animation: none !important;
    }
    
    /* Override PDF.js mobile responsive behavior */
    .doorHangerRight,
    .doorHangerLeft {
        display: none !important;
    }
    
    /* Ensure main toolbar stays visible and functional */
    #toolbarContainer {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Show the sidebar toggle button and let PDF.js handle the functionality */
#sidebarToggle {
    display: block !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ensure sidebar toggle button is clickable and functional */
#sidebarToggle:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

#sidebarToggle:active {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

/* Let PDF.js handle sidebar positioning and display naturally */
#sidebarContainer {
    /* Remove any positioning overrides to let PDF.js work */
}

/* Remove our custom sidebar display rules to let PDF.js handle it */

/* Hide the split toolbar button (sidebar view buttons) */
.splitToolbarButton.toggled {
    display: none !important;
}

/* Hide the view attachments button */
#viewAttachments {
    display: none !important;
}

/* Hide the view layers button */
#viewLayers {
    display: none !important;
}

/* Hide the presentation mode button */
#presentationMode {
    display: none !important;
}

/* Hide the open file button */
#openFile {
    display: none !important;
}

/* Hide the editor tools */
#editorFreeText,
#editorHighlight,
#editorInk,
#editorStamp {
    display: none !important;
}

/* Hide the bookmark button */
#viewBookmark {
    display: none !important;
}

/* Make the toolbar more compact */
#toolbarContainer {
    height: 40px !important;
}

/* Allow sidebar to work normally */
#outerContainer.sidebarOpen #viewerContainer {
    /* Let PDF.js handle the positioning */
}

/* Hide the loading bar */
#loadingBar {
    display: none !important;
}

/* Custom scrollbar styling to match your main page */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
