/* PDF Embed with Download — Viewer CSS */

/* Wrapper */
.pedl-wrap {
    display: block;
    margin: 1.5em auto;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    background: #fff;
    box-shadow: 0 1px 8px rgba(0,0,0,.08);
}

/* Title bar */
.pedl-title-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: #f8f9fb;
    border-bottom: 1px solid #e4e7ec;
    color: #344054;
    font-weight: 600;
    font-size: .88rem;
}
.pedl-doc-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #d92d20;
}
.pedl-doc-icon svg { width: 100%; height: 100%; }
.pedl-doc-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toolbar */
.pedl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: #1d2939;
    color: #fff;
    flex-wrap: wrap;
}
.pedl-toolbar-left,
.pedl-toolbar-center,
.pedl-toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Toolbar buttons */
.pedl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: #d0d5dd;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    line-height: 1;
    transition: background .15s, color .15s;
}
.pedl-btn:hover:not(:disabled) {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.pedl-btn:disabled {
    opacity: .35;
    cursor: default;
}
.pedl-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Page input */
.pedl-page-info {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #d0d5dd;
    font-size: .82rem;
}
.pedl-page-input {
    width: 42px;
    text-align: center;
    border: 1px solid #475467;
    border-radius: 4px;
    background: #101828;
    color: #fff;
    font-size: .82rem;
    padding: 3px 4px;
    -moz-appearance: textfield;
}
.pedl-page-input::-webkit-inner-spin-button { display: none; }
.pedl-total { color: #98a2b3; }

/* Zoom select */
.pedl-zoom-select {
    background: #101828;
    border: 1px solid #475467;
    border-radius: 4px;
    color: #d0d5dd;
    font-size: .8rem;
    padding: 4px 6px;
    cursor: pointer;
}
.pedl-zoom-select:disabled { opacity: .4; }

/* Download button */
.pedl-download {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #039855;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 5px;
    padding: 5px 12px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s;
}
.pedl-download:hover {
    background: #027a48;
}
.pedl-download svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Viewport */
.pedl-viewport {
    position: relative;
    background: #525659;
    min-height: 420px;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Canvas */
.pedl-canvas {
    display: block;
    box-shadow: 0 4px 24px rgba(0,0,0,.35);
    max-width: 100%;
}

/* Loading */
.pedl-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ccc;
    font-size: .88rem;
    z-index: 2;
}
.pedl-loading p { margin: 0; }
.pedl-spinner {
    width: 38px; height: 38px;
    border: 4px solid rgba(255,255,255,.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pedl-spin .72s linear infinite;
}
@keyframes pedl-spin { to { transform: rotate(360deg); } }

/* Error */
.pedl-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fca5a5;
    font-size: .9rem;
    text-align: center;
    padding: 20px;
}
.pedl-error a { color: #86efac; }

/* Responsive */
@media (max-width: 540px) {
    .pedl-toolbar { gap: 6px; }
    .pedl-download span { display: none; }
    .pedl-zoom-select { max-width: 70px; }
}
