/**
 * Woo PDF Preview Frontend Styles
 */

/* PDF Preview Button */
.woo-pdf-preview-button-container {
    margin: 20px 0;
}

.woo-pdf-preview-button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.woo-pdf-preview-button:hover {
    background-color: #005177;
}

/* PDF Viewer Popup */
.woo-pdf-viewer-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow-y: auto;
}

.woo-pdf-viewer-popup-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    width: 90%;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.woo-pdf-viewer-popup-header {
    padding: 15px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    background-color: #f8f9fa;
}

.woo-pdf-viewer-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    height: 40px;
    width: 40px;
    line-height: 40px;
    text-align: center;
    transition: all 0.2s ease;
    z-index: 11;
}

.woo-pdf-viewer-close:hover {
    color: #000;
}

.woo-pdf-viewer-popup-body {
    padding: 20px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* PDF Container */
.woo-pdf-container {
    position: relative;
    flex: 1;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.woo-pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #666;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

/* Progress Bar */
.woo-pdf-progress {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    z-index: 5;
    text-align: center;
}

.woo-pdf-progress .progress-bar-container {
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.woo-pdf-progress .progress-bar {
    height: 100%;
    background-color: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
}

.woo-pdf-progress .progress-text {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.woo-pdf-canvas-container {
    flex: 1;
    overflow: auto;
    position: relative;
    padding: 10px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

#woo-pdf-pages-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.woo-pdf-page-placeholder {
    position: relative;
    margin: 0 auto;
    background-color: #f8f9fa;
    border: 1px solid #e5e5e5;
    min-height: 100px; /* Minimal height for empty placeholder */
    display: flex;
    justify-content: center;
    align-items: center;
}

.woo-pdf-page-placeholder:before {
    content: 'Loading...';
    font-size: 14px;
    color: #999;
    position: absolute;
}

.woo-pdf-page-placeholder.rendered:before {
    display: none;
}

.woo-pdf-page-canvas {
    display: block;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* PDF Info */
.woo-pdf-info {
    padding: 12px;
    text-align: center;
    background-color: #f8f9fa;
    border-top: 1px solid #e5e5e5;
    font-size: 14px;
    color: #555;
}

/* Mobile view enhancements */
.woo-pdf-viewer-popup.mobile-view .woo-pdf-viewer-popup-content {
    margin: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
}

.woo-pdf-viewer-popup.mobile-view .woo-pdf-viewer-popup-body {
    padding: 10px;
}

.woo-pdf-viewer-popup.mobile-view .woo-pdf-canvas-container {
    padding: 5px;
}

.woo-pdf-viewer-popup.mobile-view #woo-pdf-pages-container {
    gap: 15px;
    padding: 10px 0;
}

.woo-pdf-viewer-popup.mobile-view .woo-pdf-progress {
    width: 90%;
    padding: 15px;
}

.woo-pdf-viewer-popup.mobile-view .woo-pdf-viewer-close {
    top: 5px;
    right: 5px;
    font-size: 24px;
    height: 44px;
    width: 44px;
}

@media screen and (max-width: 768px) {
    .woo-pdf-preview-button {
        width: 100%;
        padding: 14px;
    }
    
    .woo-pdf-viewer-popup-content:not(.mobile-view) {
        width: 95%;
        margin: 2.5% auto;
        height: 95vh;
    }
    
    .woo-pdf-progress {
        width: 90%;
        padding: 15px;
    }
} 