/* =====================================================
   파일보관함 (FileBox) 슬라이드업 패널
   ===================================================== */

/* 오버레이 (전체화면) */
.filebox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 201;
    display: none;
    overflow-y: auto;
    font-family: 'Noto Sans KR', sans-serif;
}

.filebox-overlay.active {
    display: block;
}

/* [기존 배너] 복구 시 아래 주석 해제, filebox-hero-banner 관련 스타일 삭제
.filebox-about {
    height: 200px;
    margin-top: 48px;
    background-color: #5a86ff;
    background-image: url('../images/filebox/bg_text.png'), url('../images/filebox/bg_about.png');
    background-repeat: no-repeat, no-repeat;
    background-size: auto 40%, auto 70%;
    background-position: 30px center, right 20px center;
    position: relative;
}
*/

/* 파일보관함 배너 (메인 hero-banner와 동일 크기/위치) */
.filebox-hero-banner {
    width: 100%;
    height: 180px;
    background-color: #ffffff;
    /* [filebox gif 방식]
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    */
    /* [filebox mp4 방식] video 태그로 처리 */
    position: relative;
    overflow: hidden;
    margin-top: 48px;
}

.filebox-hero-banner video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* filebox 헤더 (z-index 오버레이 위) */
.filebox-header {
    z-index: 202;
}

/* 파일 리스트 영역 */
.filebox-list {
    padding: 40px 30px;
    background: #fff;
}

.filebox-list-title {
    font-size: 16px;
    color: #383838;
    font-weight: 500;
    display: block;
    margin-bottom: 10px;
}

.filebox-ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* 개별 파일 아이템 */
.filebox-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    margin-bottom: 10px;
}

.filebox-item:last-child {
    margin-bottom: 0;
}

/* 만료 상태 */
.filebox-item.expired {
    background-color: #f4f4f4;
}

.filebox-item.expired .filebox-item-filename {
    color: #777;
}

.filebox-item.expired .filebox-item-info,
.filebox-item.expired .filebox-item-desc {
    color: #828282;
}

/* 출력완료 상태 */
.filebox-item.printed {
    background-color: #f4f4f4;
}

.filebox-item.printed .filebox-item-filename {
    color: #777;
}

.filebox-item.printed .filebox-item-info {
    color: #585863;
}

.filebox-item.printed .filebox-item-desc {
    color: #828282;
}

/* 파일 내용 영역 */
.filebox-item-contents {
    display: flex;
    flex-direction: column;
    width: calc(100% - 74px);
}

.filebox-item-filename {
    font-size: 13px;
    font-weight: bold;
    color: #383838;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 1px 0;
}

.filebox-item-info {
    font-size: 12px;
    font-weight: 300;
    color: #adadad;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 1px 0;
}

.filebox-item-desc {
    font-size: 12px;
    font-weight: 300;
    color: #adadad;
    margin: 1px 0;
    line-height: 1.4;
}

/* type=file 일 때 info 색상 (기본 - status 클래스가 없는 경우 fallback) */
.filebox-item-contents.file .filebox-item-info {
    color: #5543ff;
}

/* type=task 일 때 info 색상 (기본 - status 클래스가 없는 경우 fallback) */
.filebox-item-contents.task .filebox-item-info {
    color: #ff78a9;
}

/* 상태별 info 텍스트 색상 */
.filebox-item-contents .filebox-item-info.status-registered {
    color: #5543ff;
}

.filebox-item-contents .filebox-item-info.status-paid {
    color: #e8842f;
}

.filebox-item-contents .filebox-item-info.status-printed {
    color: #888;
}

.filebox-item-contents .filebox-item-info.status-canceled {
    color: #c23616;
}

/* task의 만료 desc 작은 폰트 */
.filebox-item.expired .filebox-item-contents.task .filebox-item-desc {
    font-size: 10px;
}

/* 아이콘 영역 */
.filebox-item-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-size: cover;
}

.filebox-item-icon.already {
    background-image: url('../images/filebox/icon_already.png');
}

