/* PDF Viewer Container */
.pdf-viewer-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 300px);
    min-height: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding: 0;
}

/* Main Viewer */
.main-viewer-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    min-width: 0;
}

.viewer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border-bottom: 2px solid #3498db;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pdf-title {
    font-weight: 600;
    font-size: 1rem;
    color: #ecf0f1;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-indicator {
    font-size: 0.9rem;
    color: #bdc3c7;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toolbar-btn:active {
    transform: translateY(0);
}

#zoomLevel {
    min-width: 50px;
    text-align: center;
    font-size: 0.9rem;
    color: #ecf0f1;
}

.download-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9, #2471a3);
}

/* PDF Viewer Area */
.pdf-viewer-wrapper {
    flex: 1;
    position: relative;
    overflow: auto;
    background: #e8e8e8;
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.pdf-viewer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    min-height: 100%;
    width: 100%;
}

#pdfCanvas {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    background: white;
    border-radius: 4px;
    max-width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-overlay p {
    margin: 0;
    color: #2c3e50;
    font-weight: 500;
}

/* Thumbnails Sidebar */
.thumbnails-sidebar {
    width: 200px;
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.thumbnails-sidebar.collapsed {
    width: 0;
    border-left: none;
}

.thumbnails-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.thumbnails-header h5 {
    margin: 0;
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 600;
}

.btn-toggle-thumbnails {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-toggle-thumbnails:hover {
    background: rgba(0, 0, 0, 0.05);
}

.thumbnails-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thumbnail-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.thumbnail-item.active {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.thumbnail-item canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.thumbnail-page-number {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdf-viewer-container {
        flex-direction: column;
        height: calc(100vh - 250px);
        min-height: 400px;
        border-radius: 8px;
    }

    .thumbnails-sidebar {
        width: 100%;
        height: 150px;
        border-left: none;
        border-top: 1px solid #dee2e6;
        order: 2;
    }

    .thumbnails-sidebar.collapsed {
        height: 0;
        width: 100%;
    }

    .thumbnails-scroll {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px;
        gap: 10px;
    }

    .thumbnail-item {
        min-width: 80px;
        flex-shrink: 0;
    }

    .main-viewer-wrapper {
        order: 1;
        flex: 1;
    }

    .viewer-toolbar {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

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

    .pdf-title {
        max-width: 150px;
        font-size: 0.85rem;
    }

    .toolbar-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    .download-btn {
        padding: 6px 16px;
        font-size: 0.85rem;
    }

    #zoomLevel {
        min-width: 40px;
        font-size: 0.8rem;
    }

    .btn-toggle-thumbnails {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .pdf-viewer-container {
        height: calc(100vh - 200px);
        min-height: 300px;
        border-radius: 0;
        margin: 0 -12px;
    }

    .toolbar-left {
        flex-direction: column;
        gap: 4px;
        align-items: center;
    }

    .pdf-title {
        max-width: 100%;
        text-align: center;
    }

    .thumbnails-sidebar {
        height: 120px;
    }

    .thumbnail-item {
        min-width: 60px;
    }

    .viewer-toolbar {
        padding: 6px 8px;
    }

    .toolbar-btn {
        padding: 3px 8px;
        font-size: 0.7rem;
        min-width: 30px;
    }

    #zoomLevel {
        min-width: 35px;
        font-size: 0.7rem;
    }
}

/* Scrollbar Styling */
.thumbnails-scroll::-webkit-scrollbar,
.pdf-viewer-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.thumbnails-scroll::-webkit-scrollbar-track,
.pdf-viewer-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.thumbnails-scroll::-webkit-scrollbar-thumb,
.pdf-viewer-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.thumbnails-scroll::-webkit-scrollbar-thumb:hover,
.pdf-viewer-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Smooth animations */
.pdf-viewer-container {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* PDF Selector Dropdown */
.pdf-selector {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    padding: 4px 28px 4px 12px !important;
    font-size: 0.85rem !important;
    max-width: 200px !important;
    cursor: pointer !important;
    appearance: auto !important;
}

.pdf-selector:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

.pdf-selector option {
    background: #2c3e50 !important;
    color: white !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .pdf-selector {
        max-width: 140px !important;
        font-size: 0.75rem !important;
        padding: 2px 24px 2px 8px !important;
    }
}

@media (max-width: 480px) {
    .pdf-selector {
        max-width: 100px !important;
        font-size: 0.7rem !important;
    }
}
