.pdf-overlay { align-items: center; background: rgba(44,62,80,.9); color: #e74c3c; display: none; font-size: 24px; font-weight: 700; height: 100%; justify-content: center; left: 0; position: absolute; top: 0; width: 100%; }
.thumb.is-processed .pdf-overlay { display: flex; }
.delete-btn, .file-size, .remove-btn, .status-text { display: none !important; }

.pdf-settings { background: rgba(30,41,59,.5); border: 1px solid hsla(0,0%,100%,.1); border-radius: 10px; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 15px auto; max-width: fit-content; padding: 12px 20px; align-items: center; display: flex; }
.setting-item { align-items: center; display: flex; gap: 8px; }
.setting-item label { color: #94a3b8; font-size: 13px; white-space: nowrap; }
.setting-item input, .setting-item select { background: #0f172a; border: 1px solid #334155; border-radius: 6px; color: #fff; font-size: 13px; outline: none; padding: 6px 10px; transition: border-color .2s; }
#imagesPerPdfInput { text-align: center; width: 60px; }


#filesStatus { font-variant-numeric: tabular-nums; }
.stats { align-items: center; display: flex; flex-wrap: wrap; justify-content: center; margin-top: 10px; padding: 6px 12px; gap: 8px; }
.selection-info { flex: 0 1 auto; font-size: clamp(13px,1.4vw,16px); max-width: 50%; min-width: 140px; text-align: left; white-space: normal; }
.selection-info #count, .selection-info #processed-count { color: var(--accent); font-weight: 700; }
.quality-container { align-items: center; display: flex; flex: 0 0 auto; }


#downloadZipBtn.active { background-color: #00C27A !important; color: #fff !important; cursor: pointer !important; opacity: 1 !important; }


.btn-clear-mini { align-items: center; background-color: #ef4444; border: none; border-radius: 50px; box-shadow: 0 4px 12px rgba(0,0,0,.3); color: #fff; cursor: pointer; display: flex; font-size: 11px; font-weight: 600; gap: 5px; padding: 6px 14px; position: absolute; right: 5px; top: -25px; transition: all .2s ease; z-index: 20; }
.btn-clear-mini:hover { background-color: #dc2626; transform: translateY(-2px); }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: .5; } to { opacity: 1; } }


.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}
.image-wrapper { background: #1a1a1a; position: relative; }
.image-wrapper, .thumb img { aspect-ratio: 1/1; width: 100%; }
.thumb img { display: block; height: 100%; object-fit: cover; }
.thumb-footer { background: #000 !important; padding: 8px 5px; text-align: center; }
.thumb-footer .name { color: #fff !important; display: block; font-size: 11px !important; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


@media (max-width: 850px) {
    .bookmark-btn { background: rgba(0,194,122,.1) !important; border: 1px solid var(--accent) !important; border-radius: 20px !important; display: flex !important; margin: 0 5px; white-space: nowrap; font-size: 13px; gap: 8px; padding: 8px 12px; }
}
@media (max-width: 768px) {
    .quality-container { display: block; margin: 15px auto; text-align: center; width: auto; }
    .quality-dropdown { background-position: right 10px center; border-radius: 8px; font-size: 13px; padding: 8px 30px 8px 15px; }
    .btn-clear-mini { right: 0; top: -30px; }
    .preview-grid { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 30px; }
    .thumb { background: transparent !important; border: 1px solid var(--glass); border-radius: 12px; display: flex; flex-basis: 140px; flex-direction: column; flex-grow: 1; max-width: 160px; overflow: hidden; padding: 0 !important; position: relative; }
}
@media (max-width: 600px) {
    .pdf-settings { align-items: stretch; flex-direction: column; max-width: 300px; width: 100%; }
    .setting-item { justify-content: space-between; }
    .controls-row { align-items: center; flex-direction: column; gap: 10px; }
    .selection-info { max-width: 100%; order: 2; text-align: center; width: 100%; }
    .quality-container { order: 1; width: auto; }
    .quality-dropdown { min-width: 160px; }
}
@media (max-width: 360px) {
    .bookmark-btn { font-size: 11px; gap: 4px; padding: 5px 8px; }
}

.thumb {
    background: transparent !important;
    border: 1px solid var(--glass);
    border-radius: 12px;
    flex-direction: column;
    height: 140px !important;
    overflow: hidden;
    padding: 0 !important;
    flex: 0 0 140px !important;
    transition: all .3s ease;
    margin: 0 !important;
    max-width: 140px !important;
    min-width: 140px !important;
    width: 140px !important;
}



#preview:empty,#pdfList:empty {display: none !important;}


#preview {
    background-color: rgba(0,0,0,.4)!important;
    box-shadow: inset 0px 12px 30px rgba(0, 0, 0, 0.35), inset 0px -4px 15px rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 25px !important;
    margin: 30px auto;
    width: 100%;
    max-width: 1200px;
    min-height: 190px;
    max-height: 550px; 
    overflow-y: auto !important;
    overflow-x: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-content: flex-start;
    box-sizing: border-box;
}


#preview::-webkit-scrollbar {
    width: 14px;
}
#preview::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 0 16px 16px 0;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
}
#preview::-webkit-scrollbar-thumb {
    background-color: #1e293b;
    border-radius: 10px;
    border: 3px solid #06090e;
}
#preview::-webkit-scrollbar-thumb:hover {
    background-color: #334155;
}