/**
 * PDF Viewer Styles - Vertical Scrolling Version
 */

/* Container */
.pdf-viewer-container {
    position: relative;
    margin: 20px auto;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: flex;
    flex-direction: column;
}

.pdf-viewer-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0;
    border-radius: 0;
    z-index: 999999;
    max-width: 100vw;
}

/* Toolbar */
.pdf-viewer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #2c3e50;
    color: #fff;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.pdf-viewer-controls,
.pdf-viewer-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* Buttons */
.pdf-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #34495e;
    border: 1px solid #2c3e50;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.pdf-viewer-btn:hover {
    background: #3d5a73;
    border-color: #34495e;
}

.pdf-viewer-btn:active {
    background: #2c3e50;
}

.pdf-viewer-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pdf-viewer-btn:disabled:hover {
    background: #34495e;
}

.pdf-viewer-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #fff;
}

/* Page Info */
.pdf-viewer-page-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #fff;
    padding: 0 5px;
}

.pdf-viewer-current-page {
    width: 50px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #34495e;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    background: #fff;
    color: #333;
}

.pdf-viewer-current-page:focus {
    outline: none;
    border-color: #3498db;
}

.pdf-viewer-zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 14px;
    color: #fff;
    padding: 0 5px;
}

/* Wrapper */
.pdf-viewer-wrapper {
    display: flex;
    flex: 1;
    background: #525659;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

/* Thumbnails */
.pdf-viewer-thumbnails {
    width: 180px;
    background: #3a3f44;
    border-right: 1px solid #2a2f34;
    overflow-y: auto;
    display: none;
    flex-shrink: 0;
}

.pdf-viewer-thumbnails.active {
    display: block;
}

.pdf-viewer-thumbnails-container {
    padding: 10px;
}

.pdf-viewer-thumbnail {
    position: relative;
    margin-bottom: 10px;
    padding: 5px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-viewer-thumbnail:hover {
    border-color: #3498db;
    transform: scale(1.02);
}

.pdf-viewer-thumbnail.active {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.pdf-viewer-thumbnail canvas {
    display: block;
    width: 100%;
    height: auto;
}

.pdf-viewer-thumbnail-label {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
    font-weight: 600;
}

/* Content */
.pdf-viewer-content {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background: #525659;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    min-height: 0;
}

.pdf-viewer-content::-webkit-scrollbar {
    width: 12px;
}

.pdf-viewer-content::-webkit-scrollbar-track {
    background: #3a3f44;
}

.pdf-viewer-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 6px;
}

.pdf-viewer-content::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Loading */
.pdf-viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 10;
}

.pdf-viewer-loading.hidden {
    display: none;
}

.pdf-viewer-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pdf-viewer-spin 1s linear infinite;
}

@keyframes pdf-viewer-spin {
    to { transform: rotate(360deg); }
}

.pdf-viewer-loading p {
    font-size: 16px;
    margin: 0;
}

/* Pages Container */
.pdf-viewer-pages {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pdf-viewer-page {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.pdf-viewer-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.pdf-viewer-page-number {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Error */
.pdf-viewer-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    text-align: center;
    margin: 20px;
}

/* Zoom States */
.pdf-viewer-content.zoom-50 .pdf-viewer-pages {
    max-width: 600px;
}

.pdf-viewer-content.zoom-75 .pdf-viewer-pages {
    max-width: 900px;
}

.pdf-viewer-content.zoom-100 .pdf-viewer-pages {
    max-width: 1200px;
}

.pdf-viewer-content.zoom-125 .pdf-viewer-pages {
    max-width: 1500px;
}

.pdf-viewer-content.zoom-150 .pdf-viewer-pages {
    max-width: 1800px;
}

.pdf-viewer-content.zoom-200 .pdf-viewer-pages {
    max-width: 2400px;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .pdf-viewer-toolbar {
        padding: 8px 10px;
    }
    
    .pdf-viewer-controls,
    .pdf-viewer-actions {
        gap: 3px;
    }
    
    .pdf-viewer-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
    }
    
    .pdf-viewer-thumbnails {
        width: 150px;
    }
    
    .pdf-viewer-content {
        padding: 15px 5px;
    }
    
    .pdf-viewer-pages {
        gap: 15px;
    }
}

@media screen and (max-width: 768px) {
    .pdf-viewer-toolbar {
        padding: 6px 8px;
        gap: 5px;
    }
    
    .pdf-viewer-btn {
        min-width: 30px;
        height: 30px;
        padding: 0 6px;
    }
    
    .pdf-viewer-btn .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    .pdf-viewer-page-info {
        font-size: 12px;
    }
    
    .pdf-viewer-current-page {
        width: 45px;
        height: 28px;
        font-size: 12px;
    }
    
    .pdf-viewer-zoom-level {
        min-width: 45px;
        font-size: 12px;
    }
    
    .pdf-viewer-thumbnails {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.5);
        width: 140px;
    }
    
    .pdf-viewer-content {
        padding: 10px 5px;
    }
    
    .pdf-viewer-pages {
        gap: 10px;
        max-width: 100% !important;
    }
}

@media screen and (max-width: 480px) {
    .pdf-viewer-toolbar {
        padding: 5px;
        gap: 3px;
    }
    
    .pdf-viewer-controls {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .pdf-viewer-actions {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .pdf-viewer-btn {
        min-width: 28px;
        height: 28px;
        padding: 0 5px;
    }
    
    .pdf-viewer-page-separator {
        display: none;
    }
    
    .pdf-viewer-thumbnails {
        width: 120px;
    }
    
    .pdf-viewer-content {
        padding: 5px;
    }
}

/* Print Styles */
@media print {
    .pdf-viewer-toolbar,
    .pdf-viewer-thumbnails {
        display: none !important;
    }
    
    .pdf-viewer-container {
        box-shadow: none;
        border: none;
    }
    
    .pdf-viewer-content {
        overflow: visible;
        background: #fff;
    }
    
    .pdf-viewer-pages {
        gap: 0;
    }
    
    .pdf-viewer-page {
        page-break-after: always;
        box-shadow: none;
        margin-bottom: 0;
    }
}

/* Smooth Transitions */
.pdf-viewer-btn,
.pdf-viewer-thumbnail {
    transition: all 0.2s ease;
}

/* Accessibility */
.pdf-viewer-btn:focus,
.pdf-viewer-current-page:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.pdf-viewer-thumbnail:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Loading State for Pages */
.pdf-viewer-page.loading {
    min-height: 200px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-viewer-page.loading::after {
    content: 'Loading...';
    color: #999;
    font-size: 14px;
}