.filebox-item-icon.expired {
    background-image: url('../images/filebox/icon_expired.png');
}

.filebox-item-icon.task {
    background-image: url('../images/filebox/icon_task.png');
}

.filebox-item-icon.empty {
    background-image: url('../images/filebox/icon_empty.png');
}

.filebox-item-icon.entry {
    background-image: url('../images/filebox/icon_entry.png');
}

.filebox-item-icon.entry-complete {
    background-image: url('../images/filebox/icon_entry_complete.png');
}

/* 빈 상태 */
.filebox-item.filebox-empty {
    border: 1px solid #e0e0e0;
}

.filebox-empty .filebox-item-filename {
    color: #383838;
}

.filebox-empty .filebox-item-info,
.filebox-empty .filebox-item-desc {
    color: #adadad;
}

/* 로딩 상태 */
.filebox-loading {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 14px;
}

/* 토큰 입력 영역 */
.filebox-token-area {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.filebox-token-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    display: block;
}

.filebox-token-form {
    display: flex;
    gap: 8px;
}

.filebox-token-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Noto Sans KR', sans-serif;
    outline: none;
}

.filebox-token-input:focus {
    border-color: #5a86ff;
}

.filebox-token-btn {
    padding: 10px 18px;
    background: #5a86ff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.filebox-token-btn:active {
    background: #4a76ef;
}

/* =====================================================
   파일보관함 바코드(Receipt) 슬라이드업
   Vue Receipt.vue 디자인 재현
   ===================================================== */

.filebox-receipt {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: -moz-available;
    height: -webkit-fill-available;
    height: fill-available;
    box-sizing: border-box;
    z-index: 203;
    background-color: #fff;
    overflow: auto;
    display: none;
}

.filebox-receipt.active {
    display: block;
}

/* → common.css 공통 헤더 스타일 사용 */
.filebox-receipt-header {
    z-index: 204;
}

/* 비디오 배너 (645x400 비율) */
.filebox-receipt-banner {
    position: relative;
    width: 100%;
    padding-top: 62.02%; /* 400/645 = 62.02% 비율 유지 */
    margin-top: 48px;
    overflow: hidden;
    background-color: #ffffff;
}

.filebox-receipt-banner video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 본문 (배너 아래 배치) */
.filebox-receipt-body {
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 40px 30px 30px;
}

/* [기존 이미지 - 주석 처리 시 복구용]
.filebox-receipt-icon {
    width: 70%;
    max-width: 362px;
    margin-bottom: 10px;
    font-size: 0;
}

.filebox-receipt-icon img {
    width: 100%;
}

.filebox-receipt-title {
    width: 90%;
    max-width: 591px;
    margin-bottom: 10px;
    font-size: 0;
}

.filebox-receipt-title img {
    width: 100%;
}
*/

/* 바코드 영역 */
.filebox-receipt-barcode {
    width: 90%;
    margin-bottom: 30px;
}

.filebox-receipt-barcode svg {
    width: 100%;
}

/* 확인 버튼 */
.filebox-receipt-confirm {
    width: 100%;
    border: 0;
    outline: 0;
    background-color: #36353d;
    color: #fff;
    border-radius: 5px;
    padding: 12px 0;
    font-size: 16px;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
}

.filebox-receipt-confirm:active {
    background-color: #2a2930;
}

/* 아이템 클릭 가능 표시 (task, 미만료) */
.filebox-item.clickable {
    cursor: pointer;
}

/* =====================================================
   독립 페이지 (filebox/index.php) 전용 스타일
   ===================================================== */

/* filebox-about: 독립 페이지에서는 헤더 아래 배치 */
body > .filebox-about {
    margin-top: 48px;
}

/* 로그인 필요 State */
.filebox-login-required {
    text-align: center;
    padding: 80px 20px;
}

.filebox-login-required .login-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.filebox-login-required .login-text {
    font-size: 15px;
    color: #999;
    margin-bottom: 20px;
}

.filebox-login-required .login-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #fee500;
    color: #3c1e1e;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.filebox-login-required .login-btn:active {
    background: #e6cf00;
}

