/* PDF Viewer Pro - FlippingBook Style */

.pdf-viewer-container.pdf-flipbook-style {
    position: relative;
    background: #f5f5f5;
    border: none;
    border-radius: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

/* Toolbar */
.pdf-flipbook-style .pdf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2a2a2a;
    color: #fff;
    padding: 8px 20px;
    border-top: 1px solid #1a1a1a;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 48px;
    z-index: 100;
    order: 2;
}

.pdf-flipbook-style .pdf-toolbar-sep {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: #4a4a4a;
    margin: 0 4px;
    vertical-align: middle;
}

.pdf-flipbook-style .pdf-toolbar-left,
.pdf-flipbook-style .pdf-toolbar-center,
.pdf-flipbook-style .pdf-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-flipbook-style .pdf-btn {
    background: transparent;
    color: #e0e0e0;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: color 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
}

.pdf-flipbook-style .pdf-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.pdf-flipbook-style .pdf-btn:active {
    background: rgba(255,255,255,0.12);
}

.pdf-flipbook-style .pdf-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
}

.pdf-flipbook-style .pdf-btn .dashicon {
    font-size: 18px;
    line-height: 1;
}

/* Sound toggle button */
.pdf-flipbook-style .pdf-sound-toggle.active,
.pdf-flipbook-style .pdf-sound-toggle:hover {
    border-color: #ffff00;
    color: #ffff00;
}

/* Current page highlight */
.pdf-flipbook-style .pdf-current-pages {
    color: #ffff00;
    font-weight: 700;
}

.pdf-flipbook-style .pdf-page-info {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #e0e0e0;
    font-size: 14px;
    padding: 0 10px;
}

.pdf-flipbook-style .pdf-current-pages {
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}

.pdf-flipbook-style .pdf-zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #e0e0e0;
}

/* Main Content Area */
.pdf-flipbook-style .pdf-content-area {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    order: 1;
}

/* Sidebar */
.pdf-flipbook-style .pdf-sidebar {
    width: 180px;
    background: #2a2a2a;
    border-right: 1px solid #1a1a1a;
    overflow-y: auto;
    transition: transform 0.3s ease, margin-left 0.3s ease;
    position: relative;
    z-index: 50;
    transform: translateX(-100%);
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
}

.pdf-flipbook-style .pdf-sidebar.show {
    transform: translateX(0);
}

.pdf-flipbook-style .pdf-sidebar-header {
    padding: 15px;
    background: #222;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-flipbook-style .pdf-sidebar-header h4 {
    margin: 0;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
}

.pdf-flipbook-style .pdf-sidebar-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pdf-flipbook-style .pdf-sidebar-close:hover {
    color: #fff;
}

.pdf-flipbook-style .pdf-thumbnails {
    padding: 10px;
}

.pdf-flipbook-style .pdf-thumb-item {
    margin-bottom: 15px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #333;
    position: relative;
}

.pdf-flipbook-style .pdf-thumb-item:hover {
    border-color: #666;
    transform: scale(1.05);
}

.pdf-flipbook-style .pdf-thumb-item.active {
    border-color: #ffff00;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.6);
}

.pdf-flipbook-style .pdf-thumb-item canvas {
    width: 100%;
    height: auto;
    display: block;
}

.pdf-flipbook-style .pdf-thumb-label {
    text-align: center;
    padding: 5px;
    font-size: 11px;
    color: #aaa;
    background: rgba(0,0,0,0.5);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Main Viewer */
.pdf-flipbook-style .pdf-viewer-main {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    cursor: default;
}

/* Page Edge Navigation Hover Effects on Main Viewer */
.pdf-flipbook-style .pdf-viewer-main.hover-left {
    cursor: w-resize;
}

.pdf-flipbook-style .pdf-viewer-main.hover-right {
    cursor: e-resize;
}

.pdf-flipbook-style .pdf-viewer-main.hover-left::before {
    content: '‹';
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 80px;
    color: #333;
    opacity: 0.5;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: pulseLeft 1.2s ease-in-out infinite;
    z-index: 1000;
    font-weight: bold;
}

.pdf-flipbook-style .pdf-viewer-main.hover-right::after {
    content: '›';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 80px;
    color: #333;
    opacity: 0.5;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: pulseRight 1.2s ease-in-out infinite;
    z-index: 1000;
    font-weight: bold;
}

.pdf-flipbook-style .pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.92);
    padding: 30px 40px;
    border-radius: 12px;
    font-size: 13px;
    color: #555;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 120px;
}

.pdf-flipbook-style .pdf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #555;
    border-radius: 50%;
    animation: pdf-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes pdf-spin {
    to { transform: rotate(360deg); }
}

.pdf-flipbook-style .pdf-loading-text {
    font-size: 13px;
    color: #777;
    white-space: nowrap;
}

/* Pages Wrapper */
.pdf-flipbook-style .pdf-pages-wrapper {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    perspective: 2500px;
    transform-style: preserve-3d;
    position: relative;
}

