/* Общ стил за PDF инструментите: merge, split и бъдещите (img2pdf, watermark...) */

.pdf-tool-wrapper {
    margin: 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.pdf-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.pdf-dropzone.dragover {
    border-color: #20c997;
    background: #f0fdfa;
}

.pdf-privacy-note {
    font-size: .85rem;
    color: #6b7280;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ── Само за pdf-merge: списък с качени файлове ── */
.pdf-file-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: .5rem;
    background: #fff;
}

.pdf-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-file-size {
    color: #6b7280;
    font-size: .85rem;
}

.pdf-row-actions {
    display: flex;
    gap: .25rem;
}

/* ── Само за pdf-split: grid с thumbnail-и на страниците ── */
#pdf-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}

.pdf-thumb {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: .4rem;
    cursor: pointer;
    text-align: center;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.pdf-thumb:hover {
    border-color: #94a3b8;
}

.pdf-thumb.selected {
    border-color: #20c997;
    box-shadow: 0 0 0 2px rgba(32, 201, 151, .25);
}

.pdf-thumb canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.pdf-thumb-label {
    margin-top: .3rem;
    font-size: .8rem;
    color: #6b7280;
}
/* ── Само за img2pdf: dropzone, sortable галерия със снимки ── */
:root {
    --i2p-primary: #0d6efd;
    --i2p-border: #dee2e6;
}

#i2p-dropzone {
    border: 2px dashed var(--i2p-border);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fafbfc;
}
#i2p-dropzone.dragover {
    border-color: var(--i2p-primary);
    background: #eef5ff;
}
#i2p-dropzone i {
    font-size: 2.2rem;
    color: var(--i2p-primary);
    margin-bottom: .5rem;
    display: block;
}
#i2p-file-input {
    display: none;
}

#i2p-thumbs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.i2p-thumb-item {
    width: 130px;
    border: 1px solid var(--i2p-border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    cursor: grab;
    position: relative;
    user-select: none;
}
.i2p-thumb-item.ui-sortable-helper {
    box-shadow: 0 6px 16px rgba(0,0,0,.15);
}
.i2p-thumb-item.ui-sortable-placeholder {
    visibility: visible !important;
    background: #eef5ff;
    border: 2px dashed var(--i2p-primary);
}
.i2p-thumb-img-wrap {
    width: 100%;
    height: 100px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.i2p-thumb-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.i2p-thumb-order {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(13,110,253,.9);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.i2p-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220,53,69,.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    line-height: 1;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.i2p-thumb-name {
    font-size: .72rem;
    color: #6c757d;
    padding: .3rem .4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#i2p-empty-hint {
    color: #adb5bd;
    font-size: .9rem;
    padding: .5rem 0;
}

/* ── Само за pdf-watermark ── */
#wm-options .form-range {
    accent-color: #0d6efd;
}
#wm-file-row {
    align-items: center;
}