/* ==========================================================================
   PDF Viewer Widget
   ========================================================================== */

.marthoma-pdf-viewer {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* Toolbar / Navigation */
.marthoma-pdf-viewer__toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.marthoma-pdf-viewer__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #4A6572;
    border-radius: 4px;
    background: #fff;
    color: #4A6572;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.marthoma-pdf-viewer__btn:hover {
    background-color: #4A6572;
    color: #fff;
}

.marthoma-pdf-viewer__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.marthoma-pdf-viewer__btn:disabled:hover {
    background: #fff;
    color: #4A6572;
}

.marthoma-pdf-viewer__page-info {
    font-size: 14px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

/* Canvas Container */
.marthoma-pdf-viewer__canvas-container {
    overflow-y: auto;
    overflow-x: hidden;
    text-align: center;
    background-color: #e8e8e8;
}

.marthoma-pdf-viewer__canvas {
    display: block;
    margin: 0 auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* Loading State */
.marthoma-pdf-viewer__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(232, 232, 232, 0.8);
    z-index: 5;
    transition: opacity 0.3s;
}

.marthoma-pdf-viewer__loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.marthoma-pdf-viewer__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-top-color: #4A6572;
    border-radius: 50%;
    animation: marthoma-pdf-spin 0.8s linear infinite;
}

@keyframes marthoma-pdf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Editor Placeholder */
.marthoma-pdf-viewer-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    text-align: center;
    color: #999;
}

.marthoma-pdf-viewer-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
}

.marthoma-pdf-viewer-placeholder p {
    margin: 0;
    font-size: 14px;
}
