/*
 * PDF Merger page styles. Location: /tools/pdf/merge/assets/pdf-merger.css
 * Uses the design tokens from /assets/style.css (light and dark).
 */

.pdf-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 6px 0 18px;
    padding: 34px 20px 26px;
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel);
    text-align: center;
    transition: border-color .2s ease, background .2s ease;
}

.pdf-drop.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.pdf-drop-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.pdf-drop-hint {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.pdf-drop-actions {
    justify-content: center;
    margin: 6px 0;
}

.pdf-drop-note {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.pdf-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 18px;
    margin: 26px 0 12px;
}

.pdf-list-head h2 {
    margin: 0;
    font-size: 20px;
}

.pdf-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pdf-list.is-busy {
    opacity: .6;
}

.pdf-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    cursor: grab;
}

.pdf-item.is-dragging {
    opacity: .45;
}

.pdf-item.is-over {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.pdf-order {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 14px;
    font-weight: 800;
}

.pdf-info {
    display: grid;
    flex: 1;
    gap: 2px;
    min-width: 0;
}

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

.pdf-meta {
    color: var(--muted);
    font-size: 13px;
}

.pdf-controls {
    display: flex;
    flex: none;
    gap: 6px;
}

.pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 17px;
    cursor: pointer;
}

.pdf-btn:hover:not(:disabled) {
    background: var(--panel);
}

.pdf-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.pdf-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.pdf-btn-remove:hover:not(:disabled) {
    border-color: var(--err-line);
    background: var(--err-bg);
    color: var(--err-text);
}

.pdf-name {
    width: 190px;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.pdf-name:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.pdf-name-ext {
    margin-left: -4px;
    color: var(--muted);
    font-weight: 600;
}

.pdf-result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    margin: 16px 0;
    padding: 18px 20px;
    border: 1px solid var(--ok-line);
    border-radius: var(--radius);
    background: var(--ok-bg);
}

.pdf-result[hidden] {
    display: none;
}

.pdf-result p {
    margin: 0;
    color: var(--ok-text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.pdf-download {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    text-decoration: none;
}

.pdf-download:hover {
    background: var(--accent-hover);
    color: var(--on-accent);
}

.pdf-download:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

@media (max-width: 560px) {
    .pdf-item {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .pdf-controls {
        width: 100%;
        justify-content: flex-end;
    }
}
