/* Adobe File Embedder - Frontend Styles */

.afe-container {
    position: relative;
    margin: 30px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: flex;
    flex-direction: column;
}

.afe-error {
    padding: 40px;
    text-align: center;
    color: #dc3545;
    font-weight: 600;
}

/* PDF Viewer */
.afe-pdf-viewer {
    position: relative;
    background: #525659;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px;
    flex: 1;
    min-height: 0; /* Important for flex scrolling */
}

.afe-pdf-canvas {
    display: block;
    max-width: none; /* Allow canvas to be larger than container when zoomed */
    height: auto;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: #fff;
}

.afe-pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    z-index: 10;
}

/* Prevent text selection in canvas */
.afe-pdf-canvas {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Image Viewer */
.afe-image-viewer {
    position: relative;
    background: #fff;
    text-align: center;
    padding: 20px;
}

.afe-image {
    max-width: 100%;
    height: auto;
    display: inline-block;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
}

/* Watermark - Multiple instances for better coverage */
.afe-watermark {
    position: absolute;
    color: rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 700;
    font-family: monospace;
    pointer-events: none;
    user-select: none;
    z-index: 9999;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

/* Position watermark for PDFs */
.afe-pdf-viewer .afe-watermark {
    position: fixed;
    bottom: 80px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Position watermark for images */
.afe-watermark-image {
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 12px;
}

/* Controls */
.afe-controls {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #ddd;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0; /* Don't shrink controls */
}

.afe-page-info {
    padding: 10px 15px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.afe-controls button,
.afe-controls a {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.afe-controls button:hover,
.afe-controls a:hover {
    background: #f8f9fa;
    border-color: #999;
    transform: translateY(-1px);
}

.afe-controls button:active {
    transform: translateY(0);
}

.afe-download {
    background: #667eea !important;
    color: #fff !important;
    border-color: #667eea !important;
}

.afe-download:hover {
    background: #5568d3 !important;
    border-color: #5568d3 !important;
}

/* Disable text selection on the entire container */
.afe-container * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Prevent dragging */
.afe-container img,
.afe-container iframe {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Print protection */
@media print {
    .afe-container {
        display: none !important;
    }
    
    .afe-container::before {
        content: "This content is protected and cannot be printed. Please view online.";
        display: block;
        padding: 40px;
        text-align: center;
        font-size: 18px;
        color: #dc3545;
    }
}

/* Fullscreen mode */
.afe-container:fullscreen {
    background: #525659;
}

.afe-container:fullscreen .afe-pdf-viewer {
    height: 100vh !important;
}

.afe-container:fullscreen .afe-pdf-canvas {
    max-height: calc(100vh - 60px);
}

/* Responsive */
@media (max-width: 768px) {
    .afe-controls {
        flex-wrap: wrap;
    }
    
    .afe-controls button,
    .afe-controls a {
        flex: 1 1 45%;
        justify-content: center;
    }
    
    .afe-watermark {
        font-size: 10px;
        padding: 6px 12px;
    }
}

/* Additional watermark layer (diagonal across content) */
.afe-container::after {
    content: attr(data-watermark);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 60px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.03);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 1000;
}
