/* PDF Preview Modal - macOS Style */

.pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.pdf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease-out;
}

.pdf-modal-window {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    max-height: 900px;
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.98), rgba(20, 20, 28, 0.98));
    border-radius: 20px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8), 
                0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

/* macOS Window Header */
.pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(50, 50, 60, 0.95), rgba(40, 40, 50, 0.95));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pdf-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.pdf-modal-title i {
    color: #ff6b6b;
    font-size: 1.2rem;
}

/* macOS-style Close Button */
.pdf-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.pdf-modal-close:hover {
    background: rgba(255, 95, 95, 0.9);
    border-color: rgba(255, 95, 95, 1);
    color: white;
    transform: scale(1.05);
}

.pdf-modal-close:active {
    transform: scale(0.95);
}

/* PDF Viewer Container */
.pdf-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #2d2d35;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pdfViewer {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #2d2d35;
}

#pdfViewerEmbed {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Hide scrollbars in PDF viewer */
#pdfViewer::-webkit-scrollbar,
#pdfViewerEmbed::-webkit-scrollbar {
    display: none;
}

#pdfViewer,
#pdfViewerEmbed {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .pdf-modal-window {
        width: 95%;
        height: 85vh;
        border-radius: 16px;
    }

    .pdf-modal-header {
        padding: 14px 20px;
    }

    .pdf-modal-title {
        font-size: 0.9375rem;
    }

    .pdf-modal-close {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 640px) {
    .pdf-modal-window {
        width: 98%;
        height: 92vh;
        border-radius: 12px;
        max-height: none;
    }

    .pdf-modal-header {
        padding: 12px 16px;
    }

    .pdf-modal-title {
        font-size: 0.875rem;
        gap: 10px;
    }

    .pdf-modal-title i {
        font-size: 1rem;
    }

    .pdf-modal-close {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
}

/* Loading State */
.pdf-modal-body::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(14, 165, 233, 0.2);
    border-top-color: var(--accent-primary, #0ea5e9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdf-modal-body.loading::before {
    opacity: 1;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
