/* Hocmate Content Protector - Premium Flipbook Styles */
:root {
    --hmp-bg-dark: #1a1c23;
    --hmp-toolbar-bg: #242731;
    --hmp-primary: #6C3AED;
    --hmp-text: #ffffff;
    --hmp-text-muted: #9CA3AF;
    --hmp-border: #374151;
}

.hmp-pdf-wrapper.hmp-flipbook-theme {
    display: flex;
    flex-direction: column;
    background: var(--hmp-bg-dark);
    color: var(--hmp-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 5; /* Lowered wrapper z-index to stay under portal headers */
    margin-bottom: 25px;
}

/* Toolbars */
.hmp-toolbar-top, .hmp-toolbar-bottom {
    background: var(--hmp-toolbar-bg);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10; /* Lower than most portal headers */
    border-bottom: 1px solid var(--hmp-border);
}

.hmp-toolbar-bottom {
    border-bottom: none;
    border-top: 1px solid var(--hmp-border);
    flex-direction: column;
    gap: 10px;
}

.hmp-document-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--hmp-text);
}

.hmp-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.hmp-btn {
    background: #374151;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hmp-btn:hover {
    background: var(--hmp-primary);
}

.hmp-zoom-level {
    font-size: 13px;
    min-width: 45px;
    text-align: center;
}

/* Viewport */
.hmp-pdf-container.hmp-spread-view {
    position: relative;
    background: #111827;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hmp-pdf-viewer-canvas-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    height: 95%;
    width: 100%;
    transition: opacity 0.3s ease-in-out; /* Smooth fade for page flipping */
    opacity: 1;
}

.hmp-view-mode {
    font-size: 18px !important;
}

.hmp-pdf-viewer-canvas-wrap canvas {
    max-height: 100%;
    width: auto !important;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background: white;
}

/* Navigation Arrows */
.hmp-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    border: none;
    color: white;
    width: 44px;
    height: 60px;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.hmp-nav-btn:hover {
    background: var(--hmp-primary);
}

.hmp-prev-btn { left: 10px; border-radius: 0 8px 8px 0; }
.hmp-next-btn { right: 10px; border-radius: 8px 0 0 8px; }

/* Page Info & Progress */
.hmp-page-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hmp-current-page-input {
    background: #1f2937;
    border: 1px solid #4b5563;
    color: white;
    width: 40px;
    text-align: center;
    border-radius: 4px;
    padding: 2px;
}

.hmp-progress-container {
    width: 100%;
    max-width: 500px;
}

.hmp-progress-bar-wrap {
    height: 4px;
    background: #374151;
    border-radius: 2px;
    overflow: hidden;
}

.hmp-progress-bar {
    height: 100%;
    background: var(--hmp-primary);
    width: 0%;
    transition: width 0.3s;
}

.hmp-security-tag {
    font-size: 10px;
    color: var(--hmp-text-muted);
}

.hmp-security-notice {
    font-size: 11px;
    color: var(--hmp-text-muted);
    text-align: center;
    padding: 8px;
    background: #111827;
}

/* Loading */
.hmp-pdf-loading {
    position: absolute;
    inset: 0;
    background: var(--hmp-bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.hmp-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #374151;
    border-top-color: var(--hmp-primary);
    border-radius: 50%;
    animation: hmpSpin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes hmpSpin { to { transform: rotate(360deg); } }

/* Video Watermark Styles */
.hmp-video-watermark {
    position: absolute;
    pointer-events: none;
    z-index: 99999;
    color: rgba(255, 255, 255, 0.4);
    font-family: sans-serif;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 1.2s ease-in-out;
    white-space: nowrap;
    user-select: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hmp-pdf-viewer-canvas-wrap {
        flex-direction: column;
    }
    .hmp-toolbar-top .hmp-document-title {
        display: none;
    }
}

@media print {
    body * { visibility: hidden !important; }
    .hmp-pdf-wrapper { display: none !important; }
}