/* Toast 알림 */
.filebox-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(54, 53, 61, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Noto Sans KR', sans-serif;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.filebox-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =====================================================
   스와이프 삭제
   ===================================================== */

/* 스와이프 컨테이너 */
.filebox-item-swipe-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    margin-bottom: 10px;
}

.filebox-item-swipe-wrapper:last-child {
    margin-bottom: 0;
}

/* 스와이프 시 filebox-item의 margin 제거 (wrapper가 담당) */
.filebox-item-swipe-wrapper .filebox-item {
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    background: #fff;
    transition: transform 0.25s ease;
    will-change: transform;
}

.filebox-item-swipe-wrapper .filebox-item.expired,
.filebox-item-swipe-wrapper .filebox-item.printed {
    background: #f4f4f4;
}

/* 삭제 버튼 (카드 뒤에 숨겨짐) */
.filebox-swipe-delete {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: #e74c3c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    z-index: 0;
    border-radius: 0 5px 5px 0;
}

/* 스와이프 가이드 */
.filebox-swipe-guide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 0 6px;
}

.swipe-guide-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(54, 53, 61, 0.07);
    padding: 8px 18px 8px 14px;
    border-radius: 20px;
    animation: swipeGuideSlide 2.5s ease-in-out infinite;
}

.swipe-guide-hand {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    object-fit: contain;
}

.swipe-guide-text {
    font-size: 12px;
    color: #888;
    font-weight: 400;
    white-space: nowrap;
}

@keyframes swipeGuideSlide {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    15% { opacity: 1; }
    50% { transform: translateX(-16px); opacity: 1; }
    85% { opacity: 1; }
}

/* =====================================================
   삭제 모달
   ===================================================== */

.filebox-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.filebox-modal-overlay.active {
    display: flex;
}

.filebox-modal {
    background: #fff;
    border-radius: 16px;
    padding: 30px 24px 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.filebox-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filebox-modal-icon.warn {
    background: #fff3e0;
}

.filebox-modal-icon.warn svg {
    width: 28px;
    height: 28px;
    fill: #e8842f;
}

.filebox-modal-icon.block {
    background: #fce4ec;
}

.filebox-modal-icon.block svg {
    width: 28px;
    height: 28px;
    fill: #c23616;
}

.filebox-modal-message {
    font-size: 14px;
    color: #383838;
    line-height: 1.6;
    margin-bottom: 20px;
    word-break: keep-all;
}

.filebox-modal-message strong {
    color: #e8842f;
    font-weight: 600;
}

/* 체크박스 동의 */
.filebox-modal-check {
    margin-bottom: 18px;
}

.filebox-modal-check-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.filebox-modal-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e74c3c;
    cursor: pointer;
}

/* 버튼 영역 */
.filebox-modal-buttons {
    display: flex;
    gap: 10px;
}

.filebox-modal-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
}

.filebox-modal-btn:active {
    opacity: 0.8;
}

.filebox-modal-btn.cancel {
    background: #f0f0f0;
    color: #555;
}

.filebox-modal-btn.delete {
    background: #e74c3c;
    color: #fff;
}

.filebox-modal-btn.delete:disabled {
    background: #ddd;
    color: #aaa;
    cursor: not-allowed;
}

.filebox-modal-btn.navigate {
    background: #5a86ff;
    color: #fff;
}

/* 카드 삭제 애니메이션 */
.filebox-item-swipe-wrapper.removing {
    animation: slideOutRemove 0.3s ease forwards;
}

@keyframes slideOutRemove {
    to {
        transform: translateX(-100%);
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding: 0;
        overflow: hidden;
    }
}

/* =====================================================
   PC 레이아웃 — 400px 고정
   ===================================================== */
@media (min-width: 450px) {
    .filebox-overlay {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }

    .filebox-receipt {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
        width: 400px;
    }

    .filebox-toast {
        max-width: 400px;
    }

    .filebox-modal-overlay {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }

    .filebox-modal-overlay.active {
        transform: translateX(-50%);
    }
}