/* ==========================================
   PDF MERGE & SPLIT
========================================== */

.pdf-tools-page .tool-page-title {
    font-size: 2.25rem;
    font-weight: 700;
}

.pdf-tools-page .tool-page-description {
    font-size: 1.075rem;
    color: var(--gray-color, #6b7280);
    max-width: 780px;
    margin: 0 auto;
}

/* ---------- Mode tabs ---------- */
#pdfModeTabs .nav-link {
    border: 2px solid #e5e7eb;
    color: var(--dark-color, #1f2937);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    margin: 0 0.25rem;
    background: #fff;
}

#pdfModeTabs .nav-link.active {
    background: var(--primary-color, #2563eb);
    border-color: var(--primary-color, #2563eb);
    color: #fff;
}

/* ---------- Merge file list ---------- */
.pdf-file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pdf-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pdf-file-item:hover {
    border-color: var(--primary-light, #60a5fa);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pdf-file-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.pdf-file-info {
    flex: 1 1 auto;
    min-width: 0;
}

.pdf-file-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-file-meta {
    font-size: 0.78rem;
    color: var(--gray-color, #6b7280);
}

.pdf-file-actions {
    flex-shrink: 0;
    display: flex;
    gap: 4px;
}

/* ---------- Page grid ---------- */
.pdf-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    max-height: 560px;
    overflow-y: auto;
    padding: 4px;
}

.pdf-page-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    text-align: center;
    background: #fff;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.pdf-page-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light, #60a5fa);
}

.pdf-page-card.selected {
    border-color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pdf-page-card.selected::after {
    content: '\F26E';
    font-family: "bootstrap-icons";
    position: absolute;
    top: 4px;
    right: 6px;
    color: var(--primary-color, #2563eb);
    font-size: 0.95rem;
    line-height: 1;
}

.pdf-page-thumb {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
    color: #adb5bd;
    font-size: 2rem;
    transition: transform 0.2s ease;
}

.pdf-page-thumb canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.pdf-page-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-color, #6b7280);
    margin-top: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .pdf-tools-page .tool-page-title {
        font-size: 1.75rem;
    }

    .pdf-page-grid {
        max-height: none;
    }
}

@media (max-width: 575px) {
    .pdf-page-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .pdf-page-thumb {
        height: 90px;
    }
}
