/* 논문 올리기 패널: '+ 논문 올리기' 바로 아래에 붙는 작은 카드. 색은 tokens.css를 쓴다. */
.upload-pop {
    position: fixed;
    z-index: 1100; /* 상단 바(1000) 위, 알림 창(3000) 아래 */
    width: min(400px, calc(100vw - 24px));
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 18px 48px rgba(39, 38, 30, 0.16), 0 2px 6px rgba(39, 38, 30, 0.06);
    font-family: var(--font-sans);
    display: grid;
    gap: 12px;
    transform-origin: top right;
    animation: upload-pop-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

/* 버튼 쪽을 가리키는 작은 꼬리 */
.upload-pop::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 44px;
    width: 10px;
    height: 10px;
    background: var(--surface);
    border-left: 1px solid var(--line-strong);
    border-top: 1px solid var(--line-strong);
    transform: rotate(45deg);
}

@keyframes upload-pop-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.upload-pop-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-pop-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.upload-pop-plan {
    font-size: 12px;
    color: var(--ink-soft);
    letter-spacing: 0.01em;
}

.upload-pop-close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
}

.upload-pop-close svg {
    width: 14px;
    height: 14px;
}

.upload-pop-close:hover {
    background: var(--pill);
    color: var(--ink);
}

.upload-drop {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-height: 172px;
    padding: 22px 16px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    text-align: center;
    cursor: pointer;
    align-content: center;
    transition: border-color 0.15s, background-color 0.15s;
}

.upload-drop:hover,
.upload-pop.is-dragging .upload-drop {
    border-color: var(--accent);
    background: var(--accent-tint);
}

.upload-drop:focus-visible,
.upload-pop-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.upload-drop:disabled {
    cursor: default;
    opacity: 0.55;
}

/* 종이 한 장: 끌어다 놓는 동안 살짝 떠오른다 */
.upload-drop-sheet {
    position: relative;
    width: 40px;
    height: 48px;
    margin-bottom: 6px;
    color: var(--accent);
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.upload-drop-sheet svg {
    width: 100%;
    height: 100%;
    display: block;
}

.upload-drop-sheet b {
    position: absolute;
    left: -6px;
    bottom: 3px;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.upload-pop.is-dragging .upload-drop-sheet {
    transform: translateY(-6px) rotate(-4deg);
}

.upload-drop-title {
    font-size: 14.5px;
    font-weight: 600;
}

.upload-drop-sub {
    font-size: 13px;
    color: var(--ink-soft);
}

.upload-drop-sub u {
    color: var(--accent-text);
    text-underline-offset: 3px;
}

.upload-pop-file {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: baseline;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--card);
}

.upload-pop-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    font-weight: 600;
}

.upload-pop-status {
    font-size: 12px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

/* 올리는 동안 끝을 모르는 진행 막대 */
.upload-pop-bar {
    grid-column: 1 / -1;
    position: relative;
    height: 4px;
    border-radius: 99px;
    background: var(--solid);
    overflow: hidden;
}

.upload-pop-bar i {
    position: absolute;
    inset: 0 auto 0 0;
    width: 36%;
    border-radius: 99px;
    background: var(--accent);
    animation: upload-pop-bar 1.1s ease-in-out infinite;
}

@keyframes upload-pop-bar {
    from { transform: translateX(-100%); }
    to { transform: translateX(290%); }
}

.upload-pop-error {
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, #c0392b 9%, var(--surface));
    color: #a1302a;
    font-size: 13px;
    line-height: 1.5;
}

/* 휴대폰: 화면 위쪽에 꽉 차게 */
@media (max-width: 560px) {
    .upload-pop {
        top: 64px;
        left: 12px;
        right: 12px;
        width: auto;
    }

    .upload-pop::before {
        display: none;
    }
}

/* 끌어다 놓기가 없는 터치 기기에서는 고르기 문구만 */
.upload-drop-touch {
    display: none;
}

@media (hover: none) {
    .upload-drop-pointer {
        display: none;
    }

    .upload-drop-touch {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .upload-pop,
    .upload-pop-bar i {
        animation: none;
    }

    .upload-drop-sheet {
        transition: none;
    }
}

/* display를 정한 요소도 hidden이면 숨긴다 */
.upload-pop[hidden],
.upload-pop-file[hidden],
.upload-pop-error[hidden] {
    display: none;
}
