.smooth-pdf-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    font-family: sans-serif;
}

.smooth-pdf-main {
    position: relative;
    width: 100%;
    background: #e0e0e0; /* light gray bg similar to slideshare */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px; /* Base height to prevent jumpiness while loading */
    overflow: hidden;
}

.smooth-pdf-canvas-container {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: #fff;
    margin: 20px 40px; /* Margin to keep arrows from overlapping the pdf */
    display: block; /* Block to limit width properly */
    overflow: hidden; /* Hide the sliding canvases */
    position: relative;
    /* transition: height 0.3s; optional */
}

.smooth-pdf-track {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    align-items: flex-start; /* Ensure canvases align at top */
}

.smooth-pdf-canvas {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    height: auto;
}

/* Always-on Navigation Buttons */
.smooth-pdf-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px; /* Clickable width */
    color: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    font-size: 28px;
    z-index: 10;
    transition: all 0.3s ease;
    outline: none;
    padding: 0;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.smooth-pdf-prev {
    left: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
    justify-content: flex-start;
    padding-left: 15px; /* Push arrow slightly in from the very edge */
}

.smooth-pdf-next {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
    justify-content: flex-end;
    padding-right: 15px;
}

.smooth-pdf-nav:hover {
    opacity: 1;
    color: #ffffff;
}

.smooth-pdf-prev:hover {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
}

.smooth-pdf-next:hover {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
}

.smooth-pdf-nav:active {
    color: #cccccc;
}

.smooth-pdf-nav:disabled {
    opacity: 0;
    pointer-events: none; /* Make completely non-interactable when disabled */
}

/* Toolbar / Indicator */
.smooth-pdf-toolbar {
    background: #333;
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.smooth-pdf-download-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 50; /* Above everything */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff !important;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.smooth-pdf-download-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.smooth-pdf-download-btn svg {
    display: block;
}

/* Pulse Animation for Premium Download */
@keyframes smoothPdfPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

.smooth-pdf-pulse-anim {
    animation: smoothPdfPulse 2s infinite;
    background: rgba(13, 110, 253, 0.8) !important; /* Blue background to pop */
    border-color: rgba(255,255,255,0.5);
}

.smooth-pdf-pulse-anim:hover {
    background: rgba(13, 110, 253, 1) !important;
}

/* Thumbnails Strip */
.smooth-pdf-thumbnails-container {
    background: #222;
    padding: 15px 0;
}

.smooth-pdf-thumbnails {
    display: flex;
    overflow-x: auto;
    padding: 0 15px 10px 15px; /* Added bottom padding so scrollbar doesn't overlap items tightly */
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: #aaa #111; /* Bright thumb, dark track */
    align-items: center;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.smooth-pdf-thumbnails:active {
    cursor: grabbing;
}

.smooth-pdf-thumbnails::-webkit-scrollbar {
    display: block;
    height: 10px;
}

.smooth-pdf-thumbnails::-webkit-scrollbar-track {
    background: #111;
    border-radius: 5px;
}

.smooth-pdf-thumbnails::-webkit-scrollbar-thumb {
    background-color: #aaa;
    border-radius: 5px;
    border: 2px solid #111; /* Adds spacing around thumb */
}

.smooth-pdf-thumbnails::-webkit-scrollbar-thumb:hover {
    background-color: #eee;
}

.smooth-pdf-thumbnail-item {
    flex: 0 0 auto;
    width: 100px;
    cursor: pointer;
    border: 3px solid transparent; /* slightly thicker border for active state visibility */
    transition: border-color 0.2s, opacity 0.2s;
    background: #fff;
    opacity: 0.7;
}

.smooth-pdf-thumbnail-item:hover {
    opacity: 1;
}

.smooth-pdf-thumbnail-item.active {
    border-color: #3b82f6; /* Blue highlight */
    opacity: 1;
}

.smooth-pdf-thumbnail-item canvas {
    display: block;
    width: 100%;
    height: auto;
}

.smooth-pdf-thumbnail-page-num {
    text-align: center;
    color: #ccc;
    font-size: 12px;
    margin-top: 5px;
    font-family: monospace;
}

/* Light Theme Overrides */
.smooth-pdf-theme-light .smooth-pdf-main {
    background: #f0f0f0;
}
.smooth-pdf-theme-light .smooth-pdf-toolbar {
    background: #e9ecef;
    color: #333;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}
.smooth-pdf-theme-light .smooth-pdf-download-btn {
    color: #333 !important;
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}
.smooth-pdf-theme-light .smooth-pdf-download-btn.smooth-pdf-pulse-anim {
    color: #fff !important; /* Keep icon white when it's popping blue */
}
.smooth-pdf-theme-light .smooth-pdf-download-btn:hover {
    background: #ffffff;
}
.smooth-pdf-theme-light .smooth-pdf-thumbnails-container {
    background: #f8f9fa;
}
.smooth-pdf-theme-light .smooth-pdf-thumbnails::-webkit-scrollbar-track {
    background: #e9ecef;
}
.smooth-pdf-theme-light .smooth-pdf-thumbnails::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border: 2px solid #e9ecef;
}
.smooth-pdf-theme-light .smooth-pdf-thumbnail-item {
    border-color: transparent;
    opacity: 0.6;
}
.smooth-pdf-theme-light .smooth-pdf-thumbnail-item.active {
    border-color: #0d6efd;
    opacity: 1;
}
.smooth-pdf-theme-light .smooth-pdf-thumbnail-page-num {
    color: #666;
}

/* Loader */
.smooth-pdf-loader {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(224, 224, 224, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    font-weight: bold;
    color: #333;
    transition: opacity 0.3s;
}

.smooth-pdf-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Responsive adjust for mobile */
/* Paywall Box */
.smooth-pdf-paywall-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 32, 44, 0.9);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
    max-width: 80%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.smooth-pdf-paywall-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #cbd5e1;
}

.smooth-pdf-paywall-box p {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 20px;
    line-height: 1.5;
}

.smooth-pdf-buy-btn {
    background: #0d6efd;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(13, 110, 253, 0.3);
}

.smooth-pdf-buy-btn:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
}

.smooth-pdf-buy-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Light Theme overrides for Paywall */
.smooth-pdf-theme-light .smooth-pdf-paywall-box {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.smooth-pdf-theme-light .smooth-pdf-paywall-box h3 {
    color: #0f172a;
}
.smooth-pdf-theme-light .smooth-pdf-paywall-box p {
    color: #64748b;
}

@media (max-width: 600px) {
    .smooth-pdf-canvas-container {
        margin: 10px;
    }
    .smooth-pdf-nav {
        padding: 15px 10px;
        font-size: 18px;
    }
    .smooth-pdf-thumbnail-item {
        width: 80px;
    }
}
