/* 파일 목록 개선 - 긴 파일명 전체 표시 */

/* 그리드 뷰 (아이콘 보기) - 파일명 전체 표시 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding: 16px;
}

.content-grid .content-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 4px;
    text-align: center;
    min-height: 140px;
    position: relative;
}

.content-grid .item-name {
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    width: 100%;
    line-height: 1.3;
    margin-top: 8px;
    /* 줄 수 제한 제거 - 전체 표시 */
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    max-height: none !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

/* 리스트 뷰 (자세히 보기) - 파일명 전체 표시 */
.list-table {
    width: 100%;
    border-collapse: collapse;
}

.list-table .item-name {
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    padding: 8px !important;
    line-height: 1.4 !important;
    /* 최대 너비 설정하여 적절히 줄바꿈 */
    max-width: 400px !important;
    min-width: 200px !important;
    display: block !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

/* 테이블 행 높이 자동 조절 */
.list-table tr {
    height: auto !important;
    min-height: 40px;
}

.list-table td {
    vertical-align: middle;
    padding: 8px;
}

/* 폴더 트리의 폴더명도 전체 표시 */
.tree-label {
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    flex: 1;
    line-height: 1.3;
    padding: 2px 0;
    display: inline-block !important;
    overflow: visible !important;
}

.tree-node-content {
    white-space: normal !important; /* 줄바꿈 허용 */
    min-height: 24px;
    height: auto !important;
    align-items: flex-start !important; /* 상단 정렬 */
    padding: 4px 6px !important;
}

/* 파일 아이템 호버 시에도 이름 전체 보이기 */
.content-item:hover .item-name,
.list-item:hover .item-name {
    overflow: visible !important;
    z-index: 10;
}

/* 툴팁 스타일 (필요시) */
.item-name[title] {
    cursor: help;
}

/* 파일 정보 영역 조정 */
.content-item .item-info {
    margin-top: auto;
    padding-top: 8px;
    width: 100%;
}

/* 긴 파일명을 가진 아이템의 최소 높이 조정 */
.content-grid .content-item {
    height: auto !important;
    min-height: 150px;
}

/* 액션 버튼 위치 조정 (긴 파일명 고려) */
.content-item .item-actions {
    position: relative;
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .list-table .item-name {
        max-width: 250px !important;
    }
}

/* 다크 모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    .content-item .item-name,
    .list-table .item-name,
    .tree-label {
        color: inherit;
    }
}