/* SG PDF Viewer Styles */

.sgpdf-wrap {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    margin: 1.5rem 0;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.sgpdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    color: #fff;
    padding: .5rem .75rem;
    gap: .5rem;
    flex-wrap: wrap;
}

.sgpdf-toolbar__left,
.sgpdf-toolbar__right {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.sgpdf-toolbar__title {
    font-size: .85rem;
    color: #ccc;
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 .5rem;
}

.sgpdf-btn {
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}

.sgpdf-btn:hover {
    background: rgba(255,255,255,.25);
}

.sgpdf-btn:active {
    background: rgba(255,255,255,.35);
}

.sgpdf-page-info,
.sgpdf-zoom-level {
    font-size: .82rem;
    color: #ccc;
    min-width: 80px;
    text-align: center;
}

.sgpdf-zoom-level {
    min-width: 44px;
}

/* ── Canvas area ─────────────────────────────────────────────────────────── */

.sgpdf-canvas-wrap {
    height: var(--sgpdf-height, 800px);
    overflow-y: auto;
    overflow-x: auto;
    background: #525659;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.sgpdf-canvas {
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    background: #fff;
    display: block;
    max-width: 100%;
}

/* ── Loading state ───────────────────────────────────────────────────────── */

.sgpdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: #ccc;
    font-size: .9rem;
    position: absolute;
}

.sgpdf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sgpdf-spin .8s linear infinite;
}

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

/* ── Mobile hint ─────────────────────────────────────────────────────────── */

.sgpdf-mobile-hint {
    display: none;
    text-align: center;
    font-size: .78rem;
    color: #888;
    padding: .4rem;
    background: #fafafa;
    border-top: 1px solid #e5e5e5;
}

@media (max-width: 768px) {
    .sgpdf-mobile-hint {
        display: block;
    }

    .sgpdf-toolbar__title {
        display: none;
    }

    .sgpdf-canvas-wrap {
        height: 70vh;
        padding: .5rem;
    }

    .sgpdf-page-info {
        min-width: 60px;
        font-size: .78rem;
    }
}

/* ── Print — disable printing ────────────────────────────────────────────── */

@media print {
    .sgpdf-wrap {
        display: none !important;
    }
}
