/* 파일 관리 스타일 */

/* 뷰 헤더 스타일 */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.file-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 브레드크럼 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #1976d2;
}

.breadcrumb-separator {
    color: #999;
}

/* 보기 모드 토글 */
.view-mode-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.view-mode-btn {
    padding: 6px 10px;
    background: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.view-mode-btn:hover {
    background: #f5f5f5;
}

.view-mode-btn.active {
    background: #1976d2;
    color: white;
}

/* 파일 검색 */
.file-search {
    position: relative;
}

.file-search .search-input {
    padding: 6px 30px 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.file-search .search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 선택 액션 바 */
.selection-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #fff3e0;
    border-radius: 4px;
    margin-bottom: 15px;
}

.selection-info {
    font-weight: 600;
    color: #e65100;
}

.selection-buttons {
    display: flex;
    gap: 10px;
}

/* 파일 컨테이너 */
.file-container {
    background: white;
    border-radius: 8px;
    min-height: 400px;
    padding: 20px;
}

/* 격자 보기 */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.file-item {
    position: relative;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.file-item:hover {
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.file-item.selected {
    background: #e3f2fd;
    border-color: #1976d2;
}

.file-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.file-item:hover .file-checkbox,
.file-item.selected .file-checkbox,
.file-checkbox:has(input:checked) {
    opacity: 1;
}

.file-icon {
    margin-bottom: 10px;
}

.file-name {
    font-size: 13px;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.file-size {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.file-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.action-btn {
    padding: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.folder-item {
    background: #fafafa;
}

/* 목록 보기 */
.file-list {
    width: 100%;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table thead {
    background: #f5f5f5;
}

.file-table th {
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.file-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.file-table tbody tr:hover {
    background: #f8f9fa;
}

.file-table tbody tr.selected {
    background: #e3f2fd;
}

.file-table td {
    padding: 12px;
    font-size: 14px;
    vertical-align: middle;
}

.file-table td:first-child {
    text-align: center;
}

.file-table th:first-child {
    text-align: center;
}

/* 체크박스 셀 스타일 */
.checkbox-cell {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 12px !important;
}

.checkbox-header {
    text-align: center !important;
    vertical-align: middle !important;
}

/* 체크박스 스타일 */
.item-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
    vertical-align: middle;
}

/* 전체 선택 체크박스 */
#selectAll {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
    vertical-align: middle;
}

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 빈 폴더 */
.empty-folder {
    text-align: center;
    padding: 60px;
    color: #999;
    font-size: 14px;
}

/* 정보 바 */
.file-info-bar {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
}

/* 업로드 영역 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #1976d2;
    background: #f8f9fa;
}

.upload-area.dragging {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.upload-queue {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.upload-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.upload-progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.upload-progress-bar {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s;
}

/* 파일 상세 패널 */
.file-details-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 300px;
    background: white;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s;
}

.file-details-panel.active {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.panel-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.panel-body {
    padding: 20px;
}

.file-preview {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-info dl {
    margin: 0;
}

.file-info dt {
    font-weight: 600;
    color: #666;
    margin-top: 10px;
}

.file-info dd {
    margin: 5px 0;
    color: #333;
}

.panel-actions {
    margin-top: 20px;
}

.btn-block {
    width: 100%;
    margin-bottom: 10px;
}

/* 모달 크기 */
.modal-sm {
    width: 400px;
}

.modal-lg {
    width: 700px;
}

/* 반응형 */
@media (max-width: 768px) {
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .file-toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .file-details-panel {
        width: 100%;
    }
}
