/* 1. 모달 배경 - 전체 화면 고정 */
.modal-overlay {
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); 
    display: none; /* 기본은 숨김, JS에서 flex로 변경 */
    align-items: center; 
    justify-content: center; 
    z-index: 1000;
}

/* 2. 모달 박스 - 고정 높이 설정 */
.modal-content {
    background: #fff; 
    padding: 20px; 
    border-radius: 12px; 
    width: min(600px, 95vw); 
    max-height: 95vh; /* 화면의 80% */
    display: flex; 
    flex-direction: column; /* 내부 요소를 세로로 배치 */
}

/* 3. 리스트 영역 - 이곳만 스크롤 발생 */
.sortable-list {
    list-style: none; 
    padding: 0; 
    margin: 20px 0;
    flex: 1;                /* 남은 공간 모두 차지 */
    overflow-y: auto;       /* 내용 많아지면 스크롤 생성 */
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* 4. 리스트 아이템 스타일 */
.sortable-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 4px;     /* 간격 살짝 부여 */
    background: #fff;
    border: 1px solid #dee2e6; /* 테두리 유지 */
    border-radius: 6px;
    cursor: grab;
    transition: background 0.2s;
}

.sortable-list li:hover {
    background: #fcfcfc;
}

.sortable-list li:active { 
    cursor: grabbing; 
}

.drag-handle {
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 5. 드래그 중인 아이템 효과 */
.sortable-ghost { 
    opacity: 0.4; 
    background: #e3f2fd !important; 
    border: 1px dashed #2196f3; /* 드래그 중임을 명확히 표시 */
}

/* 6. 모달 푸터 (버튼 영역 고정) */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 900px) {
    .modal-content {
        max-height: 100vh;
    }
}
