/**
 * PDF Embed & SEO Pro+ Viewer Styles
 *
 * @package PDF_Embed_SEO_Optimize
 * @subpackage Pro_Plus
 * @since 1.3.0
 */

/* Pro+ Toolbar Extension */
.pdf-viewer-toolbar .pdf-pro-plus-tools {
    display: flex;
    gap: 5px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.pdf-viewer-toolbar .pdf-pro-plus-tool {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.pdf-viewer-toolbar .pdf-pro-plus-tool:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pdf-viewer-toolbar .pdf-pro-plus-tool.active {
    background: rgba(118, 75, 162, 0.5);
}

/* Annotations Layer */
.pdf-annotations-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.pdf-annotations-layer.editing {
    pointer-events: auto;
    cursor: crosshair;
}

/* Annotation Markers */
.pdf-annotation {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
}

.pdf-annotation.note {
    width: 24px;
    height: 24px;
    background: #ffeb3b;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-annotation.note::before {
    content: '\270E';
    font-size: 14px;
}

.pdf-annotation.highlight {
    background: rgba(255, 235, 59, 0.4);
    border-radius: 2px;
}

.pdf-annotation.underline {
    border-bottom: 2px solid #f44336;
    background: transparent;
}

.pdf-annotation.strikethrough {
    text-decoration: line-through;
    text-decoration-color: #f44336;
}

/* Annotation Popup */
.pdf-annotation-popup {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-width: 300px;
    z-index: 100;
}

.pdf-annotation-popup-header {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-radius: 4px 4px 0 0;
}

.pdf-annotation-popup-header .author {
    font-weight: 600;
    font-size: 13px;
}

.pdf-annotation-popup-header .date {
    color: #999;
    font-size: 11px;
}

.pdf-annotation-popup-content {
    padding: 12px;
}

.pdf-annotation-popup-content textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
}

.pdf-annotation-popup-actions {
    padding: 8px 12px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pdf-annotation-popup-actions button {
    padding: 5px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.pdf-annotation-popup-actions .save {
    background: #764ba2;
    color: #fff;
}

.pdf-annotation-popup-actions .delete {
    background: #f44336;
    color: #fff;
}

.pdf-annotation-popup-actions .cancel {
    background: #eee;
    color: #333;
}

/* Signature Pad */
.pdf-signature-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.pdf-signature-box {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
}

.pdf-signature-box h3 {
    margin: 0 0 20px 0;
    text-align: center;
}

.pdf-signature-canvas-wrapper {
    border: 2px dashed #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.pdf-signature-canvas {
    width: 100%;
    height: 150px;
    cursor: crosshair;
}

.pdf-signature-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pdf-signature-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.pdf-signature-actions .sign {
    background: #764ba2;
    color: #fff;
}

.pdf-signature-actions .clear {
    background: #eee;
    color: #333;
}

.pdf-signature-actions .cancel {
    background: #f44336;
    color: #fff;
}

/* Signature Display */
.pdf-signature {
    position: absolute;
    border: 2px solid #764ba2;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
}

.pdf-signature img {
    max-width: 100%;
    height: auto;
}

.pdf-signature-info {
    font-size: 10px;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

.pdf-signature-verified {
    color: #4caf50;
}

.pdf-signature-verified::before {
    content: '\2713 ';
}

/* Heatmap Overlay */
.pdf-heatmap-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.6;
    mix-blend-mode: multiply;
}

/* Engagement Indicator */
.pdf-engagement-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 15px;
}

.pdf-engagement-indicator .score {
    font-size: 32px;
    font-weight: bold;
    color: #764ba2;
}

.pdf-engagement-indicator .label {
    font-size: 12px;
    color: #666;
}

/* Version Badge */
.pdf-version-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #764ba2;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 50;
}

/* Custom Branding */
.pdf-viewer.white-labeled .pdf-branding {
    display: none;
}

.pdf-viewer .pdf-custom-logo {
    max-height: 30px;
    width: auto;
}

/* Progress Tracking Enhancement */
.pdf-reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.pdf-reading-progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* Search Enhancement */
.pdf-search-panel.pro-plus {
    max-height: 400px;
    overflow-y: auto;
}

.pdf-search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.pdf-search-result-item:hover {
    background: #f5f5f5;
}

.pdf-search-result-item .page-num {
    font-weight: bold;
    color: #764ba2;
}

.pdf-search-result-item .context {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.pdf-search-result-item .highlight {
    background: #ffeb3b;
    padding: 0 2px;
}

/* Bookmarks Panel */
.pdf-bookmarks-panel {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: #fff;
    border-right: 1px solid #ddd;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.pdf-bookmarks-panel.open {
    transform: translateX(0);
}

.pdf-bookmarks-panel-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-bookmarks-panel-header h4 {
    margin: 0;
}

.pdf-bookmarks-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    max-height: calc(100% - 60px);
}

.pdf-bookmarks-list li {
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.pdf-bookmarks-list li:hover {
    background: #f9f9f9;
}

.pdf-bookmarks-list li.active {
    background: #f0f6fc;
    border-left: 3px solid #764ba2;
}

/* Dark Theme Overrides */
.pdf-viewer.dark .pdf-annotation.note {
    background: #ffc107;
}

.pdf-viewer.dark .pdf-annotation-popup {
    background: #2d2d2d;
    border-color: #444;
    color: #fff;
}

.pdf-viewer.dark .pdf-annotation-popup-header {
    background: #222;
    border-color: #444;
}

.pdf-viewer.dark .pdf-annotation-popup-content textarea {
    background: #333;
    border-color: #444;
    color: #fff;
}

.pdf-viewer.dark .pdf-signature-modal {
    background: rgba(0, 0, 0, 0.8);
}

.pdf-viewer.dark .pdf-signature-box {
    background: #2d2d2d;
    color: #fff;
}

.pdf-viewer.dark .pdf-bookmarks-panel {
    background: #2d2d2d;
    border-color: #444;
    color: #fff;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .pdf-engagement-indicator {
        bottom: 10px;
        right: 10px;
        padding: 10px 15px;
    }

    .pdf-engagement-indicator .score {
        font-size: 24px;
    }

    .pdf-bookmarks-panel {
        width: 100%;
    }

    .pdf-annotation-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 8px 8px 0 0;
    }
}
