/**
 * Popup LNF Simple Styles
 */

/* Button/link styling */
.popup-lnf-trigger {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.popup-lnf-trigger:hover {
    background: #005a87;
}

/* Style for any element with popup-lnf class */
.popup-lnf {
    cursor: pointer;
    position: relative;
}

/* Ensure clickable elements show pointer cursor */
a.popup-lnf,
button.popup-lnf,
img.popup-lnf,
div.popup-lnf {
    cursor: pointer !important;
}

/* Optional: Add subtle hover effect to images */
img.popup-lnf {
    transition: opacity 0.2s, transform 0.2s;
}

img.popup-lnf:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Modal styles */
.popup-lnf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.popup-lnf-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-lnf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.popup-lnf-container {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.popup-lnf-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.popup-lnf-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.popup-lnf-close:hover {
    background: #e0e0e0;
    color: #333;
}

.popup-lnf-content {
    padding: 20px;
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
}

/* Loading state */
.popup-lnf-loading {
    font-size: 16px;
    color: #666;
    text-align: center;
}

/* PDF viewer */
.popup-lnf-pdf-viewer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.popup-lnf-pdf-toolbar {
    background: #f5f5f5;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.popup-lnf-pdf-toolbar button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
}

.popup-lnf-pdf-toolbar button:hover {
    background: #005a87;
}

.popup-lnf-pdf-toolbar button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.popup-lnf-pdf-pages {
    flex: 1;
    overflow: auto;
    text-align: center;
    padding: 20px;
    background: #f0f0f0;
}

.popup-lnf-pdf-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: white;
}

/* Image viewer */
.popup-lnf-image-viewer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-lnf-image-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Error state */
.popup-lnf-error {
    color: #d63384;
    text-align: center;
    padding: 20px;
    font-size: 16px;
}

/* Security - disable text selection and context menu */
.popup-lnf-content {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.popup-lnf-content * {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Responsive */
@media (max-width: 768px) {
    .popup-lnf-container {
        width: 95vw;
        height: 95vh;
        max-width: none;
        max-height: none;
    }
    
    .popup-lnf-content {
        padding: 10px;
        min-height: 300px;
    }
    
    .popup-lnf-pdf-toolbar {
        padding: 8px;
        gap: 8px;
    }
    
    .popup-lnf-pdf-toolbar button {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* Animation */
.popup-lnf-modal.active .popup-lnf-container {
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}