/* ============================================
   PDF Viewer - Mobile-First Professional Design
   ============================================ */

/* Container */
.pdf-viewer-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #1a1a1a;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Header/Toolbar */
.pdf-toolbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    z-index: 10;
}

.pdf-toolbar.hidden {
    transform: translateY(-100%);
}

/* Toolbar Sections */
.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-center {
    flex: 1;
    justify-content: center;
}

/* Buttons */
.pdf-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.pdf-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.pdf-btn:active {
    transform: scale(0.95);
}

.pdf-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pdf-btn i {
    font-size: 18px;
}

/* Close Button */
.btn-close-viewer {
    background: rgba(244, 67, 54, 0.9);
}

.btn-close-viewer:hover {
    background: rgba(244, 67, 54, 1);
}

/* Page Info */
.page-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 600;
}

.page-input {
    width: 50px;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.page-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
}

/* Canvas Container */
.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

#pdf-canvas {
    display: block;
    margin: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background: white;
    max-width: 100%;
    height: auto;
    touch-action: pan-x pan-y pinch-zoom;
}

/* Loading Overlay */
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.pdf-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Progress Bar */
.pdf-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.pdf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    gap: 4px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .pdf-toolbar {
        padding: 10px 12px;
    }

    .pdf-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 44px;
        min-height: 44px;
    }

    .pdf-btn span {
        display: none;
        /* Hide text on mobile */
    }

    .page-info {
        font-size: 13px;
    }

    .page-input {
        width: 45px;
        padding: 6px;
        font-size: 13px;
    }
}

/* Fullscreen Mode */
.pdf-viewer-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

/* Security - Disable Selection */
.pdf-canvas-container,
#pdf-canvas,
#pdf-canvas-inline {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Smooth Transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Toast Notifications */
.pdf-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pdf-toast.show {
    opacity: 1;
}

/* ============================================
   Inline Mode - Embedded in Page
   ============================================ */

.inline-pdf-container {
    width: 100%;
}

.pdf-viewer-container.inline-mode {
    position: relative;
    width: 100%;
    height: auto;
    background: #2a2a2a;
}

.inline-canvas {
    height: 600px !important;
    overflow: auto;
}

#pdf-canvas-inline {
    display: block;
    margin: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background: white;
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .inline-canvas {
        height: 500px !important;
    }
}

/* Landscape Optimization */
@media (orientation: landscape) and (max-width: 896px) {
    .pdf-toolbar {
        padding: 8px 12px;
    }

    .pdf-btn {
        padding: 6px 10px;
        min-width: 40px;
        min-height: 40px;
    }
}