/* PDF Viewer Modal Styles */
.pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.pdf-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.pdf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.pdf-modal-content {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1200px;
    max-height: 900px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.pdf-modal.hidden .pdf-modal-content {
    transform: scale(0.95);
}

/* PDF Header */
.pdf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.pdf-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.pdf-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pdf-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* PDF Toolbar */
.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    flex-wrap: wrap;
    gap: 12px;
}

.pdf-nav-controls,
.pdf-zoom-controls,
.pdf-action-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-toolbar button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-toolbar button:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pdf-toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdf-toolbar .download-btn {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pdf-toolbar .download-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.page-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

#zoom-level {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

/* PDF Viewer Container */
.pdf-viewer-container {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background: #f3f4f6;
    overflow: auto;
    padding: 20px;
    position: relative;
}

#pdf-canvas {
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background: white;
    margin: 0 auto;
    /* 크기 제한 제거 - 확대 시 실제 크기로 표시 */
}

/* Loading State */
.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #ef4444;
    text-align: center;
}

.error-message svg {
    color: #ef4444;
}

/* Toast Notification */
.pdf-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #10b981;
    color: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.pdf-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Document Action Buttons */
.document-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.pdf-viewer-btn,
.pdf-download-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

.pdf-viewer-btn {
    background: #3b82f6;
    color: white;
    flex: 1;
}

.pdf-viewer-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pdf-download-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.pdf-download-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pdf-viewer-btn .icon,
.pdf-download-btn .icon {
    font-size: 20px;
}

.pdf-viewer-btn div,
.pdf-download-btn div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pdf-viewer-btn strong,
.pdf-download-btn strong {
    font-size: 14px;
    margin-bottom: 2px;
}

.pdf-viewer-btn small,
.pdf-download-btn small {
    font-size: 12px;
    opacity: 0.8;
}

/* File Info */
.file-info {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.file-info span {
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pdf-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    
    .pdf-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 16px;
    }
    
    .pdf-nav-controls,
    .pdf-zoom-controls,
    .pdf-action-controls {
        justify-content: center;
    }
    
    .pdf-toolbar button {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .pdf-viewer-container {
        padding: 12px;
    }
    
    .document-actions {
        flex-direction: column;
    }
    
    .pdf-viewer-btn,
    .pdf-download-btn {
        justify-content: center;
        text-align: center;
        padding: 20px;
    }
    
    .pdf-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .pdf-header {
        padding: 12px 16px;
    }
    
    .pdf-title {
        font-size: 16px;
    }
    
    .pdf-toolbar {
        padding: 8px 12px;
    }
    
    .pdf-toolbar button {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .pdf-nav-controls {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }
    
    .pdf-zoom-controls {
        order: 2;
        justify-content: center;
    }
    
    .pdf-action-controls {
        order: 3;
        justify-content: center;
    }
}

/* Fullscreen Mode */
.pdf-modal:fullscreen {
    background: black;
}

.pdf-modal:fullscreen .pdf-modal-content {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

.pdf-modal:fullscreen .pdf-modal-overlay {
    display: none;
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #pdf-canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

