#pdfFlipperWrapper {
    position: relative;
    max-width: 100%;
    margin: auto;
}
#loadingSpinner {
    text-align: center;
    font-size: 1.2em;
    padding: 20px;
}
#flipper-toolbar {
    text-align: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}
#flipper-toolbar button {
    margin: 0 10px;
    font-size: 1.5em;
    cursor: pointer;
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px 15px;
    border-radius: 3px;
    transition: background 0.2s;
}
#flipper-toolbar button:hover {
    background: #efefef;
}
#pageNum {
    display: inline-block;
    margin: 0 15px;
    font-size: 1.1em;
    font-weight: bold;
    min-width: 80px;
}
.flipbook-nav {
    text-align: center;
    margin-top: 10px;
}
.flipbook-nav button {
    margin: 0 10px;
    font-size: 1.5em;
    cursor: pointer;
}
#thumbnailContainer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
#thumbnailContainer canvas {
    margin: 5px;
    width: 60px;
    height: auto;
    cursor: pointer;
    border: 1px solid #ccc;
}

/* Single page view styling */
#flipbookContainer.flipper-single {
    margin: 0 auto;
}

#flipbookContainer {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 100%;
}

#pdfCanvas {
    border: 1px solid #ddd;
    background: white;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Mobile specific canvas styling */
@media (max-width: 767px) {
    #pdfCanvas {
        width: auto !important;
        height: auto !important;
        max-width: 100%;
    }
}

/* PDF viewer wrapper for overlay navigation */
.pdf-viewer-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

/* Navigation overlay buttons */
.nav-overlay {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-overlay:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Desktop layout - arrows on left and right */
@media (min-width: 768px) {
    .nav-overlay {
        top: 50%;
        transform: translateY(-50%);
        width: 60px;
        height: 100px;
        padding: 10px;
    }
    
    .nav-prev {
        left: -60px;
        border-radius: 5px 0 0 5px;
    }
    
    .nav-next {
        right: -60px;
        border-radius: 0 5px 5px 0;
    }
}

/* Mobile navigation */
.mobile-nav {
    display: none;
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    text-align: center;
    box-sizing: border-box;
}

.mobile-nav-btn {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-nav-btn:hover {
    background: #efefef;
}

.mobile-page-info {
    display: inline-block;
    margin: 0 15px;
    font-weight: bold;
    min-width: 80px;
}

/* Mobile layout */
@media (max-width: 767px) {
    /* Hide desktop overlay arrows on mobile */
    .nav-overlay {
        display: none !important;
    }
    
    /* Show mobile navigation */
    .mobile-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-nav-top {
        border-bottom: 1px solid #ddd;
    }
    
    .mobile-nav-bottom {
        border-top: 1px solid #ddd;
    }
    
    .pdf-viewer-wrapper {
        margin: 0;
        width: 100%;
    }
}

/* Hide mobile nav on desktop */
@media (min-width: 768px) {
    .mobile-nav {
        display: none !important;
    }
}