/* =====================================================
   PDF TOOLS — Estilos compartilhados (pdf-shared.css)
   ===================================================== */

/* Drop Zone */
.pdf-dropzone {
    border: 2.5px dashed var(--border-2);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.pdf-dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.06), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdf-dropzone:hover,
.pdf-dropzone.drag-over {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.04);
}

.pdf-dropzone:hover::before,
.pdf-dropzone.drag-over::before {
    opacity: 1;
}

.pdf-dropzone.drag-over {
    border-style: solid;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.pdf-drop-icon {
    width: 72px;
    height: 72px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent-2);
    transition: transform 0.3s ease;
}

.pdf-dropzone:hover .pdf-drop-icon {
    transform: scale(1.08);
}

.pdf-drop-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pdf-drop-sub {
    font-size: 14px;
    color: var(--text-3);
    margin-bottom: 20px;
}

.pdf-drop-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-drop-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.pdf-drop-formats {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-3);
}

/* File List */
.pdf-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
}

.pdf-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
}

.pdf-file-item:hover {
    border-color: var(--border-2);
}

.pdf-file-item.dragging {
    opacity: 0.5;
    border-style: dashed;
}

.pdf-file-icon {
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--mono);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

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

.pdf-file-size {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

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

.pdf-file-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pdf-file-btn:hover {
    color: var(--text);
    border-color: var(--border-2);
}

.pdf-file-btn.danger:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

/* Page thumbnail grid (for split/reorganize) */
.pdf-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.pdf-page-thumb {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    aspect-ratio: 0.707;
    background: white;
}

.pdf-page-thumb canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pdf-page-thumb:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.pdf-page-thumb.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.pdf-page-num {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 100px;
}

.pdf-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.pdf-page-thumb.selected .pdf-check {
    opacity: 1;
}

/* Progress */
.pdf-progress {
    margin: 20px 0;
}

.pdf-progress-bar {
    height: 6px;
    background: var(--bg-3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.pdf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.pdf-progress-text {
    font-size: 13px;
    color: var(--text-3);
    text-align: center;
}

/* Download result */
.pdf-result {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.08));
    border: 1.5px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    margin-top: 20px;
}

.pdf-result-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.pdf-result-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--green);
}

.pdf-result-desc {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 20px;
}

.pdf-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sort handle */
.drag-handle {
    cursor: grab;
    color: var(--text-3);
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Responsive */
@media (max-width: 640px) {
    .pdf-dropzone {
        padding: 32px 16px;
    }

    .pdf-pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}