/* Pulse animations for navigation arrows */
@keyframes pulseLeft {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(-50%) translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) translateX(-10px);
    }
}

@keyframes pulseRight {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(-50%) translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) translateX(10px);
    }
}

/* Flip animations moved to pdf-page-curl.css for realistic book effect */
.pdf-flipbook-style .pdf-pages-wrapper.flip-forward,
.pdf-flipbook-style .pdf-pages-wrapper.flip-backward {
    /* Animation handled by pdf-page-curl.css */
}

/* Page Container */
.pdf-flipbook-style .pdf-page-container {
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7),
                0 3px 10px rgba(0,0,0,0.5),
                inset 0 0 2px rgba(0,0,0,0.1);
    background: #fff;
    border-radius: 2px;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pdf-flipbook-style .pdf-page-container:hover {
    box-shadow: 0 12px 45px rgba(0,0,0,0.8),
                0 5px 15px rgba(0,0,0,0.6),
                inset 0 0 2px rgba(0,0,0,0.1);
}

/* Add realistic page curl effect on right page */
.pdf-flipbook-style .pdf-page-container[data-page]::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(to left, rgba(0,0,0,0.1) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0.5;
}

/* Book spine shadow in the middle */
.pdf-flipbook-style .pdf-pages-wrapper .pdf-page-container:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    right: -10px;
    width: 20px;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    pointer-events: none;
    z-index: 10;
}

.pdf-flipbook-style .pdf-page {
    display: block;
    max-width: 100%;
    height: auto;
}

.pdf-flipbook-style .pdf-page-number {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #888;
    font-size: 12px;
    white-space: nowrap;
}

/* Share Modal */
.pdf-flipbook-style .pdf-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-flipbook-style .pdf-share-content {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pdf-flipbook-style .pdf-share-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    line-height: 1;
    background: transparent;
    border: none;
}

.pdf-flipbook-style .pdf-share-close:hover {
    color: #fff;
}

.pdf-flipbook-style .pdf-share-content h3 {
    margin: 0 0 25px 0;
    color: #fff;
    font-size: 24px;
}

