/* 개선된 권한 관리 스타일 */

.user-permissions-table {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-permissions-table h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.permission-paths {
    max-width: 350px;
}

/* 권한 상태 표시 개선 */
.permission-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.permission-status.no-permission {
    background: #ffebee;
    color: #c62828;
}

.permission-status.no-permission svg {
    fill: #c62828;
}

.permission-status.full-access {
    background: #e8f5e9;
    color: #2e7d32;
}

.permission-status.full-access svg {
    fill: #2e7d32;
}

.permission-status.limited-access {
    background: #fff3e0;
    color: #f57c00;
    padding: 4px 8px;
}

.permission-badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.path-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.more-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: #607d8b;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* 역할 배지 개선 */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.role-badge.user {
    background: #e0e7ff;
    color: #5a67d8;
    border: 1px solid #c7d2fe;
}

.role-badge svg {
    opacity: 0.9;
}

.no-permission {
    color: #999;
    font-style: italic;
}

.btn-set-permission {
    padding: 4px 12px;
    font-size: 13px;
}

/* 빠른 설정 섹션 */
.quick-settings {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quick-settings h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: #f5f5f5;
    border-color: #4CAF50;
}

/* 모달 스타일 */
.modal-lg {
    width: 90%;
    max-width: 900px;
}

.modal-lg .modal-content {
    width: 100%;
}

.permission-setting-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    min-height: 400px;
}

.folder-tree-section {
    border-right: 1px solid #e0e0e0;
    padding-right: 20px;
}

.folder-tree-section h4,
.permission-detail-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.folder-tree-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.folder-tree-controls .btn {
    padding: 4px 10px;
    font-size: 12px;
}

.folder-tree-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    background: #fafafa;
}

/* 폴더 트리 스타일 */
.folder-tree {
    font-size: 14px;
}

.tree-item {
    margin: 2px 0;
}

.tree-item[data-level="1"] {
    margin-left: 20px;
}

.tree-item[data-level="2"] {
    margin-left: 40px;
}

.tree-item[data-level="3"] {
    margin-left: 60px;
}

.tree-toggle,
.tree-toggle-empty {
    display: inline-block;
    width: 20px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    color: #666;
}

.tree-toggle:hover {
    color: #333;
}

.tree-toggle-empty {
    cursor: default;
}

.tree-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 3px;
    transition: background 0.2s;
}

.tree-label:hover {
    background: #e8f5e9;
}

.folder-checkbox {
    cursor: pointer;
}

.folder-icon {
    font-size: 16px;
}

.folder-name {
    color: #333;
    user-select: none;
}

.tree-children {
    display: block;
}

/* 권한 상세 섹션 */
.permission-detail-section {
    padding-left: 20px;
}

.selected-folders-info {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 120px;
}

.info-text {
    margin: 0;
    color: #666;
}

.selected-paths {
    margin-top: 10px;
}

.path-item {
    display: inline-block;
    padding: 4px 10px;
    margin: 3px;
    background: #4CAF50;
    color: white;
    border-radius: 3px;
    font-size: 12px;
}

.permission-options h5 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.permission-note {
    margin-top: 20px;
    padding: 12px;
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    border-radius: 3px;
}

.permission-note small {
    color: #666;
    line-height: 1.5;
}

/* 반응형 */
@media (max-width: 768px) {
    .modal-lg {
        width: 95%;
    }
    
    .permission-setting-container {
        grid-template-columns: 1fr;
    }
    
    .folder-tree-section {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    
    .permission-detail-section {
        padding-left: 0;
    }
}
