/* ========================================
   PDF Viewer – Viewer Layout Overrides
   ======================================== */

/* White background for the full viewer page */
body {
    background: #fff;
}

/* Book area: fills space between fixed navbar (~70px) and fixed pagination bar (60px) */
#viewer-body {
    position: fixed;
    top: 70px;
    left: 0; right: 0; bottom: 60px;
    background: #fff;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Book container - let PageFlip handle layout */
#book-container {
    width: 100%;
    height: 100%;
}

/* PDF pagination bar */
#viewer-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: #fff;
    border-top: 2px solid #E20079;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

/* Nav buttons */
.pdf-nav-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 16px;
    color: #555;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pdf-nav-btn:hover:not(:disabled) {
    background: #E20079;
    color: #fff;
    border-color: #E20079;
}

.pdf-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Page progress slider */
#page-slider {
    flex: 1;
    max-width: 400px;
    accent-color: #E20079;
    cursor: pointer;
    height: 4px;
}

/* Page counter text */
#page-counter {
    color: #E20079;
    font-weight: 600;
    font-size: 14px;
    min-width: 70px;
    text-align: center;
    white-space: nowrap;
}

/* Page item styling for both WebP and PDF modes */
.page-item {
    display: block;
    background: #fff;
    width: 100%;
    height: 100%;
}

.page-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-item canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* PageFlip specific - control spacing and shadows */
.page-item.--left::before {
    box-shadow: inset -1px 0 0 rgba(0,0,0,0.05) !important;
}

.page-item.--right::after {
    box-shadow: inset 1px 0 0 rgba(0,0,0,0.05) !important;
}

/* Loading overlay */
#loading-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(255,255,255,0.95);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 16px;
}

#loading-overlay .spinner {
    width: 48px; height: 48px;
    border: 5px solid #eee;
    border-top-color: #E20079;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#loading-overlay p {
    color: #333;
    font-size: 15px;
}

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

/* ========================================
   PDF Viewer – Custom Suggestions Last Page
   ======================================== */

.pdf-page-custom {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
}

/* Header */
.pvc-header {
    text-align: center;
    padding: 14px 20px;
    flex-shrink: 0;
}

.pvc-header-title {
    color: #E20079;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Folder grid: 4 columns */
.pvc-grid {
    display: flex;
    flex-wrap: wrap;
    flex: 1 1 auto;
    overflow: hidden;
    padding: 12px 8px 0;
    align-content: flex-start;
    gap: 0;
}

.pvc-card {
    width: 25%;
    padding: 6px 8px;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pvc-card:hover .pvc-card-title {
    color: #E20079;
}

.pvc-card-img-wrap {
    width: 100%;
    aspect-ratio: 0.707; /* A4 portrait */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.pvc-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pvc-card-info {
    width: 100%;
}

.pvc-card-title {
    font-size: 11px;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 2px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pvc-card-valid {
    font-size: 10px;
    color: #E20079;
    font-weight: 500;
}

/* Footer CTA */
.pvc-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 10px 16px 14px;
    border-top: 1px solid #eee;
}

.pvc-footer-btn {
    display: inline-block;
    background: #E20079;
    color: #fff;
    padding: 8px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
}

.pvc-footer-btn:hover {
    background: #b8005e;
    color: #fff;
}