.pdf-flipbook-style .pdf-share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.pdf-flipbook-style .pdf-share-btn {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 14px 18px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.pdf-flipbook-style .pdf-share-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

.pdf-flipbook-style .pdf-share-btn[data-type="email"] {
    background: #e74c3c;
}

.pdf-flipbook-style .pdf-share-btn[data-type="email"]:hover {
    background: #c0392b;
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
}

.pdf-flipbook-style .pdf-share-btn[data-type="facebook"] {
    background: #3b5998;
}

.pdf-flipbook-style .pdf-share-btn[data-type="facebook"]:hover {
    background: #2d4373;
    box-shadow: 0 6px 15px rgba(59, 89, 152, 0.4);
}

.pdf-flipbook-style .pdf-share-btn[data-type="twitter"] {
    background: #1da1f2;
}

.pdf-flipbook-style .pdf-share-btn[data-type="twitter"]:hover {
    background: #0c85d0;
    box-shadow: 0 6px 15px rgba(29, 161, 242, 0.4);
}

.pdf-flipbook-style .pdf-share-btn[data-type="linkedin"] {
    background: #0077b5;
}

.pdf-flipbook-style .pdf-share-btn[data-type="linkedin"]:hover {
    background: #005885;
    box-shadow: 0 6px 15px rgba(0, 119, 181, 0.4);
}

.pdf-flipbook-style .pdf-share-link-wrapper {
    margin-top: 15px;
}

.pdf-flipbook-style .pdf-share-link {
    width: 100%;
    padding: 14px;
    border: 2px solid #444;
    border-radius: 6px;
    font-size: 14px;
    color: #e0e0e0;
    background: #1a1a1a;
}

.pdf-flipbook-style .pdf-share-link:focus {
    outline: none;
    border-color: #ffff00;
    background: #222;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

/* Fullscreen Mode */
.pdf-flipbook-style.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pdf-flipbook-style .pdf-pages-wrapper {
        padding: 30px 15px;
        gap: 15px;
    }

    .pdf-flipbook-style .pdf-sidebar {
        width: 160px;
    }
}

@media (max-width: 768px) {
    .pdf-flipbook-style .pdf-toolbar-right {
        display: none;
    }

    .pdf-flipbook-style .pdf-viewer-main {
        overflow: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .pdf-flipbook-style .pdf-viewer-main::-webkit-scrollbar {
        display: none;
    }

    .pdf-flipbook-style .pdf-side-arrow {
        width: 16px !important;
        min-width: 0 !important;
        font-size: 28px;
    }

    .pdf-flipbook-style .pdf-btn {
        padding: 6px 8px;
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .pdf-flipbook-style .pdf-sidebar {
        width: 140px;
    }

    .pdf-flipbook-style .pdf-pages-wrapper {
        gap: 10px;
        padding: 20px 10px;
    }

    .pdf-flipbook-style .pdf-viewer-main.hover-left::before,
    .pdf-flipbook-style .pdf-viewer-main.hover-right::after {
        font-size: 60px;
    }

    .pdf-flipbook-style .pdf-share-options {
        grid-template-columns: 1fr 1fr;
    }

    .pdf-flipbook-style .pdf-page-container {
        max-width: 100%;
    }

    .pdf-flipbook-style .pdf-toolbar-left,
    .pdf-flipbook-style .pdf-toolbar-center,
    .pdf-flipbook-style .pdf-toolbar-right {
        gap: 4px;
    }

    .pdf-flipbook-style .pdf-zoom-level {
        font-size: 12px;
        min-width: 45px;
    }

    .pdf-flipbook-style .pdf-page-info {
        font-size: 13px;
        padding: 0 5px;
    }
}

@media (max-width: 600px) {
    .pdf-flipbook-style .pdf-sidebar {
        width: 100%;
        max-width: 250px;
    }

    /* Force single page view on small screens */
    .pdf-flipbook-style .pdf-pages-wrapper {
        flex-direction: column;
        padding: 15px 5px;
    }

    .pdf-flipbook-style .pdf-page-container {
        width: 100% !important;
        max-width: 95vw;
    }

    .pdf-flipbook-style .pdf-viewer-main.hover-left::before {
        left: 15px;
        font-size: 50px;
    }

    .pdf-flipbook-style .pdf-viewer-main.hover-right::after {
        right: 15px;
        font-size: 50px;
    }
}

@media (max-width: 480px) {
    .pdf-flipbook-style .pdf-toolbar {
        padding: 6px 8px;
        min-height: auto;
    }

    .pdf-flipbook-style .pdf-toolbar-left,
    .pdf-flipbook-style .pdf-toolbar-center,
    .pdf-flipbook-style .pdf-toolbar-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pdf-flipbook-style .pdf-btn {
        padding: 5px 7px;
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .pdf-flipbook-style .pdf-sidebar {
        width: 100%;
        max-width: 200px;
    }

    .pdf-flipbook-style .pdf-pages-wrapper {
        padding: 10px 5px;
    }

    .pdf-flipbook-style .pdf-share-content {
        padding: 20px 15px;
    }

    .pdf-flipbook-style .pdf-share-content h3 {
        font-size: 20px;
    }

    .pdf-flipbook-style .pdf-share-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .pdf-flipbook-style .pdf-share-btn {
        padding: 12px 16px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .pdf-flipbook-style .pdf-btn {
        min-width: 20px;
        height: 40px;
        padding: 8px 12px;
    }

    .pdf-flipbook-style .pdf-viewer-main.hover-left::before,
    .pdf-flipbook-style .pdf-viewer-main.hover-right::after {
        display: none;
    }

    /* No pseudo-element arrows on touch — real side arrow buttons handle navigation */
    .pdf-flipbook-style .pdf-viewer-main::before,
    .pdf-flipbook-style .pdf-viewer-main::after {
        display: none;
    }

    .pdf-flipbook-style .pdf-thumb-item {
        margin-bottom: 12px;
    }
}

/* Print Styles */
@media print {
    .pdf-flipbook-style .pdf-toolbar,
    .pdf-flipbook-style .pdf-sidebar {
        display: none;
    }

    .pdf-flipbook-style .pdf-viewer-main {
        overflow: visible;
        height: auto;
    }

    .pdf-flipbook-style .pdf-pages-wrapper {
        display: block;
    }

    .pdf-flipbook-style .pdf-page-container {
        page-break-after: always;
    }
}

/* Side arrows — flipbook overrides */
.pdf-flipbook-style .pdf-side-arrow {
    width: 20px;
    height: 100%;
    font-size: 44px;
    color: rgba(0, 0, 0, 0.18);
}

.pdf-flipbook-style .pdf-side-arrow:hover {
    background: transparent;
    color: rgba(0, 0, 0, 0.18);
}

.pdf-flipbook-style .pdf-side-arrow-left {
    left: 0;
}

.pdf-flipbook-style .pdf-side-arrow-right {
    right: 0;
}

/* Scrollbar Styling */
.pdf-flipbook-style .pdf-sidebar::-webkit-scrollbar {
    width: 8px;
}

.pdf-flipbook-style .pdf-sidebar::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.pdf-flipbook-style .pdf-sidebar::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.pdf-flipbook-style .pdf-sidebar::-webkit-scrollbar-thumb:hover {
    background: #6a6a6a;
}

/* Loading Animation */
.pdf-flipbook-style .pdf-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}


/* Download Link Button */
.pdf-flipbook-style .pdf-download {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Accessibility */
.pdf-flipbook-style .pdf-btn:focus,
.pdf-flipbook-style .pdf-share-btn:focus {
    outline: none;
